mirror of
https://github.com/ansible/awx.git
synced 2026-03-21 02:47:35 -02: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:
@@ -35,6 +35,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString', 'rbac
|
|||||||
scope: $scope,
|
scope: $scope,
|
||||||
field_id: 'group_group_variables',
|
field_id: 'group_group_variables',
|
||||||
variable: '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,
|
field_id: varName,
|
||||||
variable: varName,
|
variable: varName,
|
||||||
parse_variable: 'envParseType',
|
parse_variable: 'envParseType',
|
||||||
|
readOnly: !$scope.summary_fields.user_capabilities.edit
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ function SmartInventoryEdit($scope, $location,
|
|||||||
scope: $scope,
|
scope: $scope,
|
||||||
variable: 'smartinventory_variables',
|
variable: 'smartinventory_variables',
|
||||||
parse_variable: 'parseType',
|
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})
|
OrgAdminLookup.checkForAdminAccess({organization: inventoryData.organization})
|
||||||
|
|||||||
@@ -147,11 +147,13 @@ export default ['Rest', 'Wait',
|
|||||||
if (!$scope.headers) {
|
if (!$scope.headers) {
|
||||||
$scope.headers = "{\n}";
|
$scope.headers = "{\n}";
|
||||||
}
|
}
|
||||||
|
|
||||||
ParseTypeChange({
|
ParseTypeChange({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
parse_variable: 'parse_type',
|
parse_variable: 'parse_type',
|
||||||
variable: 'headers',
|
variable: 'headers',
|
||||||
field_id: 'notification_template_headers',
|
field_id: 'notification_template_headers',
|
||||||
|
readOnly: !$scope.notification_template.summary_fields.user_capabilities.edit
|
||||||
});
|
});
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
})
|
})
|
||||||
@@ -221,6 +223,7 @@ export default ['Rest', 'Wait',
|
|||||||
parse_variable: 'parse_type',
|
parse_variable: 'parse_type',
|
||||||
variable: 'headers',
|
variable: 'headers',
|
||||||
field_id: 'notification_template_headers',
|
field_id: 'notification_template_headers',
|
||||||
|
readOnly: !$scope.notification_template.summary_fields.user_capabilities.edit
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -291,7 +291,8 @@ export default
|
|||||||
scope: $scope,
|
scope: $scope,
|
||||||
field_id: 'extra_vars',
|
field_id: 'extra_vars',
|
||||||
variable: 'extra_vars',
|
variable: 'extra_vars',
|
||||||
onChange: callback
|
onChange: callback,
|
||||||
|
readOnly: !$scope.job_template_obj.summary_fields.user_capabilities.edit
|
||||||
});
|
});
|
||||||
jobTemplateLoadFinished();
|
jobTemplateLoadFinished();
|
||||||
launchHasBeenEnabled = true;
|
launchHasBeenEnabled = true;
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ export default [ 'ProcessErrors', 'CredentialTypeModel', 'TemplatesStrings', '$f
|
|||||||
};
|
};
|
||||||
|
|
||||||
vm.keypress = (event) => {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
if (document.activeElement.type === 'textarea') {
|
if (document.activeElement.type === 'textarea') {
|
||||||
|
|||||||
@@ -309,7 +309,11 @@ export default [
|
|||||||
// Parse extra_vars, converting to YAML.
|
// Parse extra_vars, converting to YAML.
|
||||||
$scope.variables = ParseVariableString(workflowJobTemplateData.extra_vars);
|
$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]) {
|
if (form.fields[fld].type === 'lookup' && workflowJobTemplateData.summary_fields[form.fields[fld].sourceModel]) {
|
||||||
$scope[form.fields[fld].sourceModel + '_' + form.fields[fld].sourceField] =
|
$scope[form.fields[fld].sourceModel + '_' + form.fields[fld].sourceField] =
|
||||||
|
|||||||
Reference in New Issue
Block a user