mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
open and close workflow visualizer from list
This commit is contained in:
@@ -12,6 +12,7 @@ function TemplatesStrings (BaseString) {
|
|||||||
PANEL_TITLE: t.s('TEMPLATES'),
|
PANEL_TITLE: t.s('TEMPLATES'),
|
||||||
ADD_DD_JT_LABEL: t.s('Job Template'),
|
ADD_DD_JT_LABEL: t.s('Job Template'),
|
||||||
ADD_DD_WF_LABEL: t.s('Workflow Template'),
|
ADD_DD_WF_LABEL: t.s('Workflow Template'),
|
||||||
|
OPEN_WORKFLOW_VISUALIZER: t.s('Click here to open the workflow visualizer'),
|
||||||
ROW_ITEM_LABEL_ACTIVITY: t.s('Activity'),
|
ROW_ITEM_LABEL_ACTIVITY: t.s('Activity'),
|
||||||
ROW_ITEM_LABEL_INVENTORY: t.s('Inventory'),
|
ROW_ITEM_LABEL_INVENTORY: t.s('Inventory'),
|
||||||
ROW_ITEM_LABEL_PROJECT: t.s('Project'),
|
ROW_ITEM_LABEL_PROJECT: t.s('Project'),
|
||||||
|
|||||||
@@ -101,6 +101,14 @@ function ListTemplatesController(
|
|||||||
|
|
||||||
vm.isPortalMode = $state.includes('portalMode');
|
vm.isPortalMode = $state.includes('portalMode');
|
||||||
|
|
||||||
|
vm.openWorkflowVisualizer = template => {
|
||||||
|
const name = 'templates.editWorkflowJobTemplate.workflowMaker';
|
||||||
|
const params = { workflow_job_template_id: template.id };
|
||||||
|
const options = { reload: false };
|
||||||
|
|
||||||
|
$state.go(name, params, options);
|
||||||
|
};
|
||||||
|
|
||||||
vm.deleteTemplate = template => {
|
vm.deleteTemplate = template => {
|
||||||
if (!template) {
|
if (!template) {
|
||||||
Alert(strings.get('error.DELETE'), strings.get('alert.MISSING_PARAMETER'));
|
Alert(strings.get('error.DELETE'), strings.get('alert.MISSING_PARAMETER'));
|
||||||
|
|||||||
@@ -93,6 +93,11 @@
|
|||||||
ng-show="!vm.isPortalMode && template.summary_fields.user_capabilities.copy"
|
ng-show="!vm.isPortalMode && template.summary_fields.user_capabilities.copy"
|
||||||
tooltip="{{:: vm.strings.get('listActions.COPY', vm.getType(template)) }}">
|
tooltip="{{:: vm.strings.get('listActions.COPY', vm.getType(template)) }}">
|
||||||
</at-row-action>
|
</at-row-action>
|
||||||
|
<at-row-action icon="fa-sitemap" ng-click="vm.openWorkflowVisualizer(template)"
|
||||||
|
ng-show="!vm.isPortalMode && template.summary_fields.user_capabilities.edit"
|
||||||
|
ng-if="template.type === 'workflow_job_template'"
|
||||||
|
tooltip="{{:: vm.strings.get('list.OPEN_WORKFLOW_VISUALIZER') }}">
|
||||||
|
</at-row-action>
|
||||||
<at-row-action icon="fa-trash" ng-click="vm.deleteTemplate(template)"
|
<at-row-action icon="fa-trash" ng-click="vm.deleteTemplate(template)"
|
||||||
ng-show="!vm.isPortalMode && template.summary_fields.user_capabilities.delete"
|
ng-show="!vm.isPortalMode && template.summary_fields.user_capabilities.delete"
|
||||||
tooltip="{{:: vm.strings.get('listActions.DELETE', vm.getType(template)) }}">
|
tooltip="{{:: vm.strings.get('listActions.DELETE', vm.getType(template)) }}">
|
||||||
|
|||||||
@@ -237,14 +237,6 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
|
|||||||
class: 'Form-primaryButton',
|
class: 'Form-primaryButton',
|
||||||
awToolTip: '{{surveyTooltip}}',
|
awToolTip: '{{surveyTooltip}}',
|
||||||
dataPlacement: 'top'
|
dataPlacement: 'top'
|
||||||
},
|
|
||||||
workflow_visualizer: {
|
|
||||||
ngClick: 'openWorkflowMaker()',
|
|
||||||
ngShow: '$state.is(\'templates.addWorkflowJobTemplate\') || $state.is(\'templates.editWorkflowJobTemplate\') || $state.is(\'templates.editWorkflowJobTemplate.workflowMaker\')',
|
|
||||||
awToolTip: '{{workflowVisualizerTooltip}}',
|
|
||||||
dataPlacement: 'top',
|
|
||||||
label: i18n._('Workflow Visualizer'),
|
|
||||||
class: 'Form-primaryButton'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -60,10 +60,6 @@ export default [
|
|||||||
$scope.inventory_name = Inventory.name;
|
$scope.inventory_name = Inventory.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.openWorkflowMaker = function() {
|
|
||||||
$state.go('.workflowMaker');
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.formSave = function () {
|
$scope.formSave = function () {
|
||||||
let fld, data = {};
|
let fld, data = {};
|
||||||
$scope.invalid_survey = false;
|
$scope.invalid_survey = false;
|
||||||
@@ -266,7 +262,6 @@ export default [
|
|||||||
opts: opts
|
opts: opts
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.workflowVisualizerTooltip = i18n._("Click here to open the workflow visualizer.");
|
|
||||||
$scope.surveyTooltip = i18n._('Surveys allow users to be prompted at job launch with a series of questions related to the job. This allows for variables to be defined that affect the playbook run at time of launch.');
|
$scope.surveyTooltip = i18n._('Surveys allow users to be prompted at job launch with a series of questions related to the job. This allows for variables to be defined that affect the playbook run at time of launch.');
|
||||||
|
|
||||||
$scope.workflow_job_template_obj = workflowJobTemplateData;
|
$scope.workflow_job_template_obj = workflowJobTemplateData;
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
|
|
||||||
export default ['$scope', 'WorkflowService', 'TemplatesService',
|
export default ['$scope', 'WorkflowService', 'TemplatesService',
|
||||||
'ProcessErrors', 'CreateSelect2', '$q', 'JobTemplateModel', 'WorkflowJobTemplateModel',
|
'ProcessErrors', 'CreateSelect2', '$q', 'JobTemplateModel', 'WorkflowJobTemplateModel',
|
||||||
'Empty', 'PromptService', 'Rest', 'TemplatesStrings', '$timeout',
|
'Empty', 'PromptService', 'Rest', 'TemplatesStrings', '$timeout', '$state',
|
||||||
function ($scope, WorkflowService, TemplatesService,
|
function ($scope, WorkflowService, TemplatesService,
|
||||||
ProcessErrors, CreateSelect2, $q, JobTemplate, WorkflowJobTemplate,
|
ProcessErrors, CreateSelect2, $q, JobTemplate, WorkflowJobTemplate,
|
||||||
Empty, PromptService, Rest, TemplatesStrings, $timeout) {
|
Empty, PromptService, Rest, TemplatesStrings, $timeout, $state) {
|
||||||
|
|
||||||
let promptWatcher, surveyQuestionWatcher, credentialsWatcher;
|
let promptWatcher, surveyQuestionWatcher, credentialsWatcher;
|
||||||
|
|
||||||
@@ -360,6 +360,7 @@ export default ['$scope', 'WorkflowService', 'TemplatesService',
|
|||||||
// Revert the data to the master which was created when the dialog was opened
|
// Revert the data to the master which was created when the dialog was opened
|
||||||
$scope.treeData.data = angular.copy($scope.treeDataMaster);
|
$scope.treeData.data = angular.copy($scope.treeDataMaster);
|
||||||
$scope.closeDialog();
|
$scope.closeDialog();
|
||||||
|
$state.transitionTo('templates');
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.saveWorkflowMaker = function () {
|
$scope.saveWorkflowMaker = function () {
|
||||||
@@ -409,6 +410,7 @@ export default ['$scope', 'WorkflowService', 'TemplatesService',
|
|||||||
return $q.all(associatePromises.concat(credentialPromises))
|
return $q.all(associatePromises.concat(credentialPromises))
|
||||||
.then(function () {
|
.then(function () {
|
||||||
$scope.closeDialog();
|
$scope.closeDialog();
|
||||||
|
$state.transitionTo('templates');
|
||||||
});
|
});
|
||||||
}).catch(({
|
}).catch(({
|
||||||
data,
|
data,
|
||||||
@@ -432,6 +434,7 @@ export default ['$scope', 'WorkflowService', 'TemplatesService',
|
|||||||
$q.all(deletePromises)
|
$q.all(deletePromises)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
$scope.closeDialog();
|
$scope.closeDialog();
|
||||||
|
$state.transitionTo('templates');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user