mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 22:37:41 -02:30
Merge pull request #4096 from mabashian/4091-workflow-form
Fix field enablement on workflow form Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
@@ -42,14 +42,14 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
|
|||||||
label: i18n._('Name'),
|
label: i18n._('Name'),
|
||||||
type: 'text',
|
type: 'text',
|
||||||
required: true,
|
required: true,
|
||||||
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)',
|
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit)',
|
||||||
column: 1
|
column: 1
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: i18n._('Description'),
|
label: i18n._('Description'),
|
||||||
type: 'text',
|
type: 'text',
|
||||||
column: 1,
|
column: 1,
|
||||||
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)'
|
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit)'
|
||||||
},
|
},
|
||||||
organization: {
|
organization: {
|
||||||
label: i18n._('Organization'),
|
label: i18n._('Organization'),
|
||||||
@@ -65,8 +65,8 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
|
|||||||
reqExpression: '!current_user.is_superuser'
|
reqExpression: '!current_user.is_superuser'
|
||||||
},
|
},
|
||||||
column: 1,
|
column: 1,
|
||||||
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate) || !canEditOrg',
|
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit) || !canEditOrg',
|
||||||
awLookupWhen: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate) && canEditOrg'
|
awLookupWhen: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit) && canEditOrg'
|
||||||
},
|
},
|
||||||
inventory: {
|
inventory: {
|
||||||
label: i18n._('Inventory'),
|
label: i18n._('Inventory'),
|
||||||
@@ -87,7 +87,7 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
|
|||||||
ngChange: 'workflow_job_template_form.inventory_name.$validate()',
|
ngChange: 'workflow_job_template_form.inventory_name.$validate()',
|
||||||
text: i18n._('Prompt on launch')
|
text: i18n._('Prompt on launch')
|
||||||
},
|
},
|
||||||
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate) || !canEditInventory',
|
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit) || !canEditInventory',
|
||||||
},
|
},
|
||||||
labels: {
|
labels: {
|
||||||
label: i18n._('Labels'),
|
label: i18n._('Labels'),
|
||||||
@@ -102,7 +102,7 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
|
|||||||
ngShow: 'workflow_job_template_labels_isValid !== true',
|
ngShow: 'workflow_job_template_labels_isValid !== true',
|
||||||
text: i18n._('Max 512 characters per label.'),
|
text: i18n._('Max 512 characters per label.'),
|
||||||
},
|
},
|
||||||
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)'
|
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit)'
|
||||||
},
|
},
|
||||||
variables: {
|
variables: {
|
||||||
label: i18n._('Extra Variables'),
|
label: i18n._('Extra Variables'),
|
||||||
@@ -119,7 +119,7 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
|
|||||||
variable: 'ask_variables_on_launch',
|
variable: 'ask_variables_on_launch',
|
||||||
text: i18n._('Prompt on launch')
|
text: i18n._('Prompt on launch')
|
||||||
},
|
},
|
||||||
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)' // TODO: get working
|
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit)' // TODO: get working
|
||||||
},
|
},
|
||||||
checkbox_group: {
|
checkbox_group: {
|
||||||
label: i18n._('Options'),
|
label: i18n._('Options'),
|
||||||
@@ -133,7 +133,7 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
|
|||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataTitle: i18n._('Enable Concurrent Jobs'),
|
dataTitle: i18n._('Enable Concurrent Jobs'),
|
||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)'
|
ngDisabled: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit)'
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -142,22 +142,22 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
|
|||||||
launch: {
|
launch: {
|
||||||
component: 'at-launch-template',
|
component: 'at-launch-template',
|
||||||
templateObj: 'workflow_job_template_obj',
|
templateObj: 'workflow_job_template_obj',
|
||||||
ngShow: '(workflow_job_template_obj.summary_fields.user_capabilities.start || canAddWorkflowJobTemplate)',
|
ngShow: '(workflow_job_template_obj.summary_fields.user_capabilities.start || canAddOrEdit)',
|
||||||
ngDisabled: 'disableLaunch || workflow_job_template_form.$dirty',
|
ngDisabled: 'disableLaunch || workflow_job_template_form.$dirty',
|
||||||
showTextButton: 'true'
|
showTextButton: 'true'
|
||||||
},
|
},
|
||||||
cancel: {
|
cancel: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)'
|
ngShow: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit)'
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
ngClick: 'formCancel()',
|
ngClick: 'formCancel()',
|
||||||
ngShow: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)'
|
ngShow: '!(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit)'
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()', //$scope.function to call on click, optional
|
ngClick: 'formSave()', //$scope.function to call on click, optional
|
||||||
ngDisabled: "workflow_job_template_form.$invalid || can_edit!==true", //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons
|
ngDisabled: "workflow_job_template_form.$invalid || can_edit!==true", //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons
|
||||||
ngShow: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)'
|
ngShow: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit)'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
|
|||||||
awToolTip: i18n._('Add a permission'),
|
awToolTip: i18n._('Add a permission'),
|
||||||
actionClass: 'at-Button--add',
|
actionClass: 'at-Button--add',
|
||||||
actionId: 'button-add',
|
actionId: 'button-add',
|
||||||
ngShow: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)'
|
ngShow: '(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit)'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
|
|||||||
relatedButtons: {
|
relatedButtons: {
|
||||||
view_survey: {
|
view_survey: {
|
||||||
ngClick: 'editSurvey()',
|
ngClick: 'editSurvey()',
|
||||||
ngShow: '($state.is(\'templates.addWorkflowJobTemplate\') || $state.is(\'templates.editWorkflowJobTemplate\') || $state.is(\'templates.editWorkflowJobTemplate.workflowMaker\')) && survey_exists && !(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate)',
|
ngShow: '($state.is(\'templates.addWorkflowJobTemplate\') || $state.is(\'templates.editWorkflowJobTemplate\') || $state.is(\'templates.editWorkflowJobTemplate.workflowMaker\')) && survey_exists && !(workflow_job_template_obj.summary_fields.user_capabilities.edit || canAddOrEdit)',
|
||||||
label: i18n._('View Survey'),
|
label: i18n._('View Survey'),
|
||||||
class: 'Form-primaryButton'
|
class: 'Form-primaryButton'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default [
|
|||||||
|
|
||||||
const workflowTemplate = resolvedModels[1];
|
const workflowTemplate = resolvedModels[1];
|
||||||
|
|
||||||
$scope.canAddOrEdit = workflowTemplate.options('actions.POST');
|
$scope.canAddOrEdit = workflowTemplate.options('actions.POST') ? true : false;
|
||||||
|
|
||||||
$scope.canEditOrg = true;
|
$scope.canEditOrg = true;
|
||||||
$scope.canEditInventory = true;
|
$scope.canEditInventory = true;
|
||||||
|
|||||||
@@ -137,6 +137,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="WorkflowMaker-buttonHolder">
|
<div class="WorkflowMaker-buttonHolder">
|
||||||
<button type="button" class="btn btn-sm WorkflowMaker-cancelButton" ng-click="closeDialog()"> {{:: strings.get('CLOSE') }}</button>
|
<button type="button" class="btn btn-sm WorkflowMaker-cancelButton" ng-click="closeDialog()"> {{:: strings.get('CLOSE') }}</button>
|
||||||
<button type="button" class="btn btn-sm WorkflowMaker-saveButton" ng-click="saveWorkflowMaker()" ng-show="workflowJobTemplateObj.summary_fields.user_capabilities.edit || canAddWorkflowJobTemplate" ng-disabled="formState.showNodeForm || formState.showLinkForm"> {{:: strings.get('SAVE') }}</button>
|
<button type="button" class="btn btn-sm WorkflowMaker-saveButton" ng-click="saveWorkflowMaker()" ng-show="workflowJobTemplateObj.summary_fields.user_capabilities.edit || canAddOrEdit" ng-disabled="formState.showNodeForm || formState.showLinkForm"> {{:: strings.get('SAVE') }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -367,7 +367,6 @@
|
|||||||
<workflow-chart
|
<workflow-chart
|
||||||
graph-state="graphState"
|
graph-state="graphState"
|
||||||
workflow-zoomed="workflowZoomed(zoom)"
|
workflow-zoomed="workflowZoomed(zoom)"
|
||||||
can-add-workflow-job-template="canAddWorkflowJobTemplate"
|
|
||||||
mode="details"
|
mode="details"
|
||||||
read-only="readOnly"
|
read-only="readOnly"
|
||||||
class="WorkflowMaker-chart">
|
class="WorkflowMaker-chart">
|
||||||
|
|||||||
Reference in New Issue
Block a user