From b6f645a72b8ae3d82d0788c4505d281f98778861 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Tue, 31 Jan 2017 15:35:58 -0500 Subject: [PATCH 1/2] fix spinner and radio read only fields --- awx/ui/client/src/forms/Groups.js | 1 + awx/ui/client/src/forms/JobTemplates.js | 2 +- awx/ui/client/src/notifications/notificationTemplates.form.js | 1 + awx/ui/client/src/shared/form-generator.js | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/forms/Groups.js b/awx/ui/client/src/forms/Groups.js index af6936f663..b01da6c9bf 100644 --- a/awx/ui/client/src/forms/Groups.js +++ b/awx/ui/client/src/forms/Groups.js @@ -305,6 +305,7 @@ export default label: "Cache Timeout (seconds)", id: 'source-cache-timeout', type: 'number', + ngDisabled: '!(group_obj.summary_fields.user_capabilities.edit || canAdd)', integer: true, min: 0, ngShow: "source && source.value !== '' && update_on_launch", diff --git a/awx/ui/client/src/forms/JobTemplates.js b/awx/ui/client/src/forms/JobTemplates.js index ce0af8ff83..760da47838 100644 --- a/awx/ui/client/src/forms/JobTemplates.js +++ b/awx/ui/client/src/forms/JobTemplates.js @@ -214,7 +214,7 @@ export default dataTitle: i18n._('Forks'), dataPlacement: 'right', dataContainer: "body", - ngDisabled: '!(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)' // TODO: get working + ngDisabled: '!(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)' }, limit: { label: i18n._('Limit'), diff --git a/awx/ui/client/src/notifications/notificationTemplates.form.js b/awx/ui/client/src/notifications/notificationTemplates.form.js index 66e9a9854e..bb0d746fc7 100644 --- a/awx/ui/client/src/notifications/notificationTemplates.form.js +++ b/awx/ui/client/src/notifications/notificationTemplates.form.js @@ -397,6 +397,7 @@ export default ['i18n', function(i18n) { subForm: 'typeSubForm', ngShow: "notification_type.value == 'email'", ngChange: "emailOptionsChange()", + ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)', options: [{ value: 'use_tls', label: i18n._('Use TLS'), diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 518931171a..d4a65dbbfa 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -1279,6 +1279,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += "value=\"" + field.options[i].value + "\" "; html += "ng-model=\"" + fld + "\" "; html += (field.ngChange) ? this.attr(field, 'ngChange') : ""; + html += (field.ngDisabled) ? `ng-disabled="${field.ngDisabled}"` : ""; html += (field.readonly) ? "disabled " : ""; html += (field.required) ? "required " : ""; html += (field.ngshow) ? "ng-show=\"" + field.ngShow + "\" " : ""; From 8f448665d8e36a942a60ccd5201633172f47bf06 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Tue, 31 Jan 2017 16:08:46 -0500 Subject: [PATCH 2/2] fix viewonly template row button --- awx/ui/client/src/lists/Templates.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/lists/Templates.js b/awx/ui/client/src/lists/Templates.js index a2dca9205d..d32d102dcc 100644 --- a/awx/ui/client/src/lists/Templates.js +++ b/awx/ui/client/src/lists/Templates.js @@ -114,7 +114,7 @@ export default }, view: { label: i18n._('View'), - ngClick: "editJobTemplate(template.id)", + ngClick: "editJobTemplate(template)", awToolTip: i18n._('View template'), "class": 'btn-default btn-xs', dataPlacement: 'top',