1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 09:51:09 +03:00

ensure correct system and auth forms are loaded

This commit is contained in:
Jake McDermott 2018-04-09 11:07:34 -04:00
parent 27e8e55d15
commit 67ba534097
No known key found for this signature in database
GPG Key ID: 3B02CAD476EECB35
4 changed files with 47 additions and 10 deletions

View File

@ -82,7 +82,7 @@ export default [
}; };
var activeForm = function() { var activeForm = function() {
if(!$scope.$parent[formTracker.currentFormName()].$dirty) { if(!_.get($scope.$parent, [formTracker.currentFormName(), '$dirty'])) {
authVm.activeAuthForm = getActiveAuthForm(); authVm.activeAuthForm = getActiveAuthForm();
formTracker.setCurrentAuth(authVm.activeAuthForm); formTracker.setCurrentAuth(authVm.activeAuthForm);
startCodeMirrors(); startCodeMirrors();

View File

@ -169,7 +169,7 @@ export default [
setCurrentSystem: function(form) { setCurrentSystem: function(form) {
this.currentSystem = form; this.currentSystem = form;
this.setCurrent(this.currentSystem); this.setCurrent(this.currentSystem);
} },
}; };
// Default to auth form and tab // Default to auth form and tab
@ -275,7 +275,13 @@ export default [
vm.activeTab = setForm; vm.activeTab = setForm;
if (setForm !== 'license') { 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', { $state.go('configuration', {
currentTab: setForm currentTab: setForm

View File

@ -7,16 +7,47 @@
<div class="tab-pane" id="configuration-panel"> <div class="tab-pane" id="configuration-panel">
<div ng-cloak id="htmlTemplate" class="Panel"> <div ng-cloak id="htmlTemplate" class="Panel">
<div class="Form-header"> <div class="Form-header">
<div class="Form-title Form-title--uppercase" translate>CONFIGURE {{BRAND_NAME}}</div> <div class="Form-title Form-title--uppercase" translate>CONFIGURE {{ BRAND_NAME }}</div>
</div> </div>
<div class="row Form-tabRow"> <div class="row Form-tabRow">
<div class="col-lg-12"> <div class="col-lg-12">
<div class="Form-tabHolder"ng-class="{'Form-tabHolder--licenseSelected': vm.activeTab === 'license'}"> <div class="Form-tabHolder"ng-class="{'Form-tabHolder--licenseSelected': vm.activeTab === 'license'}">
<div class="Form-tab" ng-click="vm.activeTabCheck('auth')" ng-class="{'is-selected': vm.activeTab === 'auth' }" translate>Authentication</div> <div id="auth_tab"
<div class="Form-tab" ng-click="vm.activeTabCheck('jobs')" ng-class="{'is-selected': vm.activeTab === 'jobs' }" translate>Jobs</div> class="Form-tab"
<div class="Form-tab" ng-click="vm.activeTabCheck('system')" ng-class="{'is-selected': vm.activeTab === 'system' }" translate>System</div> ng-click="vm.activeTabCheck('auth')"
<div class="Form-tab" ng-click="vm.activeTabCheck('ui')" ng-class="{'is-selected': vm.activeTab === 'ui' }" translate>User Interface</div> ng-class="{'is-selected': vm.activeTab === 'auth' }"
<div class="Form-tab" ng-show="vm.product === 'Tower'" ng-click="vm.activeTabCheck('license')" ng-class="{'is-selected': vm.activeTab === 'license' }" translate>License</div> translate>
Authentication
</div>
<div id="jobs_tab"
class="Form-tab"
ng-click="vm.activeTabCheck('jobs')"
ng-class="{'is-selected': vm.activeTab === 'jobs' }"
translate>
Jobs
</div>
<div id="system_tab"
class="Form-tab"
ng-click="vm.activeTabCheck('system')"
ng-class="{'is-selected': vm.activeTab === 'system' }"
translate>
System
</div>
<div id="ui_tab"
class="Form-tab"
ng-click="vm.activeTabCheck('ui')"
ng-class="{'is-selected': vm.activeTab === 'ui' }"
translate>
User Interface
</div>
<div id="license_tab"
class="Form-tab"
ng-show="vm.product === 'Tower'"
ng-click="vm.activeTabCheck('license')"
ng-class="{'is-selected': vm.activeTab === 'license' }"
translate>
License
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -47,7 +47,7 @@ export default [
} }
var activeForm = function() { var activeForm = function() {
if(!$scope.$parent[formTracker.currentFormName()].$dirty) { if(!_.get($scope.$parent, [formTracker.currentFormName(), '$dirty'])) {
systemVm.activeSystemForm = systemVm.dropdownValue; systemVm.activeSystemForm = systemVm.dropdownValue;
formTracker.setCurrentSystem(systemVm.activeSystemForm); formTracker.setCurrentSystem(systemVm.activeSystemForm);
} else { } else {