mirror of
https://github.com/ansible/awx.git
synced 2026-05-18 06:47:41 -02:30
small symantic changes to $stateExtender and it's directory
This commit is contained in:
@@ -31,7 +31,7 @@ import systemTracking from './system-tracking/main';
|
|||||||
import inventoryScripts from './inventory-scripts/main';
|
import inventoryScripts from './inventory-scripts/main';
|
||||||
import permissions from './permissions/main';
|
import permissions from './permissions/main';
|
||||||
import managementJobs from './management-jobs/main';
|
import managementJobs from './management-jobs/main';
|
||||||
import routeExtensions from './shared/route-extensions/main';
|
// import routeExtensions from './shared/route-extensions/main';
|
||||||
import breadcrumbs from './shared/breadcrumbs/main';
|
import breadcrumbs from './shared/breadcrumbs/main';
|
||||||
|
|
||||||
|
|
||||||
@@ -70,7 +70,6 @@ import './job-templates/main';
|
|||||||
import './shared/features/main';
|
import './shared/features/main';
|
||||||
import './login/authenticationServices/pendo/ng-pendo';
|
import './login/authenticationServices/pendo/ng-pendo';
|
||||||
import footer from './footer/main';
|
import footer from './footer/main';
|
||||||
import uiRouterHelper from './shared/uiRouterHelper/main';
|
|
||||||
|
|
||||||
/*#if DEBUG#*/
|
/*#if DEBUG#*/
|
||||||
import {__deferLoadIfEnabled} from './debug';
|
import {__deferLoadIfEnabled} from './debug';
|
||||||
@@ -189,7 +188,6 @@ var tower = angular.module('Tower', [
|
|||||||
'pendolytics',
|
'pendolytics',
|
||||||
'ui.router',
|
'ui.router',
|
||||||
'ncy-angular-breadcrumb',
|
'ncy-angular-breadcrumb',
|
||||||
uiRouterHelper.name
|
|
||||||
])
|
])
|
||||||
|
|
||||||
.constant('AngularScheduler.partials', urlPrefix + 'lib/angular-scheduler/lib/')
|
.constant('AngularScheduler.partials', urlPrefix + 'lib/angular-scheduler/lib/')
|
||||||
@@ -207,7 +205,7 @@ var tower = angular.module('Tower', [
|
|||||||
});
|
});
|
||||||
|
|
||||||
// $urlRouterProvider.otherwise("/home");
|
// $urlRouterProvider.otherwise("/home");
|
||||||
$urlRouterProvider.otherwise(function($injector, $location){
|
$urlRouterProvider.otherwise(function($injector){
|
||||||
var $state = $injector.get("$state");
|
var $state = $injector.get("$state");
|
||||||
$state.go('dashboard');
|
$state.go('dashboard');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,9 +7,5 @@ export default
|
|||||||
icon.name
|
icon.name
|
||||||
])
|
])
|
||||||
.run(['$stateExtender', function($stateExtender) {
|
.run(['$stateExtender', function($stateExtender) {
|
||||||
// var// $stateProvider = $injector.get("$state"),
|
|
||||||
// state = route.name;
|
|
||||||
// delete route.name;
|
|
||||||
|
|
||||||
$stateExtender.addState(route);
|
$stateExtender.addState(route);
|
||||||
}]);
|
}]);
|
||||||
|
|||||||
@@ -9,12 +9,15 @@ import title from './title.directive';
|
|||||||
import lodashAsPromised from './lodash-as-promised';
|
import lodashAsPromised from './lodash-as-promised';
|
||||||
import stringFilters from './string-filters/main';
|
import stringFilters from './string-filters/main';
|
||||||
import truncatedText from './truncated-text.directive';
|
import truncatedText from './truncated-text.directive';
|
||||||
|
import stateExtender from './stateExtender.provider';
|
||||||
|
|
||||||
export default
|
export default
|
||||||
angular.module('shared',
|
angular.module('shared',
|
||||||
[ listGenerator.name,
|
[ listGenerator.name,
|
||||||
stringFilters.name
|
stringFilters.name,
|
||||||
|
'ui.router'
|
||||||
])
|
])
|
||||||
.factory('lodashAsPromised', lodashAsPromised)
|
.factory('lodashAsPromised', lodashAsPromised)
|
||||||
.directive('truncatedText', truncatedText)
|
.directive('truncatedText', truncatedText)
|
||||||
.directive('title', title);
|
.directive('title', title)
|
||||||
|
.provider('$stateExtender', stateExtender);
|
||||||
|
|||||||
15
awx/ui/client/src/shared/stateExtender.provider.js
Normal file
15
awx/ui/client/src/shared/stateExtender.provider.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
export default function($stateProvider){
|
||||||
|
this.$get = function(){
|
||||||
|
return {
|
||||||
|
addState: function(state) {
|
||||||
|
$stateProvider.state(state.name , {
|
||||||
|
url: state.route,
|
||||||
|
controller: state.controller,
|
||||||
|
templateUrl: state.templateUrl,
|
||||||
|
resolve: state.resolve
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
|
|
||||||
export default angular.module('uiRouterHelper',[
|
|
||||||
|
|
||||||
])
|
|
||||||
|
|
||||||
.provider('$stateExtender', function($stateProvider){
|
|
||||||
this.$get = function($state){
|
|
||||||
return {
|
|
||||||
addState: function(state) {
|
|
||||||
$stateProvider.state(state.name , {
|
|
||||||
url: state.route,
|
|
||||||
controller: state.controller,
|
|
||||||
templateUrl: state.templateUrl,
|
|
||||||
resolve: state.resolve
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user