diff --git a/client/client/routes.json b/client/client/routes.json index ecfdc4ea78..488c6c1048 100644 --- a/client/client/routes.json +++ b/client/client/routes.json @@ -2,6 +2,7 @@ "module": "client", "name": "Clients", "icon": "person", + "validations" : true, "routes": [ { "url": "/clients", diff --git a/client/core/src/icon-menu/icon-menu.html b/client/core/src/icon-menu/icon-menu.html index 422f8e0a74..f09652178b 100644 --- a/client/core/src/icon-menu/icon-menu.html +++ b/client/core/src/icon-menu/icon-menu.html @@ -1,6 +1,6 @@
-
+
-
+
{ this.$timeout(() => { this.showDropDown = true; diff --git a/client/core/src/lib/moduleLoader.js b/client/core/src/lib/moduleLoader.js index 2adfa20ad3..8b9952cb3c 100644 --- a/client/core/src/lib/moduleLoader.js +++ b/client/core/src/lib/moduleLoader.js @@ -7,7 +7,7 @@ export function factory($translatePartialLoader, $http, $window, $ocLazyLoad, $q constructor() { this._loadedModules = {}; } - load(moduleName) { + load(moduleName, validations) { if (this._loadedModules[moduleName]) return; @@ -20,12 +20,13 @@ export function factory($translatePartialLoader, $http, $window, $ocLazyLoad, $q for (let dep of deps) { this._loadedModules[dep] = true; promises.push(modules[dep]()); - promises.push(new Promise(resolve => { - $http.get(`/${dep}/validations`).then( - json => this.onValidationsReady(json, resolve), - json => resolve() - ); - })); + if (validations) + promises.push(new Promise(resolve => { + $http.get(`/${dep}/validations`).then( + json => this.onValidationsReady(json, resolve), + json => resolve() + ); + })); $translatePartialLoader.addPart(dep); // FIXME: https://github.com/angular-translate/angular-translate/pull/1674 diff --git a/client/production/routes.json b/client/production/routes.json index 38ab36dc01..a99b910a37 100644 --- a/client/production/routes.json +++ b/client/production/routes.json @@ -2,6 +2,7 @@ "module": "production", "name": "Production", "icon": "group_work", + "validations" : false, "routes": [ { "url": "/production", diff --git a/client/production/src/production-actions/production-actions.html b/client/production/src/production-actions/production-actions.html index ce7301524f..4786d9136b 100644 --- a/client/production/src/production-actions/production-actions.html +++ b/client/production/src/production-actions/production-actions.html @@ -7,8 +7,7 @@ - + diff --git a/client/salix/src/configroutes.js b/client/salix/src/configroutes.js index c6a5a34023..5b696afacd 100644 --- a/client/salix/src/configroutes.js +++ b/client/salix/src/configroutes.js @@ -3,10 +3,10 @@ import deps from 'spliting/modules.json'; import ngModule from './module'; import {splitingRegister} from 'core'; -function loader(moduleName) { +function loader(moduleName, validations) { load.$inject = ['vnModuleLoader']; function load(moduleLoader) { - return moduleLoader.load(moduleName); + return moduleLoader.load(moduleName, validations); } return load; } @@ -40,19 +40,22 @@ function config($stateProvider, $urlRouterProvider, aclServiceProvider) { for (let file in routes) { let fileRoutes = routes[file].routes; let moduleName = routes[file].module; + let validations = routes[file].validations; fileRoutes.forEach(function(route) { if (aclService.routeHasPermission(route)) { - $stateProvider.state(route.state, { + let routeOptions = { url: route.url, abstract: route.abstract || false, template: `<${route.component} ${getParams(route)}>`, resolve: { - loader: loader(moduleName) + loader: loader(moduleName, validations) }, data: { routes: fileRoutes } - }); + }; + + $stateProvider.state(route.state, routeOptions); } }); }