diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/edit/groups-edit.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/edit/groups-edit.controller.js index b185bf9c99..a187043159 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/edit/groups-edit.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/edit/groups-edit.controller.js @@ -35,6 +35,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString', 'rbac scope: $scope, field_id: 'group_group_variables', variable: 'group_variables', + readOnly: !$scope.summary_fields.user_capabilities.edit }); } diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js index 6096e1c84c..40dc4fc970 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js @@ -89,6 +89,7 @@ export default ['$state', '$scope', 'ParseVariableString', 'ParseTypeChange', field_id: varName, variable: varName, parse_variable: 'envParseType', + readOnly: !$scope.summary_fields.user_capabilities.edit }); } }); diff --git a/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/edit/smart-inventory-edit.controller.js b/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/edit/smart-inventory-edit.controller.js index 7af348d0d1..5ccf89c102 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/edit/smart-inventory-edit.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/edit/smart-inventory-edit.controller.js @@ -42,7 +42,8 @@ function SmartInventoryEdit($scope, $location, scope: $scope, variable: 'smartinventory_variables', parse_variable: 'parseType', - field_id: 'smartinventory_smartinventory_variables' + field_id: 'smartinventory_smartinventory_variables', + readOnly: !$scope.inventory_obj.summary_fields.user_capabilities.edit }); OrgAdminLookup.checkForAdminAccess({organization: inventoryData.organization}) diff --git a/awx/ui/client/src/notifications/edit/edit.controller.js b/awx/ui/client/src/notifications/edit/edit.controller.js index ff1c3de490..a90d025953 100644 --- a/awx/ui/client/src/notifications/edit/edit.controller.js +++ b/awx/ui/client/src/notifications/edit/edit.controller.js @@ -147,11 +147,13 @@ export default ['Rest', 'Wait', if (!$scope.headers) { $scope.headers = "{\n}"; } + ParseTypeChange({ scope: $scope, parse_variable: 'parse_type', variable: 'headers', field_id: 'notification_template_headers', + readOnly: !$scope.notification_template.summary_fields.user_capabilities.edit }); Wait('stop'); }) @@ -221,6 +223,7 @@ export default ['Rest', 'Wait', parse_variable: 'parse_type', variable: 'headers', field_id: 'notification_template_headers', + readOnly: !$scope.notification_template.summary_fields.user_capabilities.edit }); }; diff --git a/awx/ui/client/src/templates/job_templates/edit-job-template/job-template-edit.controller.js b/awx/ui/client/src/templates/job_templates/edit-job-template/job-template-edit.controller.js index ddbb9eefc0..8280801ab8 100644 --- a/awx/ui/client/src/templates/job_templates/edit-job-template/job-template-edit.controller.js +++ b/awx/ui/client/src/templates/job_templates/edit-job-template/job-template-edit.controller.js @@ -291,7 +291,8 @@ export default scope: $scope, field_id: 'extra_vars', variable: 'extra_vars', - onChange: callback + onChange: callback, + readOnly: !$scope.job_template_obj.summary_fields.user_capabilities.edit }); jobTemplateLoadFinished(); launchHasBeenEnabled = true; diff --git a/awx/ui/client/src/templates/prompt/prompt.controller.js b/awx/ui/client/src/templates/prompt/prompt.controller.js index 0e94031b57..60da76a641 100644 --- a/awx/ui/client/src/templates/prompt/prompt.controller.js +++ b/awx/ui/client/src/templates/prompt/prompt.controller.js @@ -229,7 +229,7 @@ export default [ 'ProcessErrors', 'CredentialTypeModel', 'TemplatesStrings', '$f }; vm.keypress = (event) => { - if (vm.steps.survey.tab._active && !vm.readOnlyPrompts && !vm.forms.survey.$valid) { + if (vm.steps.survey.tab && vm.steps.survey.tab._active && !vm.readOnlyPrompts && !vm.forms.survey.$valid) { return; } if (document.activeElement.type === 'textarea') { diff --git a/awx/ui/client/src/templates/workflows/edit-workflow/workflow-edit.controller.js b/awx/ui/client/src/templates/workflows/edit-workflow/workflow-edit.controller.js index efc3a49720..53039f6402 100644 --- a/awx/ui/client/src/templates/workflows/edit-workflow/workflow-edit.controller.js +++ b/awx/ui/client/src/templates/workflows/edit-workflow/workflow-edit.controller.js @@ -309,7 +309,11 @@ export default [ // Parse extra_vars, converting to YAML. $scope.variables = ParseVariableString(workflowJobTemplateData.extra_vars); - ParseTypeChange({ scope: $scope, field_id: 'workflow_job_template_variables' }); + ParseTypeChange({ + scope: $scope, + field_id: 'workflow_job_template_variables', + readOnly: !workflowJobTemplateData.summary_fields.user_capabilities.edit + }); } if (form.fields[fld].type === 'lookup' && workflowJobTemplateData.summary_fields[form.fields[fld].sourceModel]) { $scope[form.fields[fld].sourceModel + '_' + form.fields[fld].sourceField] =