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:
softwarefactory-project-zuul[bot] 2019-06-14 13:58:51 +00:00 committed by GitHub
commit 1d767a15d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 4 deletions

View File

@ -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
});
}

View File

@ -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
});
}
});

View File

@ -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})

View File

@ -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
});
};

View File

@ -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;

View File

@ -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') {

View File

@ -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] =