mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
Merge pull request #4044 from mabashian/read-only-codemirrors
Read-only codemirror cleanup
Reviewed-by: Michael Abashian
https://github.com/mabashian
This commit is contained in:
commit
1d767a15d8
@ -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
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@ -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})
|
||||
|
||||
@ -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
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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') {
|
||||
|
||||
@ -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] =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user