From 93661fe8e38084c30896a19f08a71b843d8155c7 Mon Sep 17 00:00:00 2001 From: Daniel Herrero Date: Thu, 2 Nov 2017 11:13:20 +0100 Subject: [PATCH] new module locator --- client/locator/index.js | 1 + client/locator/routes.json | 13 +++++++++++++ client/locator/src/index/index.html | 8 ++++++++ client/locator/src/index/index.js | 14 ++++++++++++++ client/locator/src/locale/en.json | 1 + client/locator/src/locale/es.json | 3 +++ client/locator/src/locator.js | 3 +++ client/locator/src/module.js | 5 +++++ client/modules.json | 3 ++- client/route/routes.json | 3 ++- client/salix/src/locale/es.json | 3 ++- client/salix/src/spliting.js | 11 +++++++++++ 12 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 client/locator/index.js create mode 100644 client/locator/routes.json create mode 100644 client/locator/src/index/index.html create mode 100644 client/locator/src/index/index.js create mode 100644 client/locator/src/locale/en.json create mode 100644 client/locator/src/locale/es.json create mode 100644 client/locator/src/locator.js create mode 100644 client/locator/src/module.js diff --git a/client/locator/index.js b/client/locator/index.js new file mode 100644 index 000000000..d2b755cd8 --- /dev/null +++ b/client/locator/index.js @@ -0,0 +1 @@ +export * from './src/locator'; diff --git a/client/locator/routes.json b/client/locator/routes.json new file mode 100644 index 000000000..6907d7ee7 --- /dev/null +++ b/client/locator/routes.json @@ -0,0 +1,13 @@ +{ + "module": "locator", + "name": "Locator", + "icon": "add_location", + "validations" : false, + "routes": [ + { + "url": "/locator", + "state": "locator", + "component": "vn-locator-index" + } + ] +} \ No newline at end of file diff --git a/client/locator/src/index/index.html b/client/locator/src/index/index.html new file mode 100644 index 000000000..522689f23 --- /dev/null +++ b/client/locator/src/index/index.html @@ -0,0 +1,8 @@ + + + + Routes locator + + + + \ No newline at end of file diff --git a/client/locator/src/index/index.js b/client/locator/src/index/index.js new file mode 100644 index 000000000..b13a33b80 --- /dev/null +++ b/client/locator/src/index/index.js @@ -0,0 +1,14 @@ +import ngModule from '../module'; +//import './style.scss'; + +class LocatorIndex { + constructor($state) { + this.$state = $state; + } +} +LocatorIndex.$inject = ['$state']; + +ngModule.component('vnLocatorIndex', { + template: require('./index.html'), + controller: LocatorIndex +}); diff --git a/client/locator/src/locale/en.json b/client/locator/src/locale/en.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/client/locator/src/locale/en.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/client/locator/src/locale/es.json b/client/locator/src/locale/es.json new file mode 100644 index 000000000..4746789ec --- /dev/null +++ b/client/locator/src/locale/es.json @@ -0,0 +1,3 @@ +{ + "Routes locator": "Localizador de rutas" +} \ No newline at end of file diff --git a/client/locator/src/locator.js b/client/locator/src/locator.js new file mode 100644 index 000000000..ad5e0bb9d --- /dev/null +++ b/client/locator/src/locator.js @@ -0,0 +1,3 @@ +export * from './module'; + +import './index/index'; diff --git a/client/locator/src/module.js b/client/locator/src/module.js new file mode 100644 index 000000000..2d50fd2ef --- /dev/null +++ b/client/locator/src/module.js @@ -0,0 +1,5 @@ +import {ng} from 'vendor'; +import 'core'; + +const ngModule = ng.module('locator', []); +export default ngModule; diff --git a/client/modules.json b/client/modules.json index 6dbad069d..62c5e11a1 100644 --- a/client/modules.json +++ b/client/modules.json @@ -4,5 +4,6 @@ "core": [], "client": [], "production": [], - "route": [] + "route": [], + "locator": [] } diff --git a/client/route/routes.json b/client/route/routes.json index 654761f1a..1ccf632c1 100644 --- a/client/route/routes.json +++ b/client/route/routes.json @@ -13,7 +13,8 @@ { "url": "/list", "state": "routes.index", - "component": "vn-route-index" + "component": "vn-route-index", + "acl": ["employee"] }, { "url": "/create", diff --git a/client/salix/src/locale/es.json b/client/salix/src/locale/es.json index fc0932817..a5f88410b 100644 --- a/client/salix/src/locale/es.json +++ b/client/salix/src/locale/es.json @@ -11,5 +11,6 @@ "Clients": "Clientes", "Routes" : "Rutas", "Production" : "Producción", - "Modules access" : "Acceso a módulos" + "Modules access" : "Acceso a módulos", + "Locator": "Localizador" } \ No newline at end of file diff --git a/client/salix/src/spliting.js b/client/salix/src/spliting.js index 4918d5acc..697bcef98 100644 --- a/client/salix/src/spliting.js +++ b/client/salix/src/spliting.js @@ -32,3 +32,14 @@ export const route = () => { }; core.splitingRegister.register('route', route); + +export const locator = () => { + return new Promise(resolve => { + require.ensure([], () => { + require('locator'); + resolve('locator'); + }, 'locator'); + }); +}; + +core.splitingRegister.register('locator', locator);