From c69534de145856e89bde30ef272f7b5bcd807010 Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Wed, 24 Feb 2016 10:11:09 -0500 Subject: [PATCH] Attached sub form work to source control form in projects.js, added title plus some styling Added some breathing room at the bottom of the sub form --- awx/ui/client/legacy-styles/forms.less | 22 +++++++++ awx/ui/client/src/forms/Credentials.js | 54 +++++++++++++++------- awx/ui/client/src/forms/Projects.js | 17 +++++-- awx/ui/client/src/shared/form-generator.js | 27 +++++++++++ 4 files changed, 99 insertions(+), 21 deletions(-) diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index 0556f7e1cd..f26f0c03d1 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -141,6 +141,28 @@ padding-right: 50px; } +.Form-subForm { + width: 100%; + border-left: 5px solid @default-border; + margin-left: -20px; + padding-left: 15px; + margin-bottom: 15px; + + .Form-formGroup { + float: left; + } +} + +.Form-subForm--title { + font-weight: bold; + text-transform: uppercase; + color: @default-interface-txt; + font-size: small; + width: 100%; + float: left; + margin-bottom: 10px; +} + .Form-textAreaLabel{ width:100%; } diff --git a/awx/ui/client/src/forms/Credentials.js b/awx/ui/client/src/forms/Credentials.js index 9921b3a27c..221ab12b22 100644 --- a/awx/ui/client/src/forms/Credentials.js +++ b/awx/ui/client/src/forms/Credentials.js @@ -18,6 +18,9 @@ export default editTitle: '{{ name }}', //Legend in edit mode name: 'credential', forceListeners: true, + subFormTitles: { + credentialSubForm: 'Type Details', + }, actions: { @@ -103,7 +106,8 @@ export default '\n', dataTitle: 'Type', dataPlacement: 'right', - dataContainer: "body" + dataContainer: "body", + hasSubForm: true, // helpCollapse: [{ // hdr: 'Select a Credential Type', // content: '
\n' + @@ -131,7 +135,8 @@ export default init: false }, autocomplete: false, - apiField: 'username' + apiField: 'username', + subForm: 'credentialSubForm', }, secret_key: { label: 'Secret Key', @@ -145,7 +150,8 @@ export default ask: false, clear: false, hasShowInputButton: true, - apiField: 'passwowrd' + apiField: 'passwowrd', + subForm: 'credentialSubForm' }, security_token: { label: 'STS Token', @@ -157,7 +163,8 @@ export default hasShowInputButton: true, dataTitle: 'STS Token', dataPlacement: 'right', - dataContainer: "body" + dataContainer: "body", + subForm: 'credentialSubForm' }, "host": { labelBind: 'hostLabel', @@ -172,7 +179,8 @@ export default awRequiredWhen: { variable: 'host_required', init: false - } + }, + subForm: 'credentialSubForm' }, "username": { labelBind: 'usernameLabel', @@ -183,7 +191,8 @@ export default variable: 'username_required', init: false }, - autocomplete: false + autocomplete: false, + subForm: "credentialSubForm" }, "email_address": { labelBind: 'usernameLabel', @@ -197,7 +206,8 @@ export default awPopOver: '

The email address assigned to the Google Compute Engine service account.

', dataTitle: 'Email', dataPlacement: 'right', - dataContainer: "body" + dataContainer: "body", + subForm: 'credentialSubForm' }, "subscription_id": { labelBind: "usernameLabel", @@ -213,8 +223,8 @@ export default awPopOver: '

Subscription ID is an Azure construct, which is mapped to a username.

', dataTitle: 'Subscription ID', dataPlacement: 'right', - dataContainer: "body" - + dataContainer: "body", + subForm: 'credentialSubForm' }, "api_key": { label: 'API Key', @@ -228,6 +238,7 @@ export default ask: false, hasShowInputButton: true, clear: false, + subForm: 'credentialSubForm' }, "password": { labelBind: 'passwordLabel', @@ -242,7 +253,8 @@ export default awRequiredWhen: { variable: "password_required", init: false - } + }, + subForm: "credentialSubForm" }, "ssh_password": { label: 'Password', // formally 'SSH Password' @@ -252,7 +264,8 @@ export default editRequired: false, ask: true, hasShowInputButton: true, - autocomplete: false + autocomplete: false, + subForm: 'credentialSubForm' }, "ssh_key_data": { labelBind: 'sshKeyDataLabel', @@ -273,7 +286,8 @@ export default awPopOverWatch: "key_description", dataTitle: 'Help', dataPlacement: 'right', - dataContainer: "body" + dataContainer: "body", + subForm: "credentialSubForm" }, "ssh_key_unlock": { label: 'Private Key Passphrase', @@ -285,6 +299,7 @@ export default ask: true, hasShowInputButton: true, askShow: "kind.value == 'ssh'", // Only allow ask for machine credentials + subForm: 'credentialSubForm' }, "become_method": { label: "Privilege Escalation", @@ -297,7 +312,8 @@ export default "This is equivalent to specifying the --become-method=BECOME_METHOD parameter, where BECOME_METHOD could be "+ "sudo | su | pbrun | pfexec | runas
(defaults to sudo)

", dataPlacement: 'right', - dataContainer: "body" + dataContainer: "body", + subForm: 'credentialSubForm' }, "become_username": { label: 'Privilege Escalation Username', @@ -305,7 +321,8 @@ export default ngShow: "kind.value == 'ssh' && (become_method && become_method.value)", addRequired: false, editRequired: false, - autocomplete: false + autocomplete: false, + subForm: 'credentialSubForm' }, "become_password": { label: 'Privilege Escalation Password', @@ -315,7 +332,8 @@ export default editRequired: false, ask: true, hasShowInputButton: true, - autocomplete: false + autocomplete: false, + subForm: 'credentialSubForm' }, "project": { labelBind: 'projectLabel', @@ -331,7 +349,8 @@ export default awRequiredWhen: { variable: 'project_required', init: false - } + }, + subForm: 'credentialSubForm' }, "vault_password": { label: "Vault Password", @@ -341,7 +360,8 @@ export default editRequired: false, ask: true, hasShowInputButton: true, - autocomplete: false + autocomplete: false, + subForm: 'credentialSubForm' } }, diff --git a/awx/ui/client/src/forms/Projects.js b/awx/ui/client/src/forms/Projects.js index 3019bc9a69..dbf04c457f 100644 --- a/awx/ui/client/src/forms/Projects.js +++ b/awx/ui/client/src/forms/Projects.js @@ -19,6 +19,10 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition']) name: 'project', forceListeners: true, tabs: true, + subFormTitles: { + sourceSubForm: 'Source Details', + }, + fields: { name: { @@ -62,7 +66,8 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition']) ngOptions: 'type.label for type in scm_type_options track by type.value', ngChange: 'scmChange()', addRequired: true, - editRequired: true + editRequired: true, + hasSubForm: true }, missing_path_alert: { type: 'alertblock', @@ -112,6 +117,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition']) variable: "scmRequired", init: false }, + subForm: 'sourceSubForm', helpCollapse: [{ hdr: 'GIT URLs', content: '

Example URLs for GIT SCM include: