From 67ba534097cfbac117272fbdb1c70e6afeaf684a Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Mon, 9 Apr 2018 11:07:34 -0400 Subject: [PATCH] ensure correct system and auth forms are loaded --- .../configuration-auth.controller.js | 2 +- .../configuration/configuration.controller.js | 10 ++++- .../configuration/configuration.partial.html | 43 ++++++++++++++++--- .../configuration-system.controller.js | 2 +- 4 files changed, 47 insertions(+), 10 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 5b80e40ddb..66d2f8818d 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 @@ -82,7 +82,7 @@ export default [ }; var activeForm = function() { - if(!$scope.$parent[formTracker.currentFormName()].$dirty) { + if(!_.get($scope.$parent, [formTracker.currentFormName(), '$dirty'])) { authVm.activeAuthForm = getActiveAuthForm(); formTracker.setCurrentAuth(authVm.activeAuthForm); startCodeMirrors(); diff --git a/awx/ui/client/src/configuration/configuration.controller.js b/awx/ui/client/src/configuration/configuration.controller.js index 9752522e9d..db0696ddaf 100644 --- a/awx/ui/client/src/configuration/configuration.controller.js +++ b/awx/ui/client/src/configuration/configuration.controller.js @@ -169,7 +169,7 @@ export default [ setCurrentSystem: function(form) { this.currentSystem = form; this.setCurrent(this.currentSystem); - } + }, }; // Default to auth form and tab @@ -275,7 +275,13 @@ export default [ vm.activeTab = setForm; if (setForm !== 'license') { - formTracker.setCurrent(setForm); + if (setForm === 'auth') { + formTracker.setCurrentAuth(formTracker.currentAuth); + } else if (setForm === 'system') { + formTracker.setCurrentSystem(formTracker.currenSystem); + } else { + formTracker.setCurrent(setForm); + } $state.go('configuration', { currentTab: setForm diff --git a/awx/ui/client/src/configuration/configuration.partial.html b/awx/ui/client/src/configuration/configuration.partial.html index c7f65fd05e..47f9abfe10 100644 --- a/awx/ui/client/src/configuration/configuration.partial.html +++ b/awx/ui/client/src/configuration/configuration.partial.html @@ -7,16 +7,47 @@
-
CONFIGURE {{BRAND_NAME}}
+
CONFIGURE {{ BRAND_NAME }}
-
Authentication
-
Jobs
-
System
-
User Interface
-
License
+
+ Authentication +
+
+ Jobs +
+
+ System +
+
+ User Interface +
+
+ License +
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 11a631aca3..68a01f6a2c 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 @@ -47,7 +47,7 @@ export default [ } var activeForm = function() { - if(!$scope.$parent[formTracker.currentFormName()].$dirty) { + if(!_.get($scope.$parent, [formTracker.currentFormName(), '$dirty'])) { systemVm.activeSystemForm = systemVm.dropdownValue; formTracker.setCurrentSystem(systemVm.activeSystemForm); } else {