From d97ac8cec68f2e4110d842fea02e5ec4ddaf9500 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Mon, 6 Mar 2017 12:29:33 -0500 Subject: [PATCH] reorder user and notification template form fields --- awx/ui/client/src/forms/Users.js | 22 +++++------ .../notificationTemplates.form.js | 37 +++++++++---------- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/awx/ui/client/src/forms/Users.js b/awx/ui/client/src/forms/Users.js index 118857f895..5db4a06c67 100644 --- a/awx/ui/client/src/forms/Users.js +++ b/awx/ui/client/src/forms/Users.js @@ -38,6 +38,17 @@ export default required: true, capitalize: true }, + organization: { + label: i18n._('Organization'), + type: 'lookup', + list: 'OrganizationList', + basePath: 'organizations', + sourceModel: 'organization', + sourceField: 'name', + required: true, + excludeMode: 'edit', + ngDisabled: '!(user_obj.summary_fields.user_capabilities.edit || canAdd)' + }, email: { label: i18n._('Email'), type: 'email', @@ -55,17 +66,6 @@ export default autocomplete: false, ngDisabled: '!(user_obj.summary_fields.user_capabilities.edit || canAdd)' }, - organization: { - label: i18n._('Organization'), - type: 'lookup', - list: 'OrganizationList', - basePath: 'organizations', - sourceModel: 'organization', - sourceField: 'name', - required: true, - excludeMode: 'edit', - ngDisabled: '!(user_obj.summary_fields.user_capabilities.edit || canAdd)' - }, password: { label: i18n._('Password'), type: 'sensitive', diff --git a/awx/ui/client/src/notifications/notificationTemplates.form.js b/awx/ui/client/src/notifications/notificationTemplates.form.js index bb0d746fc7..fb0ae1186a 100644 --- a/awx/ui/client/src/notifications/notificationTemplates.form.js +++ b/awx/ui/client/src/notifications/notificationTemplates.form.js @@ -70,20 +70,20 @@ export default ['i18n', function(i18n) { subForm: 'typeSubForm', ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)' }, - - host: { - label: i18n._('Host'), - type: 'text', + password: { + labelBind: 'passwordLabel', + type: 'sensitive', + hasShowInputButton: true, awRequiredWhen: { - reqExpression: "email_required", + reqExpression: "password_required" , init: "false" }, - ngShow: "notification_type.value == 'email' ", + ngShow: "notification_type.value == 'email' || notification_type.value == 'irc' ", subForm: 'typeSubForm', ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)' }, - sender: { - label: i18n._('Sender Email'), + host: { + label: i18n._('Host'), type: 'text', awRequiredWhen: { reqExpression: "email_required", @@ -110,15 +110,14 @@ export default ['i18n', function(i18n) { subForm: 'typeSubForm', ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)' }, - password: { - labelBind: 'passwordLabel', - type: 'sensitive', - hasShowInputButton: true, + sender: { + label: i18n._('Sender Email'), + type: 'text', awRequiredWhen: { - reqExpression: "password_required" , + reqExpression: "email_required", init: "false" }, - ngShow: "notification_type.value == 'email' || notification_type.value == 'irc' ", + ngShow: "notification_type.value == 'email' ", subForm: 'typeSubForm', ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)' }, @@ -269,9 +268,10 @@ export default ['i18n', function(i18n) { subForm: 'typeSubForm', ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)' }, - message_from: { - label: i18n._('Label to be shown with notification'), + api_url: { + label: 'API URL', type: 'text', + placeholder: 'https://mycompany.hipchat.com', awRequiredWhen: { reqExpression: "hipchat_required", init: "false" @@ -280,10 +280,9 @@ export default ['i18n', function(i18n) { subForm: 'typeSubForm', ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)' }, - api_url: { - label: 'API URL', + message_from: { + label: i18n._('Notification Label'), type: 'text', - placeholder: 'https://mycompany.hipchat.com', awRequiredWhen: { reqExpression: "hipchat_required", init: "false"