mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
add static messages to workflow inventory lookups
This commit is contained in:
parent
9917841585
commit
9a4667c6c7
@ -494,6 +494,10 @@ export default ['$compile', 'Attr', 'Icon',
|
||||
html += `></paginate></div>`;
|
||||
}
|
||||
|
||||
if (options.mode === 'lookup' && options.lookupMessage) {
|
||||
html = `<div class="Prompt-bodyQuery">${options.lookupMessage}</div>` + html;
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
|
||||
@ -806,13 +806,19 @@ function($injector, $stateExtender, $log, i18n) {
|
||||
views: {
|
||||
'modal': {
|
||||
templateProvider: function(ListDefinition, generateList) {
|
||||
let list_html = generateList.build({
|
||||
const listConfig = {
|
||||
mode: 'lookup',
|
||||
list: ListDefinition,
|
||||
input_type: 'radio'
|
||||
});
|
||||
return `<lookup-modal>${list_html}</lookup-modal>`;
|
||||
};
|
||||
|
||||
if (field.lookupMessage) {
|
||||
listConfig.lookupMessage = field.lookupMessage;
|
||||
}
|
||||
|
||||
let list_html = generateList.build(listConfig);
|
||||
|
||||
return `<lookup-modal>${list_html}</lookup-modal>`;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
|
||||
import promptInventoryController from './prompt-inventory.controller';
|
||||
|
||||
export default [ 'templateUrl', 'QuerySet', 'GetBasePath', 'generateList', '$compile', 'InventoryList',
|
||||
(templateUrl, qs, GetBasePath, GenerateList, $compile, InventoryList) => {
|
||||
export default [ 'templateUrl', 'QuerySet', 'GetBasePath', 'generateList', '$compile', 'InventoryList', 'i18n',
|
||||
(templateUrl, qs, GetBasePath, GenerateList, $compile, InventoryList, i18n) => {
|
||||
return {
|
||||
scope: {
|
||||
promptData: '=',
|
||||
@ -46,11 +46,18 @@ export default [ 'templateUrl', 'QuerySet', 'GetBasePath', 'generateList', '$com
|
||||
let invList = _.cloneDeep(InventoryList);
|
||||
invList.disableRow = "{{ readOnlyPrompts }}";
|
||||
invList.disableRowValue = "readOnlyPrompts";
|
||||
let html = GenerateList.build({
|
||||
|
||||
const listConfig = {
|
||||
list: invList,
|
||||
input_type: 'radio',
|
||||
mode: 'lookup'
|
||||
});
|
||||
mode: 'lookup',
|
||||
};
|
||||
|
||||
if (scope.promptData.templateType === "workflow_job_template") {
|
||||
listConfig.lookupMessage = i18n._("This inventory is applied to all job templates nodes that prompt for an inventory.");
|
||||
}
|
||||
|
||||
let html = GenerateList.build(listConfig);
|
||||
|
||||
scope.list = invList;
|
||||
|
||||
|
||||
@ -71,6 +71,7 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
|
||||
inventory: {
|
||||
label: i18n._('Inventory'),
|
||||
type: 'lookup',
|
||||
lookupMessage: i18n._("This inventory is applied to all job templates nodes that prompt for an inventory."),
|
||||
basePath: 'inventory',
|
||||
list: 'InventoryList',
|
||||
sourceModel: 'inventory',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user