From 5f58f500cc2ae58d8f4b8c891e9f0bd6e3dfdd5f Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Thu, 27 Jul 2017 14:49:09 -0400 Subject: [PATCH] fix color of schedule forms and bugs found in color audit --- awx/ui/client/legacy-styles/ansible-ui.less | 2 +- awx/ui/client/legacy-styles/forms.less | 2 +- .../related/sources/sources.form.js | 40 ++++++++++++++----- .../smart-inventory/smart-inventory.form.js | 2 +- .../standard-inventory/inventory.form.js | 2 +- .../src/organizations/organizations.form.js | 2 +- .../instance-groups.directive.js | 5 ++- .../instance-groups.partial.html | 6 ++- .../date-picker/date-picker.block.less | 9 +++-- .../system-tracking-container.block.less | 1 + .../job_templates/job-template.form.js | 5 ++- .../multi-credential.block.less | 8 ++-- .../multi-credential.directive.js | 3 +- .../multi-credential.partial.html | 11 +++-- .../templates/labels/labelsList.block.less | 1 + .../shared/question-definition.form.js | 2 +- 16 files changed, 65 insertions(+), 36 deletions(-) diff --git a/awx/ui/client/legacy-styles/ansible-ui.less b/awx/ui/client/legacy-styles/ansible-ui.less index bfabb4c7ed..04c245684d 100644 --- a/awx/ui/client/legacy-styles/ansible-ui.less +++ b/awx/ui/client/legacy-styles/ansible-ui.less @@ -2145,7 +2145,7 @@ tr td button i { } .select2-container--default .select2-selection--single { - background-color: @field-secondary-bg; + background-color: @f2grey; border: 1px solid @d7grey; border-radius: 4px; } diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index fdde7e18a4..67932c9d95 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -678,7 +678,7 @@ input[type='radio']:checked:before { height: inherit; min-height: 30px; max-height: 120px; - overflow-y: scroll; + overflow-y: hidden; } .Form-variableHeightButtonGroup { diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js index b25d3a2860..302dd8135e 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js @@ -43,6 +43,9 @@ return { activeEditState: 'inventories.edit.inventory_sources.edit', detailsClick: "$state.go('inventories.edit.inventory_sources.edit')", well: false, + subFormTitles: { + sourceSubForm: i18n._('Source Details'), + }, fields: { name: { label: i18n._('Name'), @@ -64,7 +67,8 @@ return { ngOptions: 'source.label for source in source_type_options track by source.value', ngChange: 'sourceChange(source)', ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', - ngModel: 'source' + ngModel: 'source', + hasSubForm: true }, credential: { label: i18n._('Credential'), @@ -79,6 +83,7 @@ return { reqExpression: "cloudCredentialRequired", init: "false" }, + subForm: 'sourceSubForm', ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', watchBasePath: "credentialBasePath" }, @@ -98,7 +103,8 @@ return { init: "false" }, ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', - watchBasePath: "projectBasePath" + watchBasePath: "projectBasePath", + subForm: 'sourceSubForm' }, inventory_file: { label: i18n._('Inventory File'), @@ -116,7 +122,8 @@ return { dataTitle: i18n._('Inventory File'), dataPlacement: 'right', dataContainer: "body", - includeInventoryFileNotFoundError: true + includeInventoryFileNotFoundError: true, + subForm: 'sourceSubForm' }, source_regions: { label: i18n._('Regions'), @@ -129,7 +136,8 @@ return { awPopOver: "

" + i18n._("Click on the regions field to see a list of regions for your cloud provider. You can select multiple regions, or choose") + "" + i18n._("All") + " " + i18n._("to include all regions. Only Hosts associated with the selected regions will be updated.") + "

", dataContainer: 'body', - ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)' + ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', + subForm: 'sourceSubForm' }, instance_filters: { label: i18n._('Instance Filters'), @@ -140,7 +148,8 @@ return { awPopOverWatch: 'instanceFilterPopOver', awPopOver: '{{ instanceFilterPopOver }}', dataContainer: 'body', - ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)' + ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', + subForm: 'sourceSubForm' }, group_by: { label: i18n._('Only Group By'), @@ -153,7 +162,8 @@ return { awPopOverWatch: 'groupByPopOver', awPopOver: '{{ groupByPopOver }}', dataContainer: 'body', - ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)' + ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', + subForm: 'sourceSubForm' }, inventory_script: { label : i18n._("Custom Inventory Script"), @@ -168,6 +178,7 @@ return { init: "false" }, ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', + subForm: 'sourceSubForm' }, custom_variables: { id: 'custom_variables', @@ -188,7 +199,8 @@ return { "
---
somevar: somevalue
password: magic
\n" + '

View JSON examples at www.json.org

' + '

View YAML examples at docs.ansible.com

', - dataContainer: 'body' + dataContainer: 'body', + subForm: 'sourceSubForm' }, ec2_variables: { id: 'ec2_variables', @@ -211,7 +223,8 @@ return { "
---
somevar: somevalue
password: magic
\n" + '

View JSON examples at www.json.org

' + '

View YAML examples at docs.ansible.com

', - dataContainer: 'body' + dataContainer: 'body', + subForm: 'sourceSubForm' }, vmware_variables: { id: 'vmware_variables', @@ -234,7 +247,8 @@ return { "
---
somevar: somevalue
password: magic
\n" + '

View JSON examples at www.json.org

' + '

View YAML examples at docs.ansible.com

', - dataContainer: 'body' + dataContainer: 'body', + subForm: 'sourceSubForm' }, openstack_variables: { id: 'openstack_variables', @@ -257,7 +271,8 @@ return { "
---
somevar: somevalue
password: magic
\n" + '

View JSON examples at www.json.org

' + '

View YAML examples at docs.ansible.com

', - dataContainer: 'body' + dataContainer: 'body', + subForm: 'sourceSubForm' }, verbosity: { label: i18n._('Verbosity'), @@ -271,12 +286,14 @@ return { dataPlacement: 'right', dataContainer: "body", ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', + subForm: 'sourceSubForm' }, checkbox_group: { label: i18n._('Update Options'), type: 'checkbox_group', ngShow: "source && (source.value !== '' && source.value !== null)", class: 'Form-checkbox--stacked', + subForm: 'sourceSubForm', fields: [{ name: 'overwrite', label: i18n._('Overwrite'), @@ -345,7 +362,8 @@ return { 'and a new inventory sync will be performed.

', dataTitle: i18n._('Cache Timeout'), dataPlacement: 'right', - dataContainer: "body" + dataContainer: "body", + subForm: 'sourceSubForm' } }, diff --git a/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/smart-inventory.form.js b/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/smart-inventory.form.js index 07cf7db25c..494cb00cd6 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/smart-inventory.form.js +++ b/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/smart-inventory.form.js @@ -78,7 +78,7 @@ export default ['i18n', 'InventoryCompletedJobsList', function(i18n, InventoryCo dataTitle: i18n._('Instance Groups'), dataPlacement: 'right', dataContainer: 'body', - control: '', + control: '', }, smartinventory_variables: { label: i18n._('Variables'), diff --git a/awx/ui/client/src/inventories-hosts/inventories/standard-inventory/inventory.form.js b/awx/ui/client/src/inventories-hosts/inventories/standard-inventory/inventory.form.js index 0be972390c..c5eaf5c73f 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/standard-inventory/inventory.form.js +++ b/awx/ui/client/src/inventories-hosts/inventories/standard-inventory/inventory.form.js @@ -86,7 +86,7 @@ function(i18n, InventoryCompletedJobsList) { dataTitle: i18n._('Instance Groups'), dataPlacement: 'right', dataContainer: 'body', - control: '', + control: '', }, inventory_variables: { realName: 'variables', diff --git a/awx/ui/client/src/organizations/organizations.form.js b/awx/ui/client/src/organizations/organizations.form.js index 42bda9b716..2a79118d70 100644 --- a/awx/ui/client/src/organizations/organizations.form.js +++ b/awx/ui/client/src/organizations/organizations.form.js @@ -41,7 +41,7 @@ export default ['NotificationsList', 'i18n', dataTitle: i18n._('Instance Groups'), dataContainer: 'body', dataPlacement: 'right', - control: '', + control: '', } }, diff --git a/awx/ui/client/src/shared/instance-groups-multiselect/instance-groups.directive.js b/awx/ui/client/src/shared/instance-groups-multiselect/instance-groups.directive.js index 2a0277c45e..cdb781b1d9 100644 --- a/awx/ui/client/src/shared/instance-groups-multiselect/instance-groups.directive.js +++ b/awx/ui/client/src/shared/instance-groups-multiselect/instance-groups.directive.js @@ -3,7 +3,8 @@ export default ['templateUrl', '$compile', function(templateUrl, $compile) { return { scope: { - instanceGroups: '=' + instanceGroups: '=', + fieldIsDisabled: '=' }, restrict: 'E', templateUrl: templateUrl('shared/instance-groups-multiselect/instance-groups'), @@ -15,4 +16,4 @@ export default ['templateUrl', '$compile', } }; } -]; \ No newline at end of file +]; diff --git a/awx/ui/client/src/shared/instance-groups-multiselect/instance-groups.partial.html b/awx/ui/client/src/shared/instance-groups-multiselect/instance-groups.partial.html index 46eaf47b8c..bb237b77c1 100644 --- a/awx/ui/client/src/shared/instance-groups-multiselect/instance-groups.partial.html +++ b/awx/ui/client/src/shared/instance-groups-multiselect/instance-groups.partial.html @@ -1,10 +1,12 @@
- - +
diff --git a/awx/ui/client/src/system-tracking/date-picker/date-picker.block.less b/awx/ui/client/src/system-tracking/date-picker/date-picker.block.less index 5d880c3bc6..670ba31c8f 100644 --- a/awx/ui/client/src/system-tracking/date-picker/date-picker.block.less +++ b/awx/ui/client/src/system-tracking/date-picker/date-picker.block.less @@ -7,25 +7,26 @@ padding: 6px 12px; font-size: 14px; border-radius: 4px 0 0 4px; - border: 1px solid #ccc; + border: 1px solid @b7grey; border-right: 0; background-color: @default-bg; } &-icon:hover { - background-color: @default-border; + background-color: @f6grey; } &-icon:focus, &-icon:active { - background-color: #ccc; + background-color: @f6grey; } &-input { flex: 1 0 auto; border-radius: 0 4px 4px 0; - border: 1px solid #ccc; + border: 1px solid @b7grey; padding: 6px 12px; + background-color: @f2grey; } &-input:focus, diff --git a/awx/ui/client/src/system-tracking/system-tracking-container.block.less b/awx/ui/client/src/system-tracking/system-tracking-container.block.less index 6688d2f255..62d5c1ee05 100644 --- a/awx/ui/client/src/system-tracking/system-tracking-container.block.less +++ b/awx/ui/client/src/system-tracking/system-tracking-container.block.less @@ -18,6 +18,7 @@ .DatePicker-input { width: 100%; flex: none; + background: @f2grey; } .DatePicker-icon { diff --git a/awx/ui/client/src/templates/job_templates/job-template.form.js b/awx/ui/client/src/templates/job_templates/job-template.form.js index 1892f474e3..daa43e44b4 100644 --- a/awx/ui/client/src/templates/job_templates/job-template.form.js +++ b/awx/ui/client/src/templates/job_templates/job-template.form.js @@ -135,7 +135,8 @@ function(NotificationsList, CompletedJobsList, i18n) { prompt="ask_credential_on_launch" selected-credentials="selectedCredentials" credential-not-present="credentialNotPresent" - credentials-to-post="credentialsToPost"> + credentials-to-post="credentialsToPost" + field-is-disabled="!(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)"> `, required: true, awPopOver: "

" + i18n._("Select credentials that allow {{BRAND_NAME}} to access the nodes this job will be ran against. You can only select one credential of each type.

You must select either a machine (SSH) credential or \"Prompt on launch\". \"Prompt on launch\" requires you to select a machine credential at run time.

If you select credentials AND check the \"Prompt on launch\" box, you make the selected credentials the defaults that can be updated at run time.") + "

", @@ -208,7 +209,7 @@ function(NotificationsList, CompletedJobsList, i18n) { dataTitle: i18n._('Instance Groups'), dataContainer: 'body', dataPlacement: 'right', - control: '', + control: '', }, job_tags: { label: i18n._('Job Tags'), diff --git a/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.block.less b/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.block.less index 694e298a0e..8553d4ce30 100644 --- a/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.block.less +++ b/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.block.less @@ -41,13 +41,14 @@ padding: 2px 10px; margin: 4px 0px; font-size: 12px; - color: @default-interface-txt; - background-color: @default-bg; margin-right: 10px; max-width: 100%; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; + background-color: @default-link; + color: @default-bg; + padding-left: 15px; } .MultiCredential-tag--deletable { @@ -56,9 +57,8 @@ border-bottom-left-radius: 0px; border-right: 0; max-width: ~"calc(100% - 23px)"; - background-color: @default-link; - color: @default-bg; margin-right: 10px; + padding-left: 10px; } .MultiCredential-deleteContainer { diff --git a/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.directive.js b/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.directive.js index a2cf5ea85d..1e0d477fa1 100644 --- a/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.directive.js +++ b/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.directive.js @@ -12,7 +12,8 @@ export default ['templateUrl', '$compile', selectedCredentials: '=', prompt: '=', credentialNotPresent: '=', - credentialsToPost: '=' + credentialsToPost: '=', + fieldIsDisabled: '=' }, restrict: 'E', templateUrl: templateUrl('templates/job_templates/multi-credential/multi-credential'), diff --git a/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.partial.html b/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.partial.html index b52f7da8fd..e08f7432eb 100644 --- a/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.partial.html +++ b/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.partial.html @@ -3,7 +3,8 @@ @@ -13,6 +14,7 @@ 'ng-invalid': credentialNotPresent, 'ng-dirty': fieldDirty }" + ng-disabled="fieldIsDisabled" style="padding: 4px 6px;">
@@ -20,12 +22,13 @@
+ ng-click="removeCredential(tag.id)" + ng-hide="fieldIsDisabled">
-
+
{{ tag.kind }} diff --git a/awx/ui/client/src/templates/labels/labelsList.block.less b/awx/ui/client/src/templates/labels/labelsList.block.less index 8cd9523c1c..d503a354fa 100644 --- a/awx/ui/client/src/templates/labels/labelsList.block.less +++ b/awx/ui/client/src/templates/labels/labelsList.block.less @@ -88,6 +88,7 @@ .LabelList-lookupTags { display: flex; padding: 0 12px; + overflow-y: hidden; } .LabelList-lookupTags--disabled { diff --git a/awx/ui/client/src/templates/survey-maker/shared/question-definition.form.js b/awx/ui/client/src/templates/survey-maker/shared/question-definition.form.js index f57a5fe019..70664e99e7 100644 --- a/awx/ui/client/src/templates/survey-maker/shared/question-definition.form.js +++ b/awx/ui/client/src/templates/survey-maker/shared/question-definition.form.js @@ -302,7 +302,7 @@ export default }, buttons: { question_cancel : { - label: 'Cancel', + label: 'Clear', 'class' : 'btn btn-default Form-cancelButton', ngClick: 'generateAddQuestionForm()', ngDisabled: 'survey_question_form.$pristine'