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