From 8aea053d4c4336f3a7c418b91815166cd3fc6d3d Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Wed, 8 Feb 2017 15:14:16 -0500 Subject: [PATCH 1/3] Added disabled tooltips in CTinT --- .../configuration/configuration.block.less | 44 +++++++++++++++++++ awx/ui/client/src/shared/form-generator.js | 4 ++ 2 files changed, 48 insertions(+) diff --git a/awx/ui/client/src/configuration/configuration.block.less b/awx/ui/client/src/configuration/configuration.block.less index b5a7d203cf..2ce7d4e4b9 100644 --- a/awx/ui/client/src/configuration/configuration.block.less +++ b/awx/ui/client/src/configuration/configuration.block.less @@ -147,6 +147,8 @@ textarea[disabled="disabled"] + div[id*="-container"]{ //Needed to show the not-allowed cursor over a Codemirror instance .Form-formGroup--disabled { cursor: not-allowed; + position: relative; + display: inline-block; // Filepicker and toggle disabling .Form-filePicker--pickerButton, .Form-filePicker--textBox, @@ -155,4 +157,46 @@ textarea[disabled="disabled"] + div[id*="-container"]{ cursor: not-allowed; } + // Adding explanatory tooltips for disabled fields + // Borrows styling from .popover + .Form-tooltip--disabled { + visibility: hidden; + background-color: @default-interface-txt; + color: @default-bg; + text-align: center; + border-radius: 6px; + + position: absolute; + z-index: 1; + width: 200px; + bottom: 110%; + left: 50%; + margin-left: -100px; + + background-clip: padding-box; + border: 1px solid rgba(0,0,0,.2); + -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2); + box-shadow: 0 5px 10px rgba(0,0,0,.2); + white-space: normal; + + padding: 9px 14px; + font-size: 12px; + font-weight: bold; + } + + &:hover .Form-tooltip--disabled { + visibility: visible; + } + + .Form-tooltip--disabled::after { + content: " "; + position: absolute; + top: 100%; + left: 50%; + margin-left: -11px; + border-width: 11px; + border-style: solid; + border-color: @default-interface-txt transparent transparent transparent; + } + } diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 6d2809181e..17592d4f0f 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -740,6 +740,10 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += (field.awFeature) ? "aw-feature=\"" + field.awFeature + "\" " : ""; html += ">\n"; + var definedInFileMessage = i18n._('This setting has been set manually in a settings file and is now disabled.'); + html += (field.definedInFile) ? + `${definedInFileMessage}` : ``; + // toggle switches if(field.type === 'toggleSwitch') { html += label(); From cd27687ef15df1f821240f719ac5343da4dad22e Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Fri, 10 Feb 2017 14:41:36 -0500 Subject: [PATCH 2/3] Re-enabling bootstrap's darkening of disabled fields --- awx/ui/client/legacy-styles/forms.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index 570a096c7e..5da836f921 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -245,13 +245,13 @@ .Form-textArea{ border-radius: 5px; color: @field-input-text; - background-color: @field-secondary-bg!important; + background-color: @field-secondary-bg; width:100%!important; } .Form-textInput{ height: 30px; - background-color: @field-secondary-bg!important; + background-color: @field-secondary-bg; border-radius: 5px; border:1px solid @field-border; color: @field-input-text; From 263aa866a36e55630ad692e006e9e23f0148ae99 Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Mon, 13 Feb 2017 08:15:13 -0500 Subject: [PATCH 3/3] Removed help tooltip for disabled in file fields --- .../configuration/auth-form/configuration-auth.controller.js | 3 ++- .../configuration/jobs-form/configuration-jobs.controller.js | 3 ++- .../system-form/configuration-system.controller.js | 3 ++- .../src/configuration/ui-form/configuration-ui.controller.js | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/src/configuration/auth-form/configuration-auth.controller.js b/awx/ui/client/src/configuration/auth-form/configuration-auth.controller.js index 07c5cc8a0b..a674eb76aa 100644 --- a/awx/ui/client/src/configuration/auth-form/configuration-auth.controller.js +++ b/awx/ui/client/src/configuration/auth-form/configuration-auth.controller.js @@ -163,7 +163,8 @@ export default [ function addFieldInfo(form, key) { _.extend(form.fields[key], { - awPopOver: $scope.$parent.configDataResolve[key].help_text, + awPopOver: ($scope.$parent.configDataResolve[key].defined_in_file) ? + null: $scope.$parent.configDataResolve[key].help_text, label: $scope.$parent.configDataResolve[key].label, name: key, toggleSource: key, diff --git a/awx/ui/client/src/configuration/jobs-form/configuration-jobs.controller.js b/awx/ui/client/src/configuration/jobs-form/configuration-jobs.controller.js index af0572481b..281edcbff8 100644 --- a/awx/ui/client/src/configuration/jobs-form/configuration-jobs.controller.js +++ b/awx/ui/client/src/configuration/jobs-form/configuration-jobs.controller.js @@ -49,7 +49,8 @@ export default [ function addFieldInfo(form, key) { _.extend(form.fields[key], { - awPopOver: $scope.$parent.configDataResolve[key].help_text, + awPopOver: ($scope.$parent.configDataResolve[key].defined_in_file) ? + null: $scope.$parent.configDataResolve[key].help_text, label: $scope.$parent.configDataResolve[key].label, name: key, toggleSource: key, diff --git a/awx/ui/client/src/configuration/system-form/configuration-system.controller.js b/awx/ui/client/src/configuration/system-form/configuration-system.controller.js index 865145115b..3a3a1b789d 100644 --- a/awx/ui/client/src/configuration/system-form/configuration-system.controller.js +++ b/awx/ui/client/src/configuration/system-form/configuration-system.controller.js @@ -122,7 +122,8 @@ export default [ function addFieldInfo(form, key) { _.extend(form.fields[key], { - awPopOver: $scope.$parent.configDataResolve[key].help_text, + awPopOver: ($scope.$parent.configDataResolve[key].defined_in_file) ? + null: $scope.$parent.configDataResolve[key].help_text, label: $scope.$parent.configDataResolve[key].label, name: key, toggleSource: key, diff --git a/awx/ui/client/src/configuration/ui-form/configuration-ui.controller.js b/awx/ui/client/src/configuration/ui-form/configuration-ui.controller.js index 43ad4df2dc..77fa9da011 100644 --- a/awx/ui/client/src/configuration/ui-form/configuration-ui.controller.js +++ b/awx/ui/client/src/configuration/ui-form/configuration-ui.controller.js @@ -52,7 +52,8 @@ function addFieldInfo(form, key) { _.extend(form.fields[key], { - awPopOver: $scope.$parent.configDataResolve[key].help_text, + awPopOver: ($scope.$parent.configDataResolve[key].defined_in_file) ? + null: $scope.$parent.configDataResolve[key].help_text, label: $scope.$parent.configDataResolve[key].label, name: key, toggleSource: key,