diff --git a/client/core/src/lib/moduleLoader.js b/client/core/src/lib/moduleLoader.js index 62fe2c3fd..2adfa20ad 100644 --- a/client/core/src/lib/moduleLoader.js +++ b/client/core/src/lib/moduleLoader.js @@ -8,7 +8,7 @@ export function factory($translatePartialLoader, $http, $window, $ocLazyLoad, $q this._loadedModules = {}; } load(moduleName) { - if(this._loadedModules[moduleName]) + if (this._loadedModules[moduleName]) return; this._loadedModules[moduleName] = true; @@ -17,18 +17,19 @@ export function factory($translatePartialLoader, $http, $window, $ocLazyLoad, $q let modules = splitingRegister.modules; let promises = []; - for(let dep of deps) { + 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 => this.onValidationsReady(json, resolve), + json => resolve() ); })); $translatePartialLoader.addPart(dep); // FIXME: https://github.com/angular-translate/angular-translate/pull/1674 - //promises.push($translate.refresh()); + // promises.push($translate.refresh()); setTimeout (() => $translate.refresh(), 500); } @@ -41,7 +42,7 @@ export function factory($translatePartialLoader, $http, $window, $ocLazyLoad, $q }); } parseValidation(val) { - switch(val.validation) { + switch (val.validation) { case 'custom': // TODO: Reemplazar eval val.customValidator = eval(`(${val.customValidator})`); @@ -53,11 +54,11 @@ export function factory($translatePartialLoader, $http, $window, $ocLazyLoad, $q } onValidationsReady(json, resolve) { let entities = json.data; - for(let entity in entities) { + for (let entity in entities) { let fields = entities[entity].validations; - for(let field in fields) { + for (let field in fields) { let validations = fields[field]; - for(let validation of validations) + for (let validation of validations) this.parseValidation(validation); } } diff --git a/client/production/index.js b/client/production/index.js new file mode 100644 index 000000000..4cbd2fb45 --- /dev/null +++ b/client/production/index.js @@ -0,0 +1 @@ +export * from './src/production'; diff --git a/client/production/routes.json b/client/production/routes.json new file mode 100644 index 000000000..38ab36dc0 --- /dev/null +++ b/client/production/routes.json @@ -0,0 +1,12 @@ +{ + "module": "production", + "name": "Production", + "icon": "group_work", + "routes": [ + { + "url": "/production", + "state": "production", + "component": "vn-production-index" + } + ] +} \ No newline at end of file diff --git a/client/production/src/index/index.html b/client/production/src/index/index.html new file mode 100644 index 000000000..7141b2a3f --- /dev/null +++ b/client/production/src/index/index.html @@ -0,0 +1,29 @@ + + + + + Localizador + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/production/src/index/index.js b/client/production/src/index/index.js new file mode 100644 index 000000000..3c0e9cfaf --- /dev/null +++ b/client/production/src/index/index.js @@ -0,0 +1,13 @@ +import ngModule from '../module'; + +export default class ProductionIndex { + search(index) { + index.filter.search = this.model.search; + index.accept(); + } +} + +ngModule.component('vnProductionIndex', { + template: require('./index.html'), + controller: ProductionIndex +}); diff --git a/client/production/src/locale/en.json b/client/production/src/locale/en.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/client/production/src/locale/en.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/client/production/src/locale/es.json b/client/production/src/locale/es.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/client/production/src/locale/es.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/client/production/src/module.js b/client/production/src/module.js new file mode 100644 index 000000000..1427bd898 --- /dev/null +++ b/client/production/src/module.js @@ -0,0 +1,5 @@ +import {ng} from 'vendor'; +import 'core'; + +const ngModule = ng.module('production', []); +export default ngModule; diff --git a/client/production/src/production.js b/client/production/src/production.js new file mode 100644 index 000000000..80e65aace --- /dev/null +++ b/client/production/src/production.js @@ -0,0 +1,5 @@ +export * from './module'; + + +// import components +import './index/index'; diff --git a/client/salix/src/components/home/home.html b/client/salix/src/components/home/home.html index b92bedb4d..ddb636ee4 100644 --- a/client/salix/src/components/home/home.html +++ b/client/salix/src/components/home/home.html @@ -2,7 +2,7 @@
- + diff --git a/client/salix/src/components/home/style.scss b/client/salix/src/components/home/style.scss index 76c6cd402..732f8752a 100644 --- a/client/salix/src/components/home/style.scss +++ b/client/salix/src/components/home/style.scss @@ -10,32 +10,45 @@ vn-home { a:link{ text-decoration: none; } - .vn-module{ + vn-module-container{ display: flex; - flex: none; - padding: 2em; - border-radius: 4px; - box-sizing: border-box; - transition: opacity 0.7s ease; - h4{ - text-transform: capitalize; - } - vn-one{ - text-align: center; - } + flex: 1; + flex-direction: row; + justify-content: center; - i{ - font-size: 50px !important; - margin: 0 auto; + .vn-module{ + display: flex; + flex: none; + padding: 2em; + margin: 10px; + border-radius: 4px; + box-sizing: border-box; + transition: opacity 0.7s ease; + h4{ + text-transform: capitalize; + font-size: 16pt; + } + vn-one{ + text-align: center; + } + + i{ + font-size: 50px !important; + margin: 0 auto; + } + &:hover{ + opacity: 0.7; + } + + &.Clients{ + background-color: #ffa410; + color: #ffffff; + } + &.Production{ + background-color: #95d600; + color: #ffffff; + } + } - &:hover{ - opacity: 0.7; - } - - &.Clients{ - background-color: #ffa410; - color: #ffffff; - } - } } \ No newline at end of file diff --git a/client/salix/src/components/left-menu/left-menu.js b/client/salix/src/components/left-menu/left-menu.js index 235c299d4..586752a1b 100644 --- a/client/salix/src/components/left-menu/left-menu.js +++ b/client/salix/src/components/left-menu/left-menu.js @@ -9,9 +9,9 @@ export default class LeftMenu { this.init(); } init() { - let station = this.$state.current.data.station || 'default'; - if (routes[station]) { - routes[station].routes.forEach(i => { + let routes = this.$state.current.data.routes || []; + if (routes.length) { + routes.forEach(i => { if (i.menu && this.aclService.routeHasPermission(i)) this.items.push({ description: i.menu.description, diff --git a/client/salix/src/configroutes.js b/client/salix/src/configroutes.js index 40aa1b998..c6a5a3402 100644 --- a/client/salix/src/configroutes.js +++ b/client/salix/src/configroutes.js @@ -50,7 +50,7 @@ function config($stateProvider, $urlRouterProvider, aclServiceProvider) { loader: loader(moduleName) }, data: { - station: file + routes: fileRoutes } }); } diff --git a/gulpfile.js b/gulpfile.js index 523378fc8..8b5a5fa6f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -114,7 +114,7 @@ gulp.task('webpack-dev-server', ['spliting'], function() { // Locale -var localeFiles = `./${srcDir}/**/locale/*.json`; +var localeFiles = `${srcDir}/**/locale/*.json`; gulp.task('locales', function() { var streams = []; @@ -132,22 +132,12 @@ gulp.task('locales', function() { // Routes -var routeFiles = `./${srcDir}/**/routes.json`; +var routeFiles = `${srcDir}/**/routes.json`; gulp.task('routes', function() { - function cb(file) { - var relative = file.relative.replace(/\\/g, '/'); - var dirname = relative.match(/^(.*)\/routes\.json$/)[1]; - return { - dirname: dirname, - json: file.contents - }; - } - return gulp.src(routeFiles) - .pipe(wrap('\n"<%=dirname%>": <%=json%>', cb)) .pipe(concat('routes.js', {newLine: ','})) - .pipe(wrap('var routes = {<%=contents%>\n};')) + .pipe(wrap('var routes = [<%=contents%>\n];')) .pipe(gulp.dest(buildDir)); }); diff --git a/spliting/modules.json b/spliting/modules.json index be5adbca5..3efb5f977 100644 --- a/spliting/modules.json +++ b/spliting/modules.json @@ -1,6 +1,7 @@ { - "salix": ["client"], + "salix": ["client", "production"], "auth": [], "core": [], - "client": [] + "client": [], + "production": [] }