mirror of
https://github.com/ansible/awx.git
synced 2024-10-30 22:21:13 +03:00
Rename workflow approval migration. Add approval option back to workflow node form.
This commit is contained in:
parent
cf436eea37
commit
aac8c9fb04
@ -8,7 +8,7 @@ import django.db.models.deletion
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('main', '0082_v360_webhook_http_method'),
|
||||
('main', '0083_v360_job_branch_overrirde'),
|
||||
]
|
||||
|
||||
operations = [
|
@ -6,11 +6,11 @@
|
||||
|
||||
export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService', 'Rest', '$q',
|
||||
'TemplatesStrings', 'CreateSelect2', 'Empty', 'QuerySet', '$filter',
|
||||
'GetBasePath', 'TemplateList', 'ProjectList', 'InventorySourcesList', 'ProcessErrors',
|
||||
'GetBasePath', 'WorkflowNodeFormService', 'ProcessErrors',
|
||||
'i18n', 'ParseTypeChange', 'WorkflowJobTemplateModel',
|
||||
function($scope, TemplatesService, JobTemplate, PromptService, Rest, $q,
|
||||
TemplatesStrings, CreateSelect2, Empty, qs, $filter,
|
||||
GetBasePath, TemplateList, ProjectList, InventorySourcesList, ProcessErrors,
|
||||
GetBasePath, WorkflowNodeFormService, ProcessErrors,
|
||||
i18n, ParseTypeChange, WorkflowJobTemplate
|
||||
) {
|
||||
|
||||
@ -32,60 +32,14 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
|
||||
|
||||
$scope.strings = TemplatesStrings;
|
||||
$scope.editNodeHelpMessage = null;
|
||||
$scope.pauseNode = {};
|
||||
|
||||
let templateList = _.cloneDeep(TemplateList);
|
||||
delete templateList.actions;
|
||||
delete templateList.fields.type;
|
||||
delete templateList.fields.description;
|
||||
delete templateList.fields.smart_status;
|
||||
delete templateList.fields.labels;
|
||||
delete templateList.fieldActions;
|
||||
templateList.name = 'wf_maker_templates';
|
||||
templateList.iterator = 'wf_maker_template';
|
||||
templateList.fields.name.columnClass = "col-md-8";
|
||||
templateList.fields.name.tag = i18n._('WORKFLOW');
|
||||
templateList.fields.name.showTag = "{{wf_maker_template.type === 'workflow_job_template'}}";
|
||||
templateList.disableRow = "{{ readOnly }}";
|
||||
templateList.disableRowValue = 'readOnly';
|
||||
templateList.basePath = 'unified_job_templates';
|
||||
templateList.fields.info = {
|
||||
ngInclude: "'/static/partials/job-template-details.html'",
|
||||
type: 'template',
|
||||
columnClass: 'col-md-3',
|
||||
infoHeaderClass: 'col-md-3',
|
||||
label: '',
|
||||
nosort: true
|
||||
};
|
||||
templateList.maxVisiblePages = 5;
|
||||
templateList.searchBarFullWidth = true;
|
||||
$scope.templateList = templateList;
|
||||
|
||||
let inventorySourceList = _.cloneDeep(InventorySourcesList);
|
||||
inventorySourceList.name = 'wf_maker_inventory_sources';
|
||||
inventorySourceList.iterator = 'wf_maker_inventory_source';
|
||||
inventorySourceList.maxVisiblePages = 5;
|
||||
inventorySourceList.searchBarFullWidth = true;
|
||||
inventorySourceList.disableRow = "{{ readOnly }}";
|
||||
inventorySourceList.disableRowValue = 'readOnly';
|
||||
$scope.inventorySourceList = inventorySourceList;
|
||||
|
||||
let projectList = _.cloneDeep(ProjectList);
|
||||
delete projectList.fields.status;
|
||||
delete projectList.fields.scm_type;
|
||||
delete projectList.fields.last_updated;
|
||||
projectList.name = 'wf_maker_projects';
|
||||
projectList.iterator = 'wf_maker_project';
|
||||
projectList.fields.name.columnClass = "col-md-11";
|
||||
projectList.maxVisiblePages = 5;
|
||||
projectList.searchBarFullWidth = true;
|
||||
projectList.disableRow = "{{ readOnly }}";
|
||||
projectList.disableRowValue = 'readOnly';
|
||||
$scope.projectList = projectList;
|
||||
$scope.templateList = WorkflowNodeFormService.templateListDefinition();
|
||||
$scope.inventorySourceList = WorkflowNodeFormService.inventorySourceListDefinition();
|
||||
$scope.projectList = WorkflowNodeFormService.projectListDefinition();
|
||||
|
||||
const checkCredentialsForRequiredPasswords = () => {
|
||||
let credentialRequiresPassword = false;
|
||||
$scope.promptData.prompts.credentials.value.forEach((credential) => {
|
||||
$scope.jobNodeState.promptData.prompts.credentials.value.forEach((credential) => {
|
||||
if ((credential.passwords_needed &&
|
||||
credential.passwords_needed.length > 0) ||
|
||||
(_.has(credential, 'inputs.vault_password') &&
|
||||
@ -95,86 +49,143 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
|
||||
}
|
||||
});
|
||||
|
||||
$scope.credentialRequiresPassword = credentialRequiresPassword;
|
||||
$scope.jobNodeState.credentialRequiresPassword = credentialRequiresPassword;
|
||||
};
|
||||
|
||||
const watchForPromptChanges = () => {
|
||||
let promptDataToWatch = [
|
||||
'promptData.prompts.inventory.value',
|
||||
'promptData.prompts.verbosity.value',
|
||||
'missingSurveyValue'
|
||||
'jobNodeState.promptData.prompts.inventory.value',
|
||||
'jobNodeState.promptData.prompts.verbosity.value',
|
||||
'jobNodeState.missingSurveyValue'
|
||||
];
|
||||
|
||||
promptWatcher = $scope.$watchGroup(promptDataToWatch, () => {
|
||||
const templateType = _.get($scope, 'promptData.templateType');
|
||||
const templateType = _.get($scope, 'jobNodeState.promptData.templateType');
|
||||
let missingPromptValue = false;
|
||||
|
||||
if ($scope.missingSurveyValue) {
|
||||
if ($scope.jobNodeState.missingSurveyValue) {
|
||||
missingPromptValue = true;
|
||||
}
|
||||
|
||||
if (templateType !== "workflow_job_template") {
|
||||
if (!$scope.promptData.prompts.inventory.value || !$scope.promptData.prompts.inventory.value.id) {
|
||||
if (!$scope.jobNodeState.promptData.prompts.inventory.value || !$scope.jobNodeState.promptData.prompts.inventory.value.id) {
|
||||
missingPromptValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
$scope.promptModalMissingReqFields = missingPromptValue;
|
||||
$scope.jobNodeState.promptModalMissingReqFields = missingPromptValue;
|
||||
});
|
||||
|
||||
if ($scope.promptData.launchConf.ask_credential_on_launch && $scope.credentialRequiresPassword) {
|
||||
credentialsWatcher = $scope.$watch('promptData.prompts.credentials', () => {
|
||||
if ($scope.jobNodeState.promptData.launchConf.ask_credential_on_launch && $scope.jobNodeState.credentialRequiresPassword) {
|
||||
credentialsWatcher = $scope.$watch('jobNodeState.promptData.prompts.credentials', () => {
|
||||
checkCredentialsForRequiredPasswords();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const finishConfiguringAdd = () => {
|
||||
$scope.selectedTemplate = null;
|
||||
$scope.activeTab = "jobs";
|
||||
const alwaysOption = {
|
||||
label: $scope.strings.get('workflow_maker.ALWAYS'),
|
||||
value: 'always'
|
||||
};
|
||||
const successOption = {
|
||||
label: $scope.strings.get('workflow_maker.ON_SUCCESS'),
|
||||
value: 'success'
|
||||
};
|
||||
const failureOption = {
|
||||
label: $scope.strings.get('workflow_maker.ON_FAILURE'),
|
||||
value: 'failure'
|
||||
};
|
||||
$scope.edgeTypeOptions = [alwaysOption];
|
||||
switch($scope.nodeConfig.newNodeIsRoot) {
|
||||
case true:
|
||||
$scope.edgeType = alwaysOption;
|
||||
break;
|
||||
case false:
|
||||
$scope.edgeType = successOption;
|
||||
$scope.edgeTypeOptions.push(successOption, failureOption);
|
||||
break;
|
||||
const clearWatchers = () => {
|
||||
if (promptWatcher) {
|
||||
promptWatcher();
|
||||
}
|
||||
|
||||
if (surveyQuestionWatcher) {
|
||||
surveyQuestionWatcher();
|
||||
}
|
||||
|
||||
if (credentialsWatcher) {
|
||||
credentialsWatcher();
|
||||
}
|
||||
};
|
||||
|
||||
const select2ifyDropdowns = () => {
|
||||
CreateSelect2({
|
||||
element: '#workflow-node-types',
|
||||
multiple: false
|
||||
});
|
||||
CreateSelect2({
|
||||
element: '#workflow_node_edge',
|
||||
multiple: false
|
||||
});
|
||||
};
|
||||
|
||||
$scope.nodeFormDataLoaded = true;
|
||||
const formatPopOverDetails = (model) => {
|
||||
const popOverDetails = {};
|
||||
popOverDetails.playbook = model.playbook || i18n._('NONE SELECTED');
|
||||
Object.keys(model.summary_fields).forEach(field => {
|
||||
if (field === 'project') {
|
||||
popOverDetails.project = model.summary_fields[field].name || i18n._('NONE SELECTED');
|
||||
}
|
||||
if (field === 'inventory') {
|
||||
popOverDetails.inventory = model.summary_fields[field].name || i18n._('NONE SELECTED');
|
||||
}
|
||||
if (field === 'credentials') {
|
||||
if (model.summary_fields[field].length <= 0) {
|
||||
popOverDetails.credentials = i18n._('NONE SELECTED');
|
||||
}
|
||||
else {
|
||||
const credentialNames = model.summary_fields[field].map(({name}) => name);
|
||||
popOverDetails.credentials = credentialNames.join('<br />');
|
||||
}
|
||||
}
|
||||
});
|
||||
model.popOver = `
|
||||
<table>
|
||||
<tr>
|
||||
<td>${i18n._('INVENTORY')} </td>
|
||||
<td>${$filter('sanitize')(popOverDetails.inventory)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>${i18n._('PROJECT')} </td>
|
||||
<td>${$filter('sanitize')(popOverDetails.project)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>${i18n._('PLAYBOOK')} </td>
|
||||
<td>${$filter('sanitize')(popOverDetails.playbook)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>${i18n._('CREDENTIAL')} </td>
|
||||
<td>${$filter('sanitize')(popOverDetails.credentials)}</td>
|
||||
</tr>
|
||||
</table>
|
||||
`;
|
||||
};
|
||||
|
||||
const updateSelectedRow = () => {
|
||||
let unifiedJobTemplateId;
|
||||
switch($scope.activeTab) {
|
||||
case 'templates':
|
||||
unifiedJobTemplateId = _.get($scope, 'jobNodeState.selectedTemplate.id') || null;
|
||||
$scope.wf_maker_templates.forEach((row, i) => {
|
||||
if (row.type === 'job_template') {
|
||||
formatPopOverDetails(row);
|
||||
}
|
||||
$scope.wf_maker_templates[i].checked = (row.id === unifiedJobTemplateId) ? 1 : 0;
|
||||
});
|
||||
break;
|
||||
case 'project_syncs':
|
||||
unifiedJobTemplateId = _.get($scope, 'projectNodeState.selectedTemplate.id') || null;
|
||||
$scope.wf_maker_projects.forEach((row, i) => {
|
||||
$scope.wf_maker_projects[i].checked = (row.id === unifiedJobTemplateId) ? 1 : 0;
|
||||
});
|
||||
break;
|
||||
case 'inventory_syncs':
|
||||
unifiedJobTemplateId = _.get($scope, 'inventoryNodeState.selectedTemplate.id') || null;
|
||||
$scope.wf_maker_inventory_sources.forEach((row, i) => {
|
||||
$scope.wf_maker_inventory_sources[i].checked = (row.id === unifiedJobTemplateId) ? 1 : 0;
|
||||
});
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
const getEditNodeHelpMessage = (selectedTemplate, workflowJobTemplateObj) => {
|
||||
if (selectedTemplate) {
|
||||
if (selectedTemplate.type === "workflow_job_template") {
|
||||
if (workflowJobTemplateObj.inventory) {
|
||||
if (selectedTemplate.ask_inventory_on_launch) {
|
||||
return $scope.strings.get('workflow_maker.INVENTORY_WILL_OVERRIDE');
|
||||
}
|
||||
if (workflowJobTemplateObj.inventory && selectedTemplate.ask_inventory_on_launch) {
|
||||
return $scope.strings.get('workflow_maker.INVENTORY_WILL_OVERRIDE');
|
||||
}
|
||||
|
||||
if (workflowJobTemplateObj.ask_inventory_on_launch) {
|
||||
if (selectedTemplate.ask_inventory_on_launch) {
|
||||
return $scope.strings.get('workflow_maker.INVENTORY_PROMPT_WILL_OVERRIDE');
|
||||
}
|
||||
if (workflowJobTemplateObj.ask_inventory_on_launch && selectedTemplate.ask_inventory_on_launch) {
|
||||
return $scope.strings.get('workflow_maker.INVENTORY_PROMPT_WILL_OVERRIDE');
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,19 +221,19 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
|
||||
let jobTemplate = templateType === "workflow_job_template" ? new WorkflowJobTemplate() : new JobTemplate();
|
||||
|
||||
if (_.get($scope, 'nodeConfig.node.promptData') && !_.isEmpty($scope.nodeConfig.node.promptData)) {
|
||||
$scope.promptData = _.cloneDeep($scope.nodeConfig.node.promptData);
|
||||
const launchConf = $scope.promptData.launchConf;
|
||||
$scope.jobNodeState.promptData = _.cloneDeep($scope.nodeConfig.node.promptData);
|
||||
const launchConf = $scope.jobNodeState.promptData.launchConf;
|
||||
|
||||
if (!shouldShowPromptButton(launchConf)) {
|
||||
$scope.showPromptButton = false;
|
||||
$scope.promptModalMissingReqFields = false;
|
||||
$scope.jobNodeState.showPromptButton = false;
|
||||
$scope.jobNodeState.promptModalMissingReqFields = false;
|
||||
} else {
|
||||
$scope.showPromptButton = true;
|
||||
$scope.jobNodeState.showPromptButton = true;
|
||||
|
||||
if (templateType !== "workflow_job_template" && launchConf.ask_inventory_on_launch && !_.has(launchConf, 'defaults.inventory') && !_.has($scope, 'nodeConfig.node.originalNodeObject.summary_fields.inventory')) {
|
||||
$scope.promptModalMissingReqFields = true;
|
||||
$scope.jobNodeState.promptModalMissingReqFields = true;
|
||||
} else {
|
||||
$scope.promptModalMissingReqFields = false;
|
||||
$scope.jobNodeState.promptModalMissingReqFields = false;
|
||||
}
|
||||
}
|
||||
watchForPromptChanges();
|
||||
@ -286,9 +297,9 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
|
||||
((!$scope.nodeConfig.node.fullUnifiedJobTemplateObject.inventory && !launchConf.ask_inventory_on_launch) ||
|
||||
!$scope.nodeConfig.node.fullUnifiedJobTemplateObject.project)
|
||||
) {
|
||||
$scope.selectedTemplateInvalid = true;
|
||||
$scope.jobNodeState.selectedTemplateInvalid = true;
|
||||
} else {
|
||||
$scope.selectedTemplateInvalid = false;
|
||||
$scope.jobNodeState.selectedTemplateInvalid = false;
|
||||
}
|
||||
|
||||
let credentialRequiresPassword = false;
|
||||
@ -307,19 +318,19 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
|
||||
}
|
||||
});
|
||||
|
||||
$scope.credentialRequiresPassword = credentialRequiresPassword;
|
||||
$scope.jobNodeState.credentialRequiresPassword = credentialRequiresPassword;
|
||||
|
||||
if (!shouldShowPromptButton(launchConf)) {
|
||||
$scope.showPromptButton = false;
|
||||
$scope.promptModalMissingReqFields = false;
|
||||
$scope.jobNodeState.showPromptButton = false;
|
||||
$scope.jobNodeState.promptModalMissingReqFields = false;
|
||||
$scope.nodeFormDataLoaded = true;
|
||||
} else {
|
||||
$scope.showPromptButton = true;
|
||||
$scope.jobNodeState.showPromptButton = true;
|
||||
|
||||
if (launchConf.ask_inventory_on_launch && !_.has(launchConf, 'defaults.inventory') && !_.has($scope, 'nodeConfig.node.originalNodeObject.summary_fields.inventory')) {
|
||||
$scope.promptModalMissingReqFields = true;
|
||||
$scope.jobNodeState.promptModalMissingReqFields = true;
|
||||
} else {
|
||||
$scope.promptModalMissingReqFields = false;
|
||||
$scope.jobNodeState.promptModalMissingReqFields = false;
|
||||
}
|
||||
|
||||
if (responses[1].data.survey_enabled) {
|
||||
@ -332,7 +343,7 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
|
||||
extra_data: jsyaml.safeLoad(prompts.variables.value)
|
||||
});
|
||||
|
||||
$scope.missingSurveyValue = processed.missingSurveyValue;
|
||||
$scope.jobNodeState.missingSurveyValue = processed.missingSurveyValue;
|
||||
|
||||
$scope.extraVars = (processed.extra_data === '' || _.isEmpty(processed.extra_data)) ? '---' : '---\n' + jsyaml.safeDump(processed.extra_data);
|
||||
|
||||
@ -351,14 +362,14 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
|
||||
template: $scope.nodeConfig.node.fullUnifiedJobTemplateObject.id
|
||||
};
|
||||
|
||||
surveyQuestionWatcher = $scope.$watch('promptData.surveyQuestions', () => {
|
||||
surveyQuestionWatcher = $scope.$watch('jobNodeState.promptData.surveyQuestions', () => {
|
||||
let missingSurveyValue = false;
|
||||
_.each($scope.promptData.surveyQuestions, (question) => {
|
||||
_.each($scope.jobNodeState.promptData.surveyQuestions, (question) => {
|
||||
if (question.required && (Empty(question.model) || question.model === [])) {
|
||||
missingSurveyValue = true;
|
||||
}
|
||||
});
|
||||
$scope.missingSurveyValue = missingSurveyValue;
|
||||
$scope.jobNodeState.missingSurveyValue = missingSurveyValue;
|
||||
}, true);
|
||||
|
||||
checkCredentialsForRequiredPasswords();
|
||||
@ -368,7 +379,7 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
|
||||
$scope.nodeFormDataLoaded = true;
|
||||
});
|
||||
} else {
|
||||
$scope.nodeConfig.node.promptData = $scope.promptData = {
|
||||
$scope.nodeConfig.node.promptData = $scope.jobNodeState.promptData = {
|
||||
launchConf: launchConf,
|
||||
launchOptions: launchOptions,
|
||||
prompts: prompts,
|
||||
@ -389,39 +400,46 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
|
||||
}
|
||||
|
||||
if (_.get($scope, 'nodeConfig.node.fullUnifiedJobTemplateObject')) {
|
||||
$scope.selectedTemplate = $scope.nodeConfig.node.fullUnifiedJobTemplateObject;
|
||||
const selectedTemplate = $scope.nodeConfig.node.fullUnifiedJobTemplateObject;
|
||||
|
||||
if ($scope.selectedTemplate.unified_job_type) {
|
||||
switch ($scope.selectedTemplate.unified_job_type) {
|
||||
if (selectedTemplate.unified_job_type) {
|
||||
switch (selectedTemplate.unified_job_type) {
|
||||
case "job":
|
||||
$scope.activeTab = "jobs";
|
||||
$scope.activeTab = "templates";
|
||||
$scope.jobNodeState.selectedTemplate = selectedTemplate;
|
||||
break;
|
||||
case "project_update":
|
||||
$scope.activeTab = "project_syncs";
|
||||
$scope.projectNodeState.selectedTemplate = selectedTemplate;
|
||||
break;
|
||||
case "inventory_update":
|
||||
$scope.activeTab = "inventory_syncs";
|
||||
$scope.inventoryNodeState.selectedTemplate = selectedTemplate;
|
||||
break;
|
||||
}
|
||||
} else if ($scope.selectedTemplate.type) {
|
||||
switch ($scope.selectedTemplate.type) {
|
||||
} else if (selectedTemplate.type) {
|
||||
switch (selectedTemplate.type) {
|
||||
case "job_template":
|
||||
$scope.activeTab = "jobs";
|
||||
break;
|
||||
case "workflow_job_template":
|
||||
$scope.activeTab = "jobs";
|
||||
$scope.activeTab = "templates";
|
||||
$scope.jobNodeState.selectedTemplate = selectedTemplate;
|
||||
break;
|
||||
case "project":
|
||||
$scope.activeTab = "project_syncs";
|
||||
$scope.projectNodeState.selectedTemplate = selectedTemplate;
|
||||
break;
|
||||
case "inventory_source":
|
||||
$scope.activeTab = "inventory_syncs";
|
||||
$scope.inventoryNodeState.selectedTemplate = selectedTemplate;
|
||||
break;
|
||||
}
|
||||
}
|
||||
updateSelectedRow();
|
||||
} else {
|
||||
$scope.activeTab = "jobs";
|
||||
$scope.activeTab = "templates";
|
||||
}
|
||||
|
||||
select2ifyDropdowns();
|
||||
} else {
|
||||
$scope.jobTags = $scope.nodeConfig.node.originalNodeObject.job_tags ? $scope.nodeConfig.node.originalNodeObject.job_tags.split(',').map((tag) => (tag)) : [];
|
||||
$scope.skipTags = $scope.nodeConfig.node.originalNodeObject.skip_tags ? $scope.nodeConfig.node.originalNodeObject.skip_tags.split(',').map((tag) => (tag)) : [];
|
||||
@ -449,121 +467,30 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
|
||||
|
||||
};
|
||||
|
||||
const templateManuallySelected = (selectedTemplate) => {
|
||||
|
||||
if (promptWatcher) {
|
||||
promptWatcher();
|
||||
}
|
||||
|
||||
if (surveyQuestionWatcher) {
|
||||
surveyQuestionWatcher();
|
||||
}
|
||||
|
||||
if (credentialsWatcher) {
|
||||
credentialsWatcher();
|
||||
}
|
||||
|
||||
$scope.promptData = null;
|
||||
$scope.pauseNode = {};
|
||||
$scope.editNodeHelpMessage = getEditNodeHelpMessage(selectedTemplate, $scope.workflowJobTemplateObj);
|
||||
|
||||
if (selectedTemplate.type === "job_template" || selectedTemplate.type === "workflow_job_template") {
|
||||
let jobTemplate = selectedTemplate.type === "workflow_job_template" ? new WorkflowJobTemplate() : new JobTemplate();
|
||||
|
||||
$q.all([jobTemplate.optionsLaunch(selectedTemplate.id), jobTemplate.getLaunch(selectedTemplate.id)])
|
||||
.then((responses) => {
|
||||
let launchConf = responses[1].data;
|
||||
|
||||
let credentialRequiresPassword = false;
|
||||
let selectedTemplateInvalid = false;
|
||||
|
||||
if (selectedTemplate.type !== "workflow_job_template") {
|
||||
if ((!selectedTemplate.inventory && !launchConf.ask_inventory_on_launch) || !selectedTemplate.project) {
|
||||
selectedTemplateInvalid = true;
|
||||
}
|
||||
|
||||
if (launchConf.passwords_needed_to_start && launchConf.passwords_needed_to_start.length > 0) {
|
||||
credentialRequiresPassword = true;
|
||||
}
|
||||
}
|
||||
|
||||
$scope.credentialRequiresPassword = credentialRequiresPassword;
|
||||
$scope.selectedTemplateInvalid = selectedTemplateInvalid;
|
||||
$scope.selectedTemplate = angular.copy(selectedTemplate);
|
||||
|
||||
if (!shouldShowPromptButton(launchConf)) {
|
||||
$scope.showPromptButton = false;
|
||||
$scope.promptModalMissingReqFields = false;
|
||||
} else {
|
||||
$scope.showPromptButton = true;
|
||||
$scope.promptModalMissingReqFields = false;
|
||||
|
||||
if (selectedTemplate.type !== "workflow_job_template") {
|
||||
if (launchConf.ask_inventory_on_launch && !_.has(launchConf, 'defaults.inventory')) {
|
||||
$scope.promptModalMissingReqFields = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (launchConf.survey_enabled) {
|
||||
// go out and get the survey questions
|
||||
jobTemplate.getSurveyQuestions(selectedTemplate.id)
|
||||
.then((surveyQuestionRes) => {
|
||||
|
||||
let processed = PromptService.processSurveyQuestions({
|
||||
surveyQuestions: surveyQuestionRes.data.spec
|
||||
});
|
||||
|
||||
$scope.missingSurveyValue = processed.missingSurveyValue;
|
||||
|
||||
$scope.promptData = {
|
||||
launchConf: responses[1].data,
|
||||
launchOptions: responses[0].data,
|
||||
surveyQuestions: processed.surveyQuestions,
|
||||
template: selectedTemplate.id,
|
||||
templateType: selectedTemplate.type,
|
||||
prompts: PromptService.processPromptValues({
|
||||
launchConf: responses[1].data,
|
||||
launchOptions: responses[0].data
|
||||
}),
|
||||
};
|
||||
|
||||
surveyQuestionWatcher = $scope.$watch('promptData.surveyQuestions', () => {
|
||||
let missingSurveyValue = false;
|
||||
_.each($scope.promptData.surveyQuestions, (question) => {
|
||||
if (question.required && (Empty(question.model) || question.model === [])) {
|
||||
missingSurveyValue = true;
|
||||
}
|
||||
});
|
||||
$scope.missingSurveyValue = missingSurveyValue;
|
||||
}, true);
|
||||
|
||||
watchForPromptChanges();
|
||||
});
|
||||
} else {
|
||||
$scope.promptData = {
|
||||
launchConf: responses[1].data,
|
||||
launchOptions: responses[0].data,
|
||||
template: selectedTemplate.id,
|
||||
templateType: selectedTemplate.type,
|
||||
prompts: PromptService.processPromptValues({
|
||||
launchConf: responses[1].data,
|
||||
launchOptions: responses[0].data
|
||||
}),
|
||||
};
|
||||
|
||||
watchForPromptChanges();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$scope.selectedTemplate = angular.copy(selectedTemplate);
|
||||
$scope.selectedTemplateInvalid = false;
|
||||
$scope.showPromptButton = false;
|
||||
$scope.promptModalMissingReqFields = false;
|
||||
}
|
||||
};
|
||||
|
||||
const setupNodeForm = () => {
|
||||
$scope.jobNodeState = {
|
||||
credentialRequiresPassword: false,
|
||||
missingSurveyValue: false,
|
||||
promptData: null,
|
||||
promptModalMissingReqFields: false,
|
||||
searchTags: [],
|
||||
selectedTemplate: null,
|
||||
selectedTemplateInvalid: false,
|
||||
showPromptButton: false
|
||||
};
|
||||
$scope.projectNodeState = {
|
||||
searchTags: [],
|
||||
selectedTemplate: null
|
||||
};
|
||||
$scope.inventoryNodeState = {
|
||||
searchTags: [],
|
||||
selectedTemplate: null,
|
||||
};
|
||||
$scope.approvalNodeState = {
|
||||
name: null,
|
||||
description: null,
|
||||
timeout: 0
|
||||
};
|
||||
$scope.nodeFormDataLoaded = false;
|
||||
$scope.wf_maker_template_queryset = {
|
||||
page_size: '10',
|
||||
@ -618,32 +545,23 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
|
||||
})
|
||||
);
|
||||
|
||||
CreateSelect2({
|
||||
element: '#workflow-node-types',
|
||||
multiple: false
|
||||
});
|
||||
|
||||
$q.all(listPromises)
|
||||
.then(() => {
|
||||
if ($scope.nodeConfig.mode === "edit") {
|
||||
if ($scope.nodeConfig.node.unifiedJobTemplate && $scope.nodeConfig.node.unifiedJobTemplate.unified_job_type === "workflow_approval") {
|
||||
$scope.selectedTemplate = null;
|
||||
$scope.activeTab = "pause";
|
||||
CreateSelect2({
|
||||
element: '#workflow_node_edge',
|
||||
multiple: false
|
||||
});
|
||||
$scope.activeTab = "approval";
|
||||
select2ifyDropdowns();
|
||||
|
||||
$scope.pauseNode = {
|
||||
isPauseNode: true,
|
||||
$scope.approvalNodeState = {
|
||||
name: $scope.nodeConfig.node.unifiedJobTemplate.name,
|
||||
description: $scope.nodeConfig.node.unifiedJobTemplate.description,
|
||||
timeout: $scope.nodeConfig.node.unifiedJobTemplate.timeout
|
||||
};
|
||||
|
||||
|
||||
$scope.nodeFormDataLoaded = true;
|
||||
} else {
|
||||
// Make sure that we have the full unified job template object
|
||||
if (!$scope.nodeConfig.node.fullUnifiedJobTemplateObject) {
|
||||
if (!$scope.nodeConfig.node.fullUnifiedJobTemplateObject && _.has($scope, 'nodeConfig.node.originalNodeObject.summary_fields.unified_job_template')) {
|
||||
// This is a node that we got back from the api with an incomplete
|
||||
// unified job template so we're going to pull down the whole object
|
||||
TemplatesService.getUnifiedJobTemplate($scope.nodeConfig.node.originalNodeObject.summary_fields.unified_job_template.id)
|
||||
@ -662,104 +580,211 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
|
||||
}
|
||||
}
|
||||
} else {
|
||||
finishConfiguringAdd();
|
||||
$scope.activeTab = "templates";
|
||||
const alwaysOption = {
|
||||
label: $scope.strings.get('workflow_maker.ALWAYS'),
|
||||
value: 'always'
|
||||
};
|
||||
const successOption = {
|
||||
label: $scope.strings.get('workflow_maker.ON_SUCCESS'),
|
||||
value: 'success'
|
||||
};
|
||||
const failureOption = {
|
||||
label: $scope.strings.get('workflow_maker.ON_FAILURE'),
|
||||
value: 'failure'
|
||||
};
|
||||
$scope.edgeTypeOptions = [alwaysOption];
|
||||
switch($scope.nodeConfig.newNodeIsRoot) {
|
||||
case true:
|
||||
$scope.edgeType = alwaysOption;
|
||||
break;
|
||||
case false:
|
||||
$scope.edgeType = successOption;
|
||||
$scope.edgeTypeOptions.push(successOption, failureOption);
|
||||
break;
|
||||
}
|
||||
select2ifyDropdowns();
|
||||
|
||||
$scope.nodeFormDataLoaded = true;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const formatPopOverDetails = (model) => {
|
||||
const popOverDetails = {};
|
||||
popOverDetails.playbook = model.playbook || i18n._('NONE SELECTED');
|
||||
Object.keys(model.summary_fields).forEach(field => {
|
||||
if (field === 'project') {
|
||||
popOverDetails.project = model.summary_fields[field].name || i18n._('NONE SELECTED');
|
||||
}
|
||||
if (field === 'inventory') {
|
||||
popOverDetails.inventory = model.summary_fields[field].name || i18n._('NONE SELECTED');
|
||||
}
|
||||
if (field === 'credentials') {
|
||||
if (model.summary_fields[field].length <= 0) {
|
||||
popOverDetails.credentials = i18n._('NONE SELECTED');
|
||||
}
|
||||
else {
|
||||
const credentialNames = model.summary_fields[field].map(({name}) => name);
|
||||
popOverDetails.credentials = credentialNames.join('<br />');
|
||||
}
|
||||
}
|
||||
});
|
||||
model.popOver = `
|
||||
<dl>
|
||||
<dt>${i18n._('INVENTORY')}</dt>
|
||||
<dd>${$filter('sanitize')(popOverDetails.inventory)}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>${i18n._('PROJECT')}</dt>
|
||||
<dd>${$filter('sanitize')(popOverDetails.project)}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>${i18n._('PLAYBOOK')}</dt>
|
||||
<dd>${$filter('sanitize')(popOverDetails.playbook)}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>${i18n._('CREDENTIAL')}</dt>
|
||||
<dd>${$filter('sanitize')(popOverDetails.credentials)}</dd>
|
||||
</dl>
|
||||
`;
|
||||
$scope.confirmNodeForm = () => {
|
||||
const nodeFormData = {
|
||||
edgeType: $scope.edgeType
|
||||
};
|
||||
|
||||
if ($scope.activeTab === "approval") {
|
||||
nodeFormData.selectedTemplate = {
|
||||
name: $scope.approvalNodeState.name,
|
||||
description: $scope.approvalNodeState.description,
|
||||
timeout: $scope.approvalNodeState.timeout,
|
||||
unified_job_type: "workflow_approval"
|
||||
};
|
||||
} else if($scope.activeTab === "templates") {
|
||||
nodeFormData.selectedTemplate = $scope.jobNodeState.selectedTemplate;
|
||||
nodeFormData.promptData = $scope.jobNodeState.promptData;
|
||||
} else if($scope.activeTab === "project_syncs") {
|
||||
nodeFormData.selectedTemplate = $scope.projectNodeState.selectedTemplate;
|
||||
} else if($scope.activeTab === "inventory_syncs") {
|
||||
nodeFormData.selectedTemplate = $scope.inventoryNodeState.selectedTemplate;
|
||||
}
|
||||
|
||||
$scope.select({ nodeFormData });
|
||||
};
|
||||
|
||||
$scope.openPromptModal = () => {
|
||||
$scope.promptData.triggerModalOpen = true;
|
||||
$scope.jobNodeState.promptData.triggerModalOpen = true;
|
||||
};
|
||||
|
||||
$scope.toggle_row = (selectedRow) => {
|
||||
$scope.selectIsDisabled = () => {
|
||||
if($scope.activeTab === "templates") {
|
||||
return !($scope.jobNodeState.selectedTemplate) ||
|
||||
$scope.jobNodeState.promptModalMissingReqFields ||
|
||||
$scope.jobNodeState.credentialRequiresPassword ||
|
||||
$scope.jobNodeState.selectedTemplateInvalid;
|
||||
} else if($scope.activeTab === "project_syncs") {
|
||||
return !$scope.projectNodeState.selectedTemplate;
|
||||
} else if($scope.activeTab === "inventory_syncs") {
|
||||
return !$scope.inventoryNodeState.selectedTemplate;
|
||||
} else if ($scope.activeTab === "approval") {
|
||||
return !($scope.approvalNodeState.name && $scope.approvalNodeState.name !== "") || $scope.workflow_approval.pauseTimeout.$error.min;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.selectTemplate = (selectedTemplate) => {
|
||||
if (!$scope.readOnly) {
|
||||
templateManuallySelected(selectedRow);
|
||||
clearWatchers();
|
||||
|
||||
$scope.approvalNodeState = {
|
||||
name: null,
|
||||
description: null,
|
||||
timeout: 0
|
||||
};
|
||||
$scope.editNodeHelpMessage = getEditNodeHelpMessage(selectedTemplate, $scope.workflowJobTemplateObj);
|
||||
|
||||
if (selectedTemplate.type === "job_template" || selectedTemplate.type === "workflow_job_template") {
|
||||
let jobTemplate = selectedTemplate.type === "workflow_job_template" ? new WorkflowJobTemplate() : new JobTemplate();
|
||||
$scope.jobNodeState.promptData = null;
|
||||
|
||||
$q.all([jobTemplate.optionsLaunch(selectedTemplate.id), jobTemplate.getLaunch(selectedTemplate.id)])
|
||||
.then((responses) => {
|
||||
let launchConf = responses[1].data;
|
||||
|
||||
let credentialRequiresPassword = false;
|
||||
let selectedTemplateInvalid = false;
|
||||
|
||||
if (selectedTemplate.type !== "workflow_job_template") {
|
||||
if ((!selectedTemplate.inventory && !launchConf.ask_inventory_on_launch) || !selectedTemplate.project) {
|
||||
selectedTemplateInvalid = true;
|
||||
}
|
||||
|
||||
if (launchConf.passwords_needed_to_start && launchConf.passwords_needed_to_start.length > 0) {
|
||||
credentialRequiresPassword = true;
|
||||
}
|
||||
}
|
||||
|
||||
$scope.jobNodeState.credentialRequiresPassword = credentialRequiresPassword;
|
||||
$scope.jobNodeState.selectedTemplateInvalid = selectedTemplateInvalid;
|
||||
$scope.jobNodeState.selectedTemplate = angular.copy(selectedTemplate);
|
||||
updateSelectedRow();
|
||||
|
||||
if (!launchConf.survey_enabled &&
|
||||
!launchConf.ask_inventory_on_launch &&
|
||||
!launchConf.ask_credential_on_launch &&
|
||||
!launchConf.ask_verbosity_on_launch &&
|
||||
!launchConf.ask_job_type_on_launch &&
|
||||
!launchConf.ask_limit_on_launch &&
|
||||
!launchConf.ask_tags_on_launch &&
|
||||
!launchConf.ask_skip_tags_on_launch &&
|
||||
!launchConf.ask_diff_mode_on_launch &&
|
||||
!launchConf.credential_needed_to_start &&
|
||||
!launchConf.ask_variables_on_launch &&
|
||||
launchConf.variables_needed_to_start.length === 0) {
|
||||
$scope.jobNodeState.showPromptButton = false;
|
||||
$scope.jobNodeState.promptModalMissingReqFields = false;
|
||||
} else {
|
||||
$scope.jobNodeState.showPromptButton = true;
|
||||
$scope.jobNodeState.promptModalMissingReqFields = false;
|
||||
|
||||
if (selectedTemplate.type !== "workflow_job_template") {
|
||||
if (launchConf.ask_inventory_on_launch && !_.has(launchConf, 'defaults.inventory')) {
|
||||
$scope.jobNodeState.promptModalMissingReqFields = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (launchConf.survey_enabled) {
|
||||
// go out and get the survey questions
|
||||
jobTemplate.getSurveyQuestions(selectedTemplate.id)
|
||||
.then((surveyQuestionRes) => {
|
||||
|
||||
let processed = PromptService.processSurveyQuestions({
|
||||
surveyQuestions: surveyQuestionRes.data.spec
|
||||
});
|
||||
|
||||
$scope.jobNodeState.missingSurveyValue = processed.missingSurveyValue;
|
||||
|
||||
$scope.jobNodeState.promptData = {
|
||||
launchConf: responses[1].data,
|
||||
launchOptions: responses[0].data,
|
||||
surveyQuestions: processed.surveyQuestions,
|
||||
template: selectedTemplate.id,
|
||||
templateType: selectedTemplate.type,
|
||||
prompts: PromptService.processPromptValues({
|
||||
launchConf: responses[1].data,
|
||||
launchOptions: responses[0].data
|
||||
}),
|
||||
};
|
||||
|
||||
surveyQuestionWatcher = $scope.$watch('jobNodeState.promptData.surveyQuestions', () => {
|
||||
let missingSurveyValue = false;
|
||||
_.each($scope.jobNodeState.promptData.surveyQuestions, (question) => {
|
||||
if (question.required && (Empty(question.model) || question.model === [])) {
|
||||
missingSurveyValue = true;
|
||||
}
|
||||
});
|
||||
$scope.jobNodeState.missingSurveyValue = missingSurveyValue;
|
||||
}, true);
|
||||
|
||||
watchForPromptChanges();
|
||||
});
|
||||
} else {
|
||||
$scope.jobNodeState.promptData = {
|
||||
launchConf: responses[1].data,
|
||||
launchOptions: responses[0].data,
|
||||
template: selectedTemplate.id,
|
||||
templateType: selectedTemplate.type,
|
||||
prompts: PromptService.processPromptValues({
|
||||
launchConf: responses[1].data,
|
||||
launchOptions: responses[0].data
|
||||
}),
|
||||
};
|
||||
|
||||
watchForPromptChanges();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (selectedTemplate.type === "project") {
|
||||
$scope.projectNodeState.selectedTemplate = angular.copy(selectedTemplate);
|
||||
} else if (selectedTemplate.type === "inventory_source") {
|
||||
$scope.inventoryNodeState.selectedTemplate = angular.copy(selectedTemplate);
|
||||
}
|
||||
updateSelectedRow();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$watch('nodeConfig.nodeId', (newNodeId, oldNodeId) => {
|
||||
if (newNodeId !== oldNodeId) {
|
||||
clearWatchers();
|
||||
setupNodeForm();
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watchGroup(['wf_maker_templates', 'wf_maker_projects', 'wf_maker_inventory_sources', 'activeTab', 'selectedTemplate.id'], () => {
|
||||
const unifiedJobTemplateId = _.get($scope, 'selectedTemplate.id') || null;
|
||||
switch($scope.activeTab) {
|
||||
case 'jobs':
|
||||
$scope.wf_maker_templates.forEach((row, i) => {
|
||||
if (row.type === 'job_template') {
|
||||
formatPopOverDetails(row);
|
||||
}
|
||||
if(row.id === unifiedJobTemplateId) {
|
||||
$scope.wf_maker_templates[i].checked = 1;
|
||||
}
|
||||
else {
|
||||
$scope.wf_maker_templates[i].checked = 0;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'project_syncs':
|
||||
$scope.wf_maker_projects.forEach((row, i) => {
|
||||
if(row.id === unifiedJobTemplateId) {
|
||||
$scope.wf_maker_projects[i].checked = 1;
|
||||
}
|
||||
else {
|
||||
$scope.wf_maker_projects[i].checked = 0;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'inventory_syncs':
|
||||
$scope.wf_maker_inventory_sources.forEach((row, i) => {
|
||||
if(row.id === unifiedJobTemplateId) {
|
||||
$scope.wf_maker_inventory_sources[i].checked = 1;
|
||||
}
|
||||
else {
|
||||
$scope.wf_maker_inventory_sources[i].checked = 0;
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
$scope.$watchGroup(['wf_maker_templates', 'wf_maker_projects', 'wf_maker_inventory_sources', 'activeTab'], () => {
|
||||
updateSelectedRow();
|
||||
});
|
||||
|
||||
setupNodeForm();
|
||||
|
@ -8,38 +8,38 @@
|
||||
name="activeTab"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<option value="jobs" selected="selected">{{strings.get('workflow_maker.JOBS')}}</option>
|
||||
<option value="templates" selected="selected">{{strings.get('workflow_maker.TEMPLATE')}}</option>
|
||||
<option value="project_syncs" selected="selected">{{strings.get('workflow_maker.PROJECT_SYNC')}}</option>
|
||||
<option value="inventory_syncs" selected="selected">{{strings.get('workflow_maker.INVENTORY_SYNC')}}</option>
|
||||
<option value="pause" selected="selected">{{strings.get('workflow_maker.PAUSE_NODE')}}</option>
|
||||
<option value="approval" selected="selected">{{strings.get('workflow_maker.APPROVAL')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="WorkflowMaker-formLists" ng-show="!readOnly">
|
||||
<div id="workflow-jobs-list" ng-show="activeTab === 'jobs'">
|
||||
<div ng-hide="wf_maker_templates.length === 0 && (searchTags | isEmpty)">
|
||||
<smart-search django-model="wf_maker_templates" base-path="unified_job_templates" iterator="wf_maker_template" dataset="wf_maker_template_dataset" list="templateList" collection="wf_maker_templates" default-params="wf_maker_template_default_params" query-set="wf_maker_template_queryset" search-bar-full-width="true" search-tags="searchTags">
|
||||
<div id="workflow-jobs-list" ng-show="activeTab === 'templates'">
|
||||
<div ng-hide="wf_maker_templates.length === 0 && (jobNodeState.searchTags | isEmpty)">
|
||||
<smart-search django-model="wf_maker_templates" base-path="unified_job_templates" iterator="wf_maker_template" dataset="wf_maker_template_dataset" list="templateList" collection="wf_maker_templates" default-params="wf_maker_template_default_params" query-set="wf_maker_template_queryset" search-bar-full-width="true" search-tags="jobNodeState.searchTags">
|
||||
</smart-search>
|
||||
</div>
|
||||
|
||||
<div class="row" ng-show="wf_maker_templates.length === 0 && !(searchTags | isEmpty)">
|
||||
<div class="row" ng-show="wf_maker_templates.length === 0 && !(jobNodeState.searchTags | isEmpty)">
|
||||
<div class="col-lg-12 List-searchNoResults" translate>No records matched your search.</div>
|
||||
</div>
|
||||
<div class="List-noItems" ng-show="wf_maker_templates.length === 0 && (searchTags | isEmpty)" translate>PLEASE ADD ITEMS TO THIS LIST</div>
|
||||
<div class="List-noItems" ng-show="wf_maker_templates.length === 0 && (jobNodeState.searchTags | isEmpty)" translate>PLEASE ADD ITEMS TO THIS LIST</div>
|
||||
<div class="list-table-container" ng-show="wf_maker_templates.length > 0">
|
||||
<div id="templates_table" class="List-table" is-extended="false">
|
||||
<div class="List-lookupLayout List-tableHeaderRow">
|
||||
<div></div>
|
||||
<div class="d-flex h-100">
|
||||
<div class="col-md-8" base-path="unified_job_templates" collection="wf_maker_templates" dataset="wf_maker_template_dataset" column-sort="" column-field="name" column-iterator="wf_maker_template" column-no-sort="undefined" column-label="Name" column-custom-class="" query-set="wf_maker_template_queryset"></div>
|
||||
<div class="col-md-8" base-path="unified_job_templates" collection="wf_maker_templates" dataset="wf_maker_template_dataset" column-sort="" column-field="name" column-iterator="wf_maker_template" column-no-sort="undefined" column-label="{{:: strings.get('workflow_maker.NAME') }}" column-custom-class="" query-set="wf_maker_template_queryset"></div>
|
||||
<div class="List-tableHeader--info col-md-4" base-path="unified_job_templates" collection="wf_maker_templates" dataset="wf_maker_template_dataset" column-sort="" column-field="info" column-iterator="wf_maker_template" column-no-sort="true" column-label="" column-custom-class="" query-set="wf_maker_template_queryset"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-class="[template.success_class, {'List-tableRow--selected' : $stateParams['template_id'] == wf_maker_template.id}, {'List-tableRow--disabled': !wf_maker_template.summary_fields.user_capabilities.edit}]" id="{{ wf_maker_template.id }}" class="List-lookupLayout List-tableRow template_class" disable-row="{{ !wf_maker_template.summary_fields.user_capabilities.edit }}" ng-repeat="wf_maker_template in wf_maker_templates">
|
||||
<div class="List-centerEnd select-column">
|
||||
<input type="radio" ng-model="wf_maker_template.checked" ng-value="1" ng-false-value="0" name="check_template_{{wf_maker_template.id}}" ng-click="toggle_row(wf_maker_template)" ng-disabled="!wf_maker_template.summary_fields.user_capabilities.edit">
|
||||
<input type="radio" ng-model="wf_maker_template.checked" ng-value="1" ng-false-value="0" name="check_template_{{wf_maker_template.id}}" ng-click="selectTemplate(wf_maker_template)" ng-disabled="!wf_maker_template.summary_fields.user_capabilities.edit">
|
||||
</div>
|
||||
<div class="d-flex h-100">
|
||||
<div class="List-tableCell name-column col-md-8" ng-click="toggle_row(wf_maker_template)">
|
||||
<div class="List-tableCell name-column col-md-8" ng-click="selectTemplate(wf_maker_template)">
|
||||
{{wf_maker_template.name}}
|
||||
<span class="at-RowItem-tag" ng-show="wf_maker_template.type === 'workflow_job_template'">
|
||||
{{:: strings.get('workflow_maker.WORKFLOW') }}
|
||||
@ -53,29 +53,29 @@
|
||||
<paginate base-path="unified_job_templates" collection="wf_maker_templates" dataset="wf_maker_template_dataset" iterator="wf_maker_template" query-set="wf_maker_template_queryset" hide-view-per-page="true" max-visible-pages="5"></paginate>
|
||||
</div>
|
||||
<div id="workflow-project-sync-list" ng-show="activeTab === 'project_syncs'">
|
||||
<div ng-hide="wf_maker_projects.length === 0 && (searchTags | isEmpty)">
|
||||
<smart-search django-model="wf_maker_projects" base-path="projects" iterator="wf_maker_project" dataset="wf_maker_project_dataset" list="projectList" collection="wf_maker_projects" default-params="wf_maker_project_default_params" query-set="wf_maker_project_queryset" search-bar-full-width="true" search-tags="searchTags">
|
||||
<div ng-hide="wf_maker_projects.length === 0 && (projectNodeState.searchTags | isEmpty)">
|
||||
<smart-search django-model="wf_maker_projects" base-path="projects" iterator="wf_maker_project" dataset="wf_maker_project_dataset" list="projectList" collection="wf_maker_projects" default-params="wf_maker_project_default_params" query-set="wf_maker_project_queryset" search-bar-full-width="true" search-tags="projectNodeState.searchTags">
|
||||
</smart-search>
|
||||
</div>
|
||||
|
||||
<div class="row" ng-show="wf_maker_projects.length === 0 && !(searchTags | isEmpty)">
|
||||
<div class="row" ng-show="wf_maker_projects.length === 0 && !(projectNodeState.searchTags | isEmpty)">
|
||||
<div class="col-lg-12 List-searchNoResults" translate>No records matched your search.</div>
|
||||
</div>
|
||||
<div class="List-noItems" ng-show="wf_maker_projects.length === 0 && (searchTags | isEmpty)">No Projects Have Been Created</div>
|
||||
<div class="List-noItems" ng-show="wf_maker_projects.length === 0 && (projectNodeState.searchTags | isEmpty)" translate>No Projects Have Been Created</div>
|
||||
<div class="list-table-container" ng-show="wf_maker_projects.length > 0">
|
||||
<div id="projects_table" class="List-table" is-extended="false">
|
||||
<div class="List-lookupLayout List-tableHeaderRow">
|
||||
<div></div>
|
||||
<div class="d-flex h-100">
|
||||
<div base-path="projects" collection="wf_maker_projects" dataset="wf_maker_project_dataset" column-sort="" column-field="name" column-iterator="wf_maker_project" column-no-sort="undefined" column-label="Name" column-custom-class="col-md-12" query-set="wf_maker_project_queryset"></div>
|
||||
<div base-path="projects" collection="wf_maker_projects" dataset="wf_maker_project_dataset" column-sort="" column-field="name" column-iterator="wf_maker_project" column-no-sort="undefined" column-label="{{:: strings.get('workflow_maker.NAME') }}" column-custom-class="col-md-12" query-set="wf_maker_project_queryset"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-class="[wf_maker_project.success_class, {'List-tableRow--selected' : $stateParams['project_id'] == wf_maker_project.id}]" id="{{ wf_maker_project.id }}" class="List-lookupLayout List-tableRow project_class" ng-repeat="wf_maker_project in wf_maker_projects">
|
||||
<div class="List-centerEnd select-column">
|
||||
<input type="radio" ng-model="wf_maker_project.checked" ng-value="1" ng-false-value="0" name="check_project_{{wf_maker_project.id}}" ng-click="toggle_row(wf_maker_project)" ng-disabled="undefined">
|
||||
<input type="radio" ng-model="wf_maker_project.checked" ng-value="1" ng-false-value="0" name="check_project_{{wf_maker_project.id}}" ng-click="selectTemplate(wf_maker_project)" ng-disabled="undefined">
|
||||
</div>
|
||||
<div class="d-flex h-100">
|
||||
<div class="List-tableCell name-column col-md-12" ng-click="toggle_row(wf_maker_project)">{{ wf_maker_project.name }}</div>
|
||||
<div class="List-tableCell name-column col-md-12" ng-click="selectTemplate(wf_maker_project)">{{ wf_maker_project.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -83,67 +83,70 @@
|
||||
<paginate base-path="projects" collection="wf_maker_projects" dataset="wf_maker_project_dataset" iterator="wf_maker_project" query-set="wf_maker_project_queryset" hide-view-per-page="true" max-visible-pages="5"></paginate>
|
||||
</div>
|
||||
<div id="workflow-inventory-sync-list" ng-show="activeTab === 'inventory_syncs'">
|
||||
<div ng-hide="wf_maker_inventory_sources.length === 0 && (searchTags | isEmpty)">
|
||||
<smart-search django-model="wf_maker_inventory_sources" base-path="inventory_sources" iterator="wf_maker_inventory_source" dataset="wf_maker_inventory_source_dataset" list="inventorySourceList" collection="wf_maker_inventory_sources" default-params="wf_maker_inventory_source_default_params" query-set="wf_maker_inventory_source_queryset" search-bar-full-width="true" search-tags="searchTags">
|
||||
<div ng-hide="wf_maker_inventory_sources.length === 0 && (inventoryNodeState.searchTags | isEmpty)">
|
||||
<smart-search django-model="wf_maker_inventory_sources" base-path="inventory_sources" iterator="wf_maker_inventory_source" dataset="wf_maker_inventory_source_dataset" list="inventorySourceList" collection="wf_maker_inventory_sources" default-params="wf_maker_inventory_source_default_params" query-set="wf_maker_inventory_source_queryset" search-bar-full-width="true" search-tags="inventoryNodeState.searchTags">
|
||||
</smart-search>
|
||||
</div>
|
||||
|
||||
<div class="row" ng-show="wf_maker_inventory_sources.length === 0 && !(searchTags | isEmpty)">
|
||||
<div class="row" ng-show="wf_maker_inventory_sources.length === 0 && !(inventoryNodeState.searchTags | isEmpty)">
|
||||
<div class="col-lg-12 List-searchNoResults" translate>No records matched your search.</div>
|
||||
</div>
|
||||
<div class="List-noItems" ng-show="wf_maker_inventory_sources.length === 0 && (searchTags | isEmpty)">PLEASE ADD ITEMS TO THIS LIST</div>
|
||||
<div class="List-noItems" ng-show="wf_maker_inventory_sources.length === 0 && (inventoryNodeState.searchTags | isEmpty)" translate>PLEASE ADD ITEMS TO THIS LIST</div>
|
||||
<div class="list-table-container" ng-show="wf_maker_inventory_sources.length > 0">
|
||||
<div id="workflow_inventory_sources_table" class="List-table" is-extended="false">
|
||||
<div class="List-lookupLayout List-tableHeaderRow">
|
||||
<div></div>
|
||||
<div class="d-flex h-100">
|
||||
<div base-path="inventory_sources" collection="wf_maker_inventory_sources" dataset="wf_maker_inventory_source_dataset" column-sort="" column-field="name" column-iterator="wf_maker_inventory_source" column-no-sort="undefined" column-label="Name" column-custom-class="" query-set="wf_maker_inventory_source_queryset"></div>
|
||||
<div base-path="inventory_sources" collection="wf_maker_inventory_sources" dataset="wf_maker_inventory_source_dataset" column-sort="" column-field="name" column-iterator="wf_maker_inventory_source" column-no-sort="undefined" column-label="{{:: strings.get('workflow_maker.NAME') }}" column-custom-class="" query-set="wf_maker_inventory_source_queryset"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-class="[wf_maker_inventory_source.success_class, {'List-tableRow--selected' : $stateParams['inventory_source_id'] == wf_maker_inventory_source.id}]" id="{{ wf_maker_inventory_source.id }}" class="List-lookupLayout List-tableRow inventory_source_class" ng-repeat="wf_maker_inventory_source in wf_maker_inventory_sources">
|
||||
<div class="List-centerEnd select-column">
|
||||
<input type="radio" ng-model="wf_maker_inventory_source.checked" ng-value="1" ng-false-value="0" name="check_inventory_source_{{wf_maker_inventory_source.id}}" ng-click="toggle_row(wf_maker_inventory_source)" ng-disabled="undefined">
|
||||
<input type="radio" ng-model="wf_maker_inventory_source.checked" ng-value="1" ng-false-value="0" name="check_inventory_source_{{wf_maker_inventory_source.id}}" ng-click="selectTemplate(wf_maker_inventory_source)" ng-disabled="undefined">
|
||||
</div>
|
||||
<div class="d-flex h-100">
|
||||
<div class="List-tableCell name-column col-md-12" ng-click="toggle_row(wf_maker_inventory_source)">{{ wf_maker_inventory_source.name }}</div>
|
||||
<div class="List-tableCell name-column col-md-12" ng-click="selectTemplate(wf_maker_inventory_source)">{{ wf_maker_inventory_source.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<paginate base-path="inventory_sources" collection="wf_maker_inventory_sources" dataset="wf_maker_inventory_source_dataset" iterator="wf_maker_inventory_source" query-set="wf_maker_inventory_source_queryset" hide-view-per-page="true" max-visible-pages="5"></paginate>
|
||||
</div>
|
||||
<div id="workflow-pause" ng-show="activeTab === 'pause'">
|
||||
<label class="WorkflowMaker-pauseCheckbox">
|
||||
<input type="checkbox" ng-model="pauseNode.isPauseNode" />
|
||||
<!-- translate -->
|
||||
<span class="Form-inputLabel">Make this a pause node</span>
|
||||
</label>
|
||||
<div ng-hide="!pauseNode.isPauseNode">
|
||||
<div class="form-group Form-formGroup Form-formGroup--singleColumn">
|
||||
<label for="pauseName" class="Form-inputLabelContainer">
|
||||
<span class="Form-requiredAsterisk">*</span>
|
||||
<!-- translate -->
|
||||
<span class="Form-inputLabel">Name</span>
|
||||
</label>
|
||||
<div>
|
||||
<input type="text" ng-model="pauseNode.name" name="pauseName" id="workflow_job_template_pauseName" class="form-control Form-textInput" />
|
||||
</div>
|
||||
<form id="workflow_approval" name="workflow_approval" ng-show="activeTab === 'approval'">
|
||||
<div class="form-group Form-formGroup Form-formGroup--singleColumn">
|
||||
<label for="pauseName" class="Form-inputLabelContainer">
|
||||
<span class="Form-requiredAsterisk">*</span>
|
||||
<span class="Form-inputLabel" translate>Name</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group Form-formGroup Form-formGroup--singleColumn"></div>
|
||||
<label for="pauseDesc" class="Form-inputLabelContainer">
|
||||
<!-- translate -->
|
||||
<span class="Form-inputLabel">Description</span>
|
||||
</label>
|
||||
<div>
|
||||
<input type="text" ng-model="pauseNode.description" name="pauseDesc" id="workflow_job_template_pauseDesc" class="form-control Form-textInput" />
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" ng-model="approvalNodeState.name" name="pauseName" id="workflow_job_template_pauseName" class="form-control Form-textInput" />
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group Form-formGroup Form-formGroup--singleColumn">
|
||||
<label for="pauseDesc" class="Form-inputLabelContainer">
|
||||
<span class="Form-inputLabel" translate>Description</span>
|
||||
</label>
|
||||
<div>
|
||||
<input type="text" ng-model="approvalNodeState.description" name="pauseDesc" id="workflow_job_template_pauseDesc" class="form-control Form-textInput" />
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group Form-formGroup Form-formGroup--singleColumn">
|
||||
<label for="pauseTimeout" class="Form-inputLabelContainer">
|
||||
<span class="Form-inputLabel" translate>Timeout</span>
|
||||
<a id="workflow-maker-timeout-popover" href="" aw-pop-over="{{:: strings.get('workflow_maker.TIMEOUT_POPOVER') }}" data-placement="top" data-container="body" over-title="{{:: strings.get('workflow_maker.TIMEOUT') }}" class="help-link">
|
||||
<i class="fa fa-question-circle"></i>
|
||||
</a>
|
||||
</label>
|
||||
<div>
|
||||
<input type="number" value="0" min=0 aw-min="0" ng-model="approvalNodeState.timeout" name="pauseTimeout" id="workflow_job_template_pauseTimeout" aw-spinner="pauseTimeout" integer />
|
||||
<div class="error" id="workflow_job_template_pauseTimeout-minmax-error" ng-show="workflow_approval.pauseTimeout.$error.min" translate>Please enter a number greater than or equal to 0.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div ng-if="selectedTemplate && selectedTemplateInvalid">
|
||||
<div ng-if="selectedTemplate && jobNodeState.selectedTemplateInvalid">
|
||||
<div class="WorkflowMaker-invalidJobTemplateWarning">
|
||||
<span class="fa fa-warning"></span>
|
||||
<span>{{:: strings.get('workflows.INVALID_JOB_TEMPLATE') }}</span>
|
||||
@ -154,101 +157,105 @@
|
||||
<span class="fa fa-warning"></span>
|
||||
<span>{{:: strings.get('workflows.CREDENTIAL_WITH_PASS') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group Form-formGroup Form-formGroup--singleColumn" ng-show="nodeConfig.mode === 'add'">
|
||||
<label for="edgeType" class="Form-inputLabelContainer">
|
||||
<span class="Form-requiredAsterisk">*</span>
|
||||
<span class="Form-inputLabel">{{:: strings.get('workflow_maker.RUN') }}</span>
|
||||
</label>
|
||||
<div>
|
||||
<select
|
||||
id="workflow_node_edge"
|
||||
ng-options="v as v.label for v in edgeTypeOptions track by v.value"
|
||||
ng-model="edgeType"
|
||||
class="form-control Form-dropDown"
|
||||
name="edgeType"
|
||||
tabindex="-1"
|
||||
ng-disabled="readOnly"
|
||||
aria-hidden="true">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-show="readOnly">
|
||||
<div
|
||||
class="WorkflowMaker-readOnlyPromptText"
|
||||
ng-show="nodeConfig.node.originalNodeObject.job_type !== null ||
|
||||
(promptData.prompts.credentials.value && promptData.prompts.credentials.value.length > 0) ||
|
||||
nodeConfig.node.originalNodeObject.inventory !== null ||
|
||||
nodeConfig.node.originalNodeObject.limit !== null ||
|
||||
nodeConfig.node.originalNodeObject.verbosity !== null ||
|
||||
nodeConfig.node.originalNodeObject.job_tags !== null ||
|
||||
nodeConfig.node.originalNodeObject.skip_tags !== null ||
|
||||
nodeConfig.node.originalNodeObject.diff_mode !== null ||
|
||||
nodeConfig.node.originalNodeObject.scm_branch !== null ||
|
||||
showExtraVars">
|
||||
{{:: strings.get('workflow_maker.READ_ONLY_PROMPT_VALUES')}}
|
||||
</div>
|
||||
<div
|
||||
class="WorkflowMaker-readOnlyPromptText"
|
||||
ng-show="!(nodeConfig.node.originalNodeObject.job_type !== null ||
|
||||
(promptData.prompts.credentials.value && promptData.prompts.credentials.value.length > 0) ||
|
||||
nodeConfig.node.originalNodeObject.inventory !== null ||
|
||||
nodeConfig.node.originalNodeObject.limit !== null ||
|
||||
nodeConfig.node.originalNodeObject.verbosity !== null ||
|
||||
nodeConfig.node.originalNodeObject.job_tags !== null ||
|
||||
nodeConfig.node.originalNodeObject.skip_tags !== null ||
|
||||
nodeConfig.node.originalNodeObject.diff_mode !== null ||
|
||||
nodeConfig.node.originalNodeObject.scm_branch !== null ||
|
||||
showExtraVars)">
|
||||
{{:: strings.get('workflow_maker.READ_ONLY_NO_PROMPT_VALUES')}}
|
||||
</div>
|
||||
<div class="Prompt-previewRow--flex" ng-if="nodeConfig.node.originalNodeObject.job_type !== null">
|
||||
<div class="Prompt-previewRowTitle">{{:: strings.get('prompt.JOB_TYPE') }}</div>
|
||||
<div class="Prompt-previewRowValue">
|
||||
<span ng-if="nodeConfig.node.originalNodeObject.job_type === 'run'">{{:: strings.get('prompt.PLAYBOOK_RUN') }}</span>
|
||||
<span ng-if="nodeConfig.node.originalNodeObject.job_type === 'check'">{{:: strings.get('prompt.CHECK') }}</span>
|
||||
<div ng-if="selectedTemplate && jobNodeState.credentialRequiresPassword">
|
||||
<div class="WorkflowMaker-invalidJobTemplateWarning">
|
||||
<span class="fa fa-warning"></span>
|
||||
<span>{{:: strings.get('workflows.CREDENTIAL_WITH_PASS') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="Prompt-previewRow--flex" ng-if="nodeConfig.node.originalNodeObject.inventory !== null">
|
||||
<div class="Prompt-previewRowTitle">{{:: strings.get('prompt.INVENTORY') }}</div>
|
||||
<div class="Prompt-previewRowValue" ng-bind="nodeConfig.node.originalNodeObject.summary_fields.inventory.name"></div>
|
||||
</div>
|
||||
<div class="Prompt-previewRow--flex" ng-if="nodeConfig.node.originalNodeObject.limit !== null">
|
||||
<div class="Prompt-previewRowTitle">{{:: strings.get('prompt.LIMIT') }}</div>
|
||||
<div class="Prompt-previewRowValue" ng-bind="nodeConfig.node.originalNodeObject.limit"></div>
|
||||
</div>
|
||||
<div class="Prompt-previewRow--flex" ng-if="nodeConfig.node.originalNodeObject.verbosity !== null">
|
||||
<div class="Prompt-previewRowTitle">{{:: strings.get('prompt.VERBOSITY') }}</div>
|
||||
<div class="Prompt-previewRowValue" ng-bind="nodeConfig.node.originalNodeObject.verbosity"></div>
|
||||
</div>
|
||||
<div class="Prompt-previewRow--noflex" ng-if="nodeConfig.node.originalNodeObject.job_tags !== null">
|
||||
<div class="Prompt-previewRowTitle">
|
||||
<span>{{:: strings.get('prompt.JOB_TAGS') }} </span>
|
||||
<span ng-click="showJobTags = !showJobTags">
|
||||
<span class="fa fa-caret-down" ng-show="showJobTags" ></span>
|
||||
<span class="fa fa-caret-left" ng-show="!showJobTags"></span>
|
||||
</span>
|
||||
<div class="form-group Form-formGroup Form-formGroup--singleColumn" ng-show="nodeConfig.mode === 'add'">
|
||||
<label for="edgeType" class="Form-inputLabelContainer">
|
||||
<span class="Form-requiredAsterisk">*</span>
|
||||
<span class="Form-inputLabel">{{:: strings.get('workflow_maker.RUN') }}</span>
|
||||
</label>
|
||||
<div>
|
||||
<select
|
||||
id="workflow_node_edge"
|
||||
ng-options="v as v.label for v in edgeTypeOptions track by v.value"
|
||||
ng-model="edgeType"
|
||||
class="form-control Form-dropDown"
|
||||
name="edgeType"
|
||||
tabindex="-1"
|
||||
ng-disabled="readOnly"
|
||||
aria-hidden="true">
|
||||
</select>
|
||||
</div>
|
||||
<div ng-show="showJobTags" class="Prompt-previewTagContainer">
|
||||
<div class="u-wordwrap" ng-repeat="tag in jobTags">
|
||||
<div class="LabelList-tag">
|
||||
<span>{{tag}}</span>
|
||||
</div>
|
||||
<div ng-show="readOnly">
|
||||
<div
|
||||
class="WorkflowMaker-readOnlyPromptText"
|
||||
ng-show="nodeConfig.node.originalNodeObject.job_type !== null ||
|
||||
(jobNodeState.promptData.prompts.credentials.value && jobNodeState.promptData.prompts.credentials.value.length > 0) ||
|
||||
nodeConfig.node.originalNodeObject.inventory !== null ||
|
||||
nodeConfig.node.originalNodeObject.limit !== null ||
|
||||
nodeConfig.node.originalNodeObject.verbosity !== null ||
|
||||
nodeConfig.node.originalNodeObject.job_tags !== null ||
|
||||
nodeConfig.node.originalNodeObject.skip_tags !== null ||
|
||||
nodeConfig.node.originalNodeObject.diff_mode !== null ||
|
||||
showExtraVars">
|
||||
{{:: strings.get('workflow_maker.READ_ONLY_PROMPT_VALUES')}}
|
||||
</div>
|
||||
<div
|
||||
class="WorkflowMaker-readOnlyPromptText"
|
||||
ng-show="!(nodeConfig.node.originalNodeObject.job_type !== null ||
|
||||
(jobNodeState.promptData.prompts.credentials.value && jobNodeState.promptData.prompts.credentials.value.length > 0) ||
|
||||
nodeConfig.node.originalNodeObject.inventory !== null ||
|
||||
nodeConfig.node.originalNodeObject.limit !== null ||
|
||||
nodeConfig.node.originalNodeObject.verbosity !== null ||
|
||||
nodeConfig.node.originalNodeObject.job_tags !== null ||
|
||||
nodeConfig.node.originalNodeObject.skip_tags !== null ||
|
||||
nodeConfig.node.originalNodeObject.diff_mode !== null ||
|
||||
showExtraVars)">
|
||||
{{:: strings.get('workflow_maker.READ_ONLY_NO_PROMPT_VALUES')}}
|
||||
</div>
|
||||
<div class="Prompt-previewRow--flex" ng-if="nodeConfig.node.originalNodeObject.job_type !== null">
|
||||
<div class="Prompt-previewRowTitle">{{:: strings.get('prompt.JOB_TYPE') }}</div>
|
||||
<div class="Prompt-previewRowValue">
|
||||
<span ng-if="nodeConfig.node.originalNodeObject.job_type === 'run'">{{:: strings.get('prompt.PLAYBOOK_RUN') }}</span>
|
||||
<span ng-if="nodeConfig.node.originalNodeObject.job_type === 'check'">{{:: strings.get('prompt.CHECK') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="Prompt-previewRow--flex" ng-if="nodeConfig.node.originalNodeObject.inventory !== null">
|
||||
<div class="Prompt-previewRowTitle">{{:: strings.get('prompt.INVENTORY') }}</div>
|
||||
<div class="Prompt-previewRowValue" ng-bind="nodeConfig.node.originalNodeObject.summary_fields.inventory.name"></div>
|
||||
</div>
|
||||
<div class="Prompt-previewRow--flex" ng-if="nodeConfig.node.originalNodeObject.limit !== null">
|
||||
<div class="Prompt-previewRowTitle">{{:: strings.get('prompt.LIMIT') }}</div>
|
||||
<div class="Prompt-previewRowValue" ng-bind="nodeConfig.node.originalNodeObject.limit"></div>
|
||||
</div>
|
||||
<div class="Prompt-previewRow--flex" ng-if="nodeConfig.node.originalNodeObject.verbosity !== null">
|
||||
<div class="Prompt-previewRowTitle">{{:: strings.get('prompt.VERBOSITY') }}</div>
|
||||
<div class="Prompt-previewRowValue" ng-bind="nodeConfig.node.originalNodeObject.verbosity"></div>
|
||||
</div>
|
||||
<div class="Prompt-previewRow--noflex" ng-if="nodeConfig.node.originalNodeObject.job_tags !== null">
|
||||
<div class="Prompt-previewRowTitle">
|
||||
<span>{{:: strings.get('prompt.JOB_TAGS') }} </span>
|
||||
<span ng-click="showJobTags = !showJobTags">
|
||||
<span class="fa fa-caret-down" ng-show="showJobTags" ></span>
|
||||
<span class="fa fa-caret-left" ng-show="!showJobTags"></span>
|
||||
</span>
|
||||
</div>
|
||||
<div ng-show="showJobTags" class="Prompt-previewTagContainer">
|
||||
<div class="u-wordwrap" ng-repeat="tag in jobTags">
|
||||
<div class="LabelList-tag">
|
||||
<span>{{tag}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="Prompt-previewRow--noflex" ng-if="nodeConfig.node.originalNodeObject.skip_tags !== null">
|
||||
<div class="Prompt-previewRowTitle">
|
||||
<span>{{:: strings.get('prompt.SKIP_TAGS') }} </span>
|
||||
<span ng-click="showSkipTags = !showSkipTags">
|
||||
<span class="fa fa-caret-down" ng-show="showSkipTags" ></span>
|
||||
<span class="fa fa-caret-left" ng-show="!showSkipTags"></span>
|
||||
</span>
|
||||
</div>
|
||||
<div ng-show="showSkipTags" class="Prompt-previewTagContainer">
|
||||
<div class="u-wordwrap" ng-repeat="tag in skipTags">
|
||||
<div class="LabelList-tag">
|
||||
<span>{{tag}}</span>
|
||||
<div class="Prompt-previewRow--noflex" ng-if="nodeConfig.node.originalNodeObject.skip_tags !== null">
|
||||
<div class="Prompt-previewRowTitle">
|
||||
<span>{{:: strings.get('prompt.SKIP_TAGS') }} </span>
|
||||
<span ng-click="showSkipTags = !showSkipTags">
|
||||
<span class="fa fa-caret-down" ng-show="showSkipTags" ></span>
|
||||
<span class="fa fa-caret-left" ng-show="!showSkipTags"></span>
|
||||
</span>
|
||||
</div>
|
||||
<div ng-show="showSkipTags" class="Prompt-previewTagContainer">
|
||||
<div class="u-wordwrap" ng-repeat="tag in skipTags">
|
||||
<div class="LabelList-tag">
|
||||
<span>{{tag}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -256,8 +263,8 @@
|
||||
<div class="Prompt-previewRow--flex" ng-if="nodeConfig.node.originalNodeObject.diff_mode !== null">
|
||||
<div class="Prompt-previewRowTitle">{{:: strings.get('prompt.SHOW_CHANGES') }}</div>
|
||||
<div class="Prompt-previewRowValue">
|
||||
<span ng-if="promptData.prompts.diffMode.value">{{:: strings.get('ON') }}</span>
|
||||
<span ng-if="!promptData.prompts.diffMode.value">{{:: strings.get('OFF') }}</span>
|
||||
<span ng-if="jobNodeState.promptData.prompts.diffMode.value">{{:: strings.get('ON') }}</span>
|
||||
<span ng-if="!jobNodeState.promptData.prompts.diffMode.value">{{:: strings.get('OFF') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="Prompt-previewRow--flex" ng-if="nodeConfig.node.originalNodeObject.scm_branch !== null">
|
||||
@ -269,16 +276,16 @@
|
||||
<div>
|
||||
<textarea rows="6" ng-model="extraVars" name="node_form_extra_vars" class="form-control Form-textArea Form-textAreaLabel" id="workflow_node_form_extra_vars"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-show="editNodeHelpMessage && activeTab === 'templates'" class="WorkflowMaker-formHelp" ng-bind="editNodeHelpMessage"></div>
|
||||
<br />
|
||||
<div class="buttons Form-buttons" id="workflow_maker_controls">
|
||||
<button type="button" class="btn btn-sm Form-primaryButton Form-primaryButton--noMargin" id="workflow_maker_prompt_btn" ng-show="jobNodeState.showPromptButton && activeTab == 'templates' " ng-click="openPromptModal()"> {{:: strings.get('prompt.PROMPT') }}</button>
|
||||
<button type="button" class="btn btn-sm Form-cancelButton" id="workflow_maker_cancel_node_btn" ng-show="!readOnly" ng-click="cancel()"> {{:: strings.get('CANCEL') }}</button>
|
||||
<button type="button" class="btn btn-sm Form-cancelButton" id="workflow_maker_close_node_btn" ng-show="readOnly" ng-click="cancel()"> {{:: strings.get('CLOSE') }}</button>
|
||||
<button type="button" class="btn btn-sm Form-saveButton" id="workflow_maker_select_node_btn" ng-show="!readOnly" ng-click="confirmNodeForm()" ng-disabled="selectIsDisabled()"> {{:: strings.get('workflow_maker.SELECT') }}</button>
|
||||
</div>
|
||||
<prompt prompt-data="jobNodeState.promptData" action-text="{{:: strings.get('prompt.CONFIRM')}}" prevent-creds-with-passwords="preventCredsWithPasswords" read-only-prompts="readOnly"></prompt>
|
||||
</div>
|
||||
<div ng-show="editNodeHelpMessage && activeTab === 'jobs'" class="WorkflowMaker-formHelp" ng-bind="editNodeHelpMessage"></div>
|
||||
<br />
|
||||
<div class="buttons Form-buttons" id="workflow_maker_controls">
|
||||
<button type="button" class="btn btn-sm Form-primaryButton Form-primaryButton--noMargin" id="workflow_maker_prompt_btn" ng-show="showPromptButton && activeTab == 'jobs' " ng-click="openPromptModal()"> {{:: strings.get('prompt.PROMPT') }}</button>
|
||||
<button type="button" class="btn btn-sm Form-cancelButton" id="workflow_maker_cancel_node_btn" ng-show="!readOnly" ng-click="cancel()"> {{:: strings.get('CANCEL') }}</button>
|
||||
<button type="button" class="btn btn-sm Form-cancelButton" id="workflow_maker_close_node_btn" ng-show="readOnly" ng-click="cancel()"> {{:: strings.get('CLOSE') }}</button>
|
||||
<!-- need to figure out how to disable this button when pause node is incomplete -->
|
||||
<button type="button" class="btn btn-sm Form-saveButton" id="workflow_maker_select_node_btn" ng-show="!readOnly" ng-click="select({selectedTemplate, promptData, edgeType, pauseNode})" ng-disabled="!(selectedTemplate || pauseNode.isPauseNode) || promptModalMissingReqFields || credentialRequiresPassword || selectedTemplateInvalid || (pauseNode.isPauseNode && !pauseNode.name)"> {{:: strings.get('workflow_maker.SELECT') }}</button>
|
||||
</div>
|
||||
<prompt prompt-data="promptData" action-text="{{:: strings.get('prompt.CONFIRM')}}" prevent-creds-with-passwords="preventCredsWithPasswords" read-only-prompts="readOnly"></prompt>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user