Use configuration.state for state registration only.
import angular from 'angular';
-import {default as ActivitiesData} from 'app/core/activities/Activities.data';
-
-// Common directives.
-import previewPanel from './configuration/preview-panel.directive.js';
-
-// Summary screen.
-import ConfigurationResource from './configuration/Configuration.resource';
-import IgniteSummaryZipper from './configuration/summary/summary-zipper.service';
-
import base2 from 'views/base2.pug';
-import pageConfigureAdvancedClusterComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-cluster/component';
-import pageConfigureAdvancedModelsComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-models/component';
-import pageConfigureAdvancedCachesComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-caches/component';
-import pageConfigureAdvancedIGFSComponent from 'app/components/page-configure-advanced/components/page-configure-advanced-igfs/component';
+import pageConfigureAdvancedClusterComponent from '../page-configure-advanced/components/page-configure-advanced-cluster/component';
+import pageConfigureAdvancedModelsComponent from '../page-configure-advanced/components/page-configure-advanced-models/component';
+import pageConfigureAdvancedCachesComponent from '../page-configure-advanced/components/page-configure-advanced-caches/component';
+import pageConfigureAdvancedIGFSComponent from '../page-configure-advanced/components/page-configure-advanced-igfs/component';
import get from 'lodash/get';
import {Observable} from 'rxjs/Observable';
@@ -47,26 +38,7 @@ const shortCachesResolve = ['ConfigSelectors', 'ConfigureState', 'ConfigEffects'
.toPromise();
}];
-/**
- * @param {ActivitiesData} ActivitiesData
- * @param {uirouter.UIRouter} $uiRouter
- */
-function initConfiguration(ActivitiesData, $uiRouter) {
- $uiRouter.transitionService.onSuccess({to: 'base.configuration.**'}, (transition) => {
- ActivitiesData.post({group: 'configuration', action: transition.targetState().name()});
- });
-}
-
-initConfiguration.$inject = ['IgniteActivitiesData', '$uiRouter'];
-
-angular.module('ignite-console.states.configuration', ['ui.router'])
- .directive(...previewPanel)
- // Services.
- .service('IgniteSummaryZipper', IgniteSummaryZipper)
- .service('IgniteConfigurationResource', ConfigurationResource)
- .run(initConfiguration)
- // Configure state provider.
- .config(['$stateProvider', ($stateProvider) => {
+function registerStates($stateProvider) {
// Setup the states.
$stateProvider
.state('base.configuration', {
@@ -294,4 +266,8 @@ angular.module('ignite-console.states.configuration', ['ui.router'])
async: 'NOWAIT'
}
});
- }]);
+}
+
+registerStates.$inject = ['$stateProvider'];
+
+export {registerStates};
