From 53925f5e9898cbac0ba669e89b06f29449de36f3 Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 29 Aug 2019 16:59:54 -0400 Subject: [PATCH] Tweaks to the ux for saved creds --- awx/ui/client/src/license/license.controller.js | 17 ++++++++++++++--- awx/ui/client/src/license/license.partial.html | 17 ++++++++--------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/awx/ui/client/src/license/license.controller.js b/awx/ui/client/src/license/license.controller.js index 799e1c6b32..eaa0cbf3d1 100644 --- a/awx/ui/client/src/license/license.controller.js +++ b/awx/ui/client/src/license/license.controller.js @@ -7,9 +7,9 @@ import {N_} from "../i18n"; export default - ['Wait', '$state', '$scope', '$rootScope', 'ProcessErrors', 'CheckLicense', 'moment', 'Rest', + ['Wait', '$state', '$scope', '$rootScope', 'ProcessErrors', 'CheckLicense', 'moment', 'Rest', '$timeout', '$window', 'ConfigService', 'pendoService', 'insightsEnablementService', 'i18n', 'config', 'GetBasePath', - function(Wait, $state, $scope, $rootScope, ProcessErrors, CheckLicense, moment, Rest, + function(Wait, $state, $scope, $rootScope, ProcessErrors, CheckLicense, moment, Rest, $timeout, $window, ConfigService, pendoService, insightsEnablementService, i18n, config, GetBasePath) { const calcDaysRemaining = function(seconds) { @@ -73,7 +73,7 @@ export default if (data.REDHAT_PASSWORD && data.REDHAT_PASSWORD !== "") { $scope.rhCreds.password = data.REDHAT_PASSWORD; - $scope.hasPasswordFromSettings = true; + $scope.showPlaceholderPassword = true; } }).catch(() => { initVars(config); @@ -117,6 +117,17 @@ export default $window.open('https://www.ansible.com/license', '_blank'); }; + $scope.replacePassword = () => { + if ($scope.user_is_superuser && !$scope.newLicense.file) { + $scope.showPlaceholderPassword = false; + $scope.rhCreds.password = ""; + $timeout(() => { + $('.tooltip').remove(); + $('#rh-password').focus(); + }); + } + }; + $scope.submit = function() { Wait('start'); $scope.licenseError = false; diff --git a/awx/ui/client/src/license/license.partial.html b/awx/ui/client/src/license/license.partial.html index f7cabdee32..cdcdacb6a2 100644 --- a/awx/ui/client/src/license/license.partial.html +++ b/awx/ui/client/src/license/license.partial.html @@ -128,17 +128,16 @@
-
- - +
+ + + -
-
- - - - +
+