diff --git a/@salix/app/src/app.js b/@salix/app/src/app.js index b7a2c92ec..a4f3636b4 100644 --- a/@salix/app/src/app.js +++ b/@salix/app/src/app.js @@ -3,6 +3,7 @@ import {bootstrap} from './bootstrap'; import * as spliting from './spliting'; import * as routes from './configroutes'; import * as run from './run'; +import * as configNgTranslate from './translate'; import * as components from './components'; import title from './styles/title.css' diff --git a/@salix/app/src/bootstrap.js b/@salix/app/src/bootstrap.js index b49a0112d..183515c91 100644 --- a/@salix/app/src/bootstrap.js +++ b/@salix/app/src/bootstrap.js @@ -14,5 +14,4 @@ export const bootstrap = () => { throw new Error("element is not defined"); } ng.bootstrap(_element, [SALIX]); - }; diff --git a/@salix/app/src/configroutes.js b/@salix/app/src/configroutes.js index 67f54c488..0d351c427 100644 --- a/@salix/app/src/configroutes.js +++ b/@salix/app/src/configroutes.js @@ -2,7 +2,6 @@ import * as core from 'core'; import * as spliting from './spliting'; import * as deps from './spliting/deps.json'; - function loader(module) { function load($ocLazyLoad, $q){ return $q((resolve) => { diff --git a/@salix/app/src/module.js b/@salix/app/src/module.js index 24d591cac..99dbd0b5c 100644 --- a/@salix/app/src/module.js +++ b/@salix/app/src/module.js @@ -3,4 +3,4 @@ import * as core from 'core'; import {NAME as CORE} from 'core'; export const NAME = 'salix'; -export const module = vendors.ng.module(NAME,[CORE]); +export const module = vendors.ng.module(NAME, [CORE]); diff --git a/@salix/app/src/run.js b/@salix/app/src/run.js index 01ff49e66..8a230d8e9 100644 --- a/@salix/app/src/run.js +++ b/@salix/app/src/run.js @@ -1,10 +1,9 @@ -import {ng} from 'vendor'; import {module} from './module'; -export const run = function($rootScope){ - $rootScope.$on('$viewContentLoaded',()=>{ - componentHandler.upgradeAllRegistered(); - }) +export const run = function($rootScope) { + $rootScope.$on('$viewContentLoaded',()=>{ + componentHandler.upgradeAllRegistered(); + }) } -run.$inject=['$rootScope']; -module.run(run); \ No newline at end of file +run.$inject = ['$rootScope']; +module.run(run); diff --git a/@salix/app/src/translate.js b/@salix/app/src/translate.js new file mode 100644 index 000000000..acb7354d3 --- /dev/null +++ b/@salix/app/src/translate.js @@ -0,0 +1,9 @@ +import {module} from './module'; + +export const configNgTranslate = function($translateProvider) { + $translateProvider + .translations('es', {/* Traducciones */}) + .preferredLanguage('es'); +} +configNgTranslate.$inject = ['$translateProvider']; +module.config(configNgTranslate); diff --git a/@salix/core/src/button/button.mdl.html b/@salix/core/src/button/button.mdl.html index 913521dcb..6b031460a 100644 --- a/@salix/core/src/button/button.mdl.html +++ b/@salix/core/src/button/button.mdl.html @@ -1,3 +1,3 @@ - \ No newline at end of file diff --git a/@salix/core/src/check/check.mdl.html b/@salix/core/src/check/check.mdl.html index f28da1331..f28c6eb01 100644 --- a/@salix/core/src/check/check.mdl.html +++ b/@salix/core/src/check/check.mdl.html @@ -1,4 +1,4 @@ diff --git a/@salix/core/src/combo/combo.mdl.html b/@salix/core/src/combo/combo.mdl.html index 9d6f31cf0..74f8c77ea 100644 --- a/@salix/core/src/combo/combo.mdl.html +++ b/@salix/core/src/combo/combo.mdl.html @@ -1,5 +1,5 @@
- +
diff --git a/@salix/core/src/date-picker/date-picker.mdl.html b/@salix/core/src/date-picker/date-picker.mdl.html index 5f0b7ed63..dba861b2e 100644 --- a/@salix/core/src/date-picker/date-picker.mdl.html +++ b/@salix/core/src/date-picker/date-picker.mdl.html @@ -1,4 +1,4 @@
- +
diff --git a/@salix/core/src/inputAttrsNormalizer.js b/@salix/core/src/inputAttrsNormalizer.js index 39da1bcf5..05592f9a4 100644 --- a/@salix/core/src/inputAttrsNormalizer.js +++ b/@salix/core/src/inputAttrsNormalizer.js @@ -6,8 +6,8 @@ export class InputAttrsNormalizer { $get(){ return { normalize: function(attrs) { -/* - if (!attrs.entity) + // FIXME: No siempre se pasan estos atributos, ej: searchbar +/* if (!attrs.entity) throw new Error(`Attribute 'entity' not defined on input`); if (!attrs.field) throw new Error(`Attribute 'field' not defined on input`); diff --git a/@salix/core/src/module.js b/@salix/core/src/module.js index 5931bf034..98383f185 100644 --- a/@salix/core/src/module.js +++ b/@salix/core/src/module.js @@ -4,5 +4,3 @@ import {getModuleName,getVendorDependencies} from './util'; const DEPENDENCIES = getVendorDependencies(vendors) export const NAME = getModuleName('core'); export const module = vendors.ng.module(NAME,DEPENDENCIES); - - diff --git a/@salix/core/src/password/password.mdl.html b/@salix/core/src/password/password.mdl.html index 471f99c77..23a3c981a 100644 --- a/@salix/core/src/password/password.mdl.html +++ b/@salix/core/src/password/password.mdl.html @@ -1,4 +1,4 @@
- +
diff --git a/@salix/core/src/radio/radio.mdl.html b/@salix/core/src/radio/radio.mdl.html index 5aacf8195..36d9baac8 100644 --- a/@salix/core/src/radio/radio.mdl.html +++ b/@salix/core/src/radio/radio.mdl.html @@ -1,2 +1,2 @@ -*[text]* +*[text]* diff --git a/@salix/core/src/routesLoader.js b/@salix/core/src/routesLoader.js index 4ea96e99d..eef26ff85 100644 --- a/@salix/core/src/routesLoader.js +++ b/@salix/core/src/routesLoader.js @@ -6,16 +6,16 @@ export const NAME = util.getProviderName ('RoutesLoader') function $get($http){ let script = document.currentScript || (() => { - let scripts = document.getElementsByTagName ('script'); - return scripts[scripts.length - 1]; - }) (); - - let routesCdn = script.getAttribute ('routes-cdn'); - return $http - ({ - method: 'GET', - url: routesCdn - }) + let scripts = document.getElementsByTagName ('script'); + return scripts[scripts.length - 1]; + }) (); + + let routesCdn = script.getAttribute ('routes-cdn'); + + return $http({ + method: 'GET', + url: routesCdn + }); } $get.$inject = ["$http"]; @@ -25,4 +25,3 @@ export class RoutesLoader{ constructor () {} } RoutesLoader.prototype.$get = $get; var routes = new RoutesLoader (); _module.provider (NAME, () => routes) - diff --git a/@salix/core/src/rule.js b/@salix/core/src/rule.js index 3d7eb6d41..b7d768f1d 100644 --- a/@salix/core/src/rule.js +++ b/@salix/core/src/rule.js @@ -4,7 +4,7 @@ export const NAME = 'vnRule'; export function directive() { return { restrict: 'A', - link: function (attrs, element){ + link: function (attrs, element) { } }; } diff --git a/@salix/core/src/spinner/spinner.js b/@salix/core/src/spinner/spinner.js index 03bbd9f5f..768ff5a3f 100644 --- a/@salix/core/src/spinner/spinner.js +++ b/@salix/core/src/spinner/spinner.js @@ -5,14 +5,14 @@ import * as util from '../util'; const _NAME = 'spinner'; export const NAME = util.getName(_NAME); -directive.$inject =[resolveFactory.NAME]; +directive.$inject = [resolveFactory.NAME]; export function directive (resolve){ return{ - require:'E', - template: function(_,attr){ - return resolve.getTemplate(_NAME, attr); + restrict: 'E', + template: function(_, attrs){ + return resolve.getTemplate(_NAME, attrs); } } } -_module.directive(NAME,directive); +_module.directive(NAME, directive); diff --git a/@salix/core/src/submit/submit.mdl.html b/@salix/core/src/submit/submit.mdl.html index 7a574413b..d6fc98b52 100644 --- a/@salix/core/src/submit/submit.mdl.html +++ b/@salix/core/src/submit/submit.mdl.html @@ -1,2 +1,2 @@ - + diff --git a/@salix/core/src/textfield/textfield.mdl.html b/@salix/core/src/textfield/textfield.mdl.html index 3af2dd79a..90012bc2b 100644 --- a/@salix/core/src/textfield/textfield.mdl.html +++ b/@salix/core/src/textfield/textfield.mdl.html @@ -1,4 +1,4 @@
- +
diff --git a/@salix/crud/src/client/card/card.js b/@salix/crud/src/client/card/card.js index 041b28559..37279a1ee 100644 --- a/@salix/crud/src/client/card/card.js +++ b/@salix/crud/src/client/card/card.js @@ -8,10 +8,7 @@ export const COMPONENT = { template: template, controllerAs: 'card', controller: function($http, $stateParams) { - let clientRoutes = routes['src/client/routes.js'].routes; - this.items = []; this.client = null; - $http.get(`/client/api/Clients/${$stateParams.id}`).then( (json) => { this.client = json.data; @@ -24,7 +21,8 @@ export const COMPONENT = { (json) => console.error (json.data.error.message) ); - clientRoutes.forEach ((i) => { + this.items = []; + routes['client'].routes.forEach ((i) => { if (i.description) this.items.push ({ description: i.description, diff --git a/@salix/crud/src/client/fiscal-data/index.html b/@salix/crud/src/client/fiscal-data/index.html index c7f9532e3..bd5f1fc6d 100644 --- a/@salix/crud/src/client/fiscal-data/index.html +++ b/@salix/crud/src/client/fiscal-data/index.html @@ -2,46 +2,46 @@
Datos fiscales y de facturación - + - + - + - + - + - - - + + +
Información de facturación
- + - + - +
Documentación
- - - + + + diff --git a/@salix/gulpfile.js b/@salix/gulpfile.js index 706630d36..29c2ed3f4 100644 --- a/@salix/gulpfile.js +++ b/@salix/gulpfile.js @@ -8,7 +8,7 @@ var babel = require('gulp-babel'); var fs = require('fs'); var del = require('del'); var webpack = require('webpack'); -var WebpackDevServer = require("webpack-dev-server"); +var WebpackDevServer = require('webpack-dev-server'); var webpackConfig = require('./webpack.config.js'); // Clean @@ -100,11 +100,18 @@ gulp.task('webpack-dev-server', ['spliting'], function() { var routeFiles = './crud/**/routes.js'; gulp.task('routes', function() { - var fileTpl = '\n"<%=file.relative%>": <%=contents%>'; + var fileTpl = '\n"<%=dirname%>": <%=contents%>'; var globalTpl = 'var routes = {<%=contents%>\n}'; + var regex = new RegExp('^src/(.*)/routes\.js$'); + + function cb(file) { + var relative = file.relative.replace('\\', '/'); + var dirname = relative.match(regex)[1]; + return {dirname: dirname}; + } return gulp.src(routeFiles) - .pipe(wrap(fileTpl)) + .pipe(wrap(fileTpl, cb)) .pipe(concat('salix.routes.js', {newLine: ','})) .pipe(wrap(globalTpl)) .pipe(babel({presets: ['es2015']})) diff --git a/@salix/login/src/login/login.html b/@salix/login/src/login/login.html index 6c27e7af0..f01f5fd87 100755 --- a/@salix/login/src/login/login.html +++ b/@salix/login/src/login/login.html @@ -13,5 +13,5 @@ - + diff --git a/@salix/login/src/login/login.js b/@salix/login/src/login/login.js index b243a7e50..c62a927db 100644 --- a/@salix/login/src/login/login.js +++ b/@salix/login/src/login/login.js @@ -5,16 +5,13 @@ import style from './login.scss' export const COMPONENT = { template: template, - controller: function ($http) - { + controller: function($http) { var self = this; - this.submit = function () - { + this.submit = function() { var model = this.model; - if (model && model.email && model.password) - { - setLoading (true); + if(model && model.email && model.password) { + setLoading(true); model.appId = window.location.href; $http.post('/account', this.model).then ( onLoginOk, @@ -22,25 +19,21 @@ export const COMPONENT = ); } else - showMessage ('Please insert your email and password'); + showMessage('Please insert your email and password'); }; - function onLoginOk (response) - { - setLoading (false); - //sessionStorage.setItem ('token', response.data.accessToken); + function onLoginOk (response) { + setLoading(false); window.location = response.data.location +'?access_token='+ response.data.accessToken; } - function onLoginErr (response) - { - setLoading (false); + function onLoginErr(response) { + setLoading(false); self.model.password = ''; var message; - switch (response.status) - { + switch(response.status) { case 401: message = 'Invalid credentials'; break; @@ -51,28 +44,27 @@ export const COMPONENT = message = 'Something went wrong'; } - showMessage (message); + showMessage(message); } - function $ (id) - { - return document.getElementById (id); + function $(id) { + return document.getElementById(id); } - function setLoading (isLoading) - { - var spinner = $('spinner').firstChild.MaterialSpinner; - - if (isLoading) - spinner.start (); + function setLoading(isLoading) { + // FIXME: Al minimificar MaterialSpinner es undefined +/* var spinner = $('spinner').firstChild.MaterialSpinner; + + if(isLoading) + spinner.start(); else - spinner.stop (); - } + spinner.stop(); +*/ } - function showMessage (message) - { + function showMessage(message) { + // FIXME: Al minimificar no muestra la barra var snackbar = $('snackbar').firstChild.MaterialSnackbar; - snackbar.showSnackbar ({message: message}); + snackbar.showSnackbar({message: message}); } }, controllerAs: 'login' diff --git a/@salix/package.json b/@salix/package.json index bc9c22f59..b4e6068db 100644 --- a/@salix/package.json +++ b/@salix/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "angular": "^1.5.8", + "angular-translate": "^2.13.1", "angular-ui-router": "^1.0.0-beta.3", "express": "^4.14.0", "material-design-lite": "^1.2.1", diff --git a/@salix/vendor/src/angular-translate-vendor.js b/@salix/vendor/src/angular-translate-vendor.js new file mode 100644 index 000000000..144b4fb08 --- /dev/null +++ b/@salix/vendor/src/angular-translate-vendor.js @@ -0,0 +1,5 @@ +import * as _ngTranslate from 'angular-translate'; + +export const ngTranslate = { + name: 'pascalprecht.translate' +}; diff --git a/@salix/vendor/src/vendor.js b/@salix/vendor/src/vendor.js index 5d9cded94..740587725 100644 --- a/@salix/vendor/src/vendor.js +++ b/@salix/vendor/src/vendor.js @@ -1,4 +1,5 @@ export * from './angular-vendor'; export * from './oclazyload-vendor'; export * from './uirouter-vendor'; +export * from './angular-translate-vendor'; export * from './materialdesignlite-vendor'; \ No newline at end of file