From 1dd69db8b26bbdc65a5e321fc0463c8dd1e90dab Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Wed, 28 Dec 2016 15:09:02 +0100 Subject: [PATCH 1/6] gulp y dev windows --- .vscode/launch.json | 22 ++++++++++++++++++++++ @salix/gulpfile.js | 2 +- dev.cmd | 9 +++++---- services/nginx/.gitignore | 1 + services/nginx/logs/error.log | 7 +++++++ 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index fda821a0c..4916a51ac 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,6 +1,7 @@ { "version": "0.2.0", "configurations": [ + { "name": "Iniciar", "type": "node", @@ -61,6 +62,27 @@ "console": "internalConsole", "sourceMaps": false, "outFiles": [] + }, + { + "name": "gulp debug", + "type": "node", + "request": "launch", + "program": "${workspaceRoot}\\@salix\\node_modules\\gulp\\bin\\gulp.js", + "stopOnEntry": false, + "args": [], + "cwd": "${workspaceRoot}\\@salix", + "preLaunchTask": null, + "runtimeExecutable": null, + "runtimeArgs": [ + "--nolazy" + ], + "env": { + "NODE_ENV": "development" + }, + "console": "internalConsole", + "sourceMaps": false, + "outFiles": [] } + ] } \ No newline at end of file diff --git a/@salix/gulpfile.js b/@salix/gulpfile.js index 29c2ed3f4..2d421d4a3 100644 --- a/@salix/gulpfile.js +++ b/@salix/gulpfile.js @@ -105,7 +105,7 @@ gulp.task('routes', function() { var regex = new RegExp('^src/(.*)/routes\.js$'); function cb(file) { - var relative = file.relative.replace('\\', '/'); + var relative = file.relative.replace(/\\/g,'/'); var dirname = relative.match(regex)[1]; return {dirname: dirname}; } diff --git a/dev.cmd b/dev.cmd index 5c37499c2..7ad8db07b 100644 --- a/dev.cmd +++ b/dev.cmd @@ -1,6 +1,6 @@ @echo off -set currentDir=%~dp0 +set currentDir=%cd% set nginxPrefix=%currentDir%\services\nginx set nginxConf=%nginxPrefix%\conf-dev.conf @@ -12,18 +12,19 @@ goto caseUsage :caseStart call "%0" stop echo "################################ Starting services" + if not exist "%nginxPrefix%\temp" (mkdir "%nginxPrefix%\temp") + start /I nginx -c "%nginxConf%" -p "%nginxPrefix%" call forever start forever.json call forever list - call mkdir "%nginxPrefix%\temp" - call start /b nginx -c "%nginxConf%" -p "%nginxPrefix%" + cd @salix gulp goto caseExit :caseStop echo "################################ Stoping services" + if exist "%nginxPrefix%\temp\nginx.pid" (nginx -c "%nginxConf%" -p "%nginxPrefix%" -s stop) forever stopall - nginx -c "%nginxConf%" -p "%nginxPrefix%" -s stop goto caseExit :caseUsage diff --git a/services/nginx/.gitignore b/services/nginx/.gitignore index 185616dcd..f0f054830 100644 --- a/services/nginx/.gitignore +++ b/services/nginx/.gitignore @@ -1,2 +1,3 @@ +logs/* static/* temp/* \ No newline at end of file diff --git a/services/nginx/logs/error.log b/services/nginx/logs/error.log index e69de29bb..3b4e114bb 100644 --- a/services/nginx/logs/error.log +++ b/services/nginx/logs/error.log @@ -0,0 +1,7 @@ +2016/12/28 09:50:24 [notice] 5196#5988: signal process started +2016/12/28 10:09:41 [notice] 11168#10432: signal process started +2016/12/28 14:03:31 [notice] 10312#9012: signal process started +2016/12/28 14:04:01 [notice] 9996#32: signal process started +2016/12/28 14:08:07 [notice] 7984#8980: signal process started +2016/12/28 14:13:33 [notice] 10144#6644: signal process started +2016/12/28 14:44:57 [notice] 3248#9176: signal process started From b7bbf4a8b08780fcd82905c0854b7f91848a63c9 Mon Sep 17 00:00:00 2001 From: "SAMBA\\jgallego" Date: Mon, 2 Jan 2017 07:28:36 +0100 Subject: [PATCH 2/6] guardar formularios --- @salix/core/src/check/check.js | 40 +++--- @salix/core/src/core.js | 90 ++++++------ @salix/core/src/focus.js | 4 +- @salix/core/src/inputAttrsNormalizer.js | 7 +- @salix/crud/src/client/basic-data/index.html | 2 +- @salix/crud/src/client/card/card.js | 10 +- @salix/crud/src/client/fiscal-data/index.html | 36 ++--- @salix/crud/src/client/fiscal-data/index.js | 12 +- @salix/crud/src/client/routes.js | 6 + @salix/crud/src/client/web-access/index.html | 4 +- @salix/crud/src/client/web-access/index.js | 16 ++- @salix/gulpfile.js | 132 +++++++++--------- db.json | 4 +- services/client/common/models/Client.json | 30 +++- services/client/common/models/account.json | 18 +++ 15 files changed, 242 insertions(+), 169 deletions(-) create mode 100644 services/client/common/models/account.json diff --git a/@salix/core/src/check/check.js b/@salix/core/src/check/check.js index 4e76b4cf0..bfa94cc94 100644 --- a/@salix/core/src/check/check.js +++ b/@salix/core/src/check/check.js @@ -1,20 +1,20 @@ -import {module as _module} from '../module'; -import * as resolveFactory from '../resolveDefaultComponents'; -import * as normalizerFactory from '../inputAttrsNormalizer'; -import * as util from '../util'; - -const _NAME = 'check'; -export const NAME = util.getName(_NAME); - -directive.$inject =[resolveFactory.NAME, normalizerFactory.NAME]; -export function directive (resolve, normalizer){ - return{ - require:'E', - template: function(_,attrs){ - normalizer.normalize (attrs); - return resolve.getTemplate(_NAME, attrs); - } - } -} - -_module.directive(NAME,directive); +import {module as _module} from '../module'; +import * as resolveFactory from '../resolveDefaultComponents'; +import * as normalizerFactory from '../inputAttrsNormalizer'; +import * as util from '../util'; + +const _NAME = 'check'; +export const NAME = util.getName(_NAME); + +directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME]; +export function directive(resolve, normalizer) { + return { + require: 'E', + template: function(_, attrs) { + normalizer.normalize(attrs); + return resolve.getTemplate(_NAME, attrs); + } + }; +} + +_module.directive(NAME, directive); diff --git a/@salix/core/src/core.js b/@salix/core/src/core.js index 52c973f65..5e2a254e8 100644 --- a/@salix/core/src/core.js +++ b/@salix/core/src/core.js @@ -1,45 +1,45 @@ -import mtOverride from './mdl-override.css'; - -export * from './module' -export * from './util' - -export {SplitingRegister as splitingRegister} from './splitingregister' -export {NAME as RESOLVEDEFAULTCOMPONENT, ResolveDefaultComponent} from './resolveDefaultComponents' -export {NAME as INTERPOLATE, Interpolate} from './interpolate' -export {NAME as ROUTES_LOADER, RoutesLoader} from './routesLoader' - -export {NAME as FOCUS, directive as Focus} from './focus' -export {NAME as RULE, directive as Rule} from './rule' - -export {NAME as BUTTON, directive as ButtonDirective} from './button/button' -export {NAME as BUTTON_MDL, factory as buttonMdl} from './button/button.mdl' -export {NAME as BUTTON_BT, factory as buttonBt} from './button/button.bt' -export {NAME as CHECK,directive as CheckDirective} from './check/check' -export {NAME as CHECK_MDL, factory as checknMdl} from './check/check.mdl' -export {NAME as CHECK_BT, factory as checkBt} from './check/check.bt' -export {NAME as RADIO,directive as RadioDirective} from './radio/radio' -export {NAME as RADIO_MDL, factory as radionMdl} from './radio/radio.mdl' -export {NAME as RADIO_BT, factory as radioBt} from './radio/radio.bt' -export {NAME as TEXTFIELD, directive as TextfieldDirective} from './textfield/textfield' -export {NAME as TEXTFIELD_MDL, factory as textfieldMdl} from './textfield/textfield.mdl' -export {NAME as TEXTFIELD_BT, factory as textfieldBt} from './textfield/textfield.bt' -export {NAME as LABEL, directive as LabelDirective} from './label/label' -export {NAME as LABEL_MDL, factory as labelMdl} from './label/label.mdl' -export {NAME as LABEL_BT, factory as labelBt} from './label/label.bt' -export {NAME as ICON_BUTTON, directive as IconButtonDirective} from './icon-button/icon-button' -export {NAME as ICON_BUTTON_MDL, factory as iconButtonMdl} from './icon-button/icon-button.mdl' -export {NAME as PASSWORD, directive as PasswordDirective} from './password/password' -export {NAME as PASSWORD_MDL,factory as passwordMdl} from './password/password.mdl' -export {NAME as SUBMIT, directive as SubmitDirective} from './submit/submit' -export {NAME as SUBMIT_MDL, factory as submitMdl} from './submit/submit.mdl' -export {NAME as SNACKBAR, directive as SnackbarDirective} from './snackbar/snackbar' -export {NAME as SNACKBAR_MDL, factory as snackbarMdl} from './snackbar/snackbar.mdl' -export {NAME as SPINNER, directive as SpinnerDirective} from './spinner/spinner' -export {NAME as SPINNER_MDL, factory as spinnerMdl} from './spinner/spinner.mdl' -export {NAME as COMBO, directive as ComboDirective} from './combo/combo' -export {NAME as COMBO_MDL, factory as comboMdl} from './combo/combo.mdl' -export {NAME as DATE_PICKER, directive as DatePickerDirective} from './date-picker/date-picker' -export {NAME as DATE_PICKER_MDL, factory as datePickerMdl} from './date-picker/date-picker.mdl' - -export {NAME as TITLE, COMPONENT as TITLE_COMPONENT} from './title/title' -export {NAME as SUBTITLE, COMPONENT as SUBTITLE_COMPONENT} from './subtitle/subtitle' +require('./mdl-override.css'); + +export * from './module'; +export * from './util'; + +export {SplitingRegister as splitingRegister} from './splitingregister'; +export {NAME as RESOLVEDEFAULTCOMPONENT, ResolveDefaultComponent} from './resolveDefaultComponents'; +export {NAME as INTERPOLATE, Interpolate} from './interpolate'; +export {NAME as ROUTES_LOADER, RoutesLoader} from './routesLoader'; + +export {NAME as FOCUS, directive as Focus} from './focus'; +export {NAME as RULE, directive as Rule} from './rule'; + +export {NAME as BUTTON, directive as ButtonDirective} from './button/button'; +export {NAME as BUTTON_MDL, factory as buttonMdl} from './button/button.mdl'; +export {NAME as BUTTON_BT, factory as buttonBt} from './button/button.bt'; +export {NAME as CHECK, directive as CheckDirective} from './check/check'; +export {NAME as CHECK_MDL, factory as checknMdl} from './check/check.mdl'; +export {NAME as CHECK_BT, factory as checkBt} from './check/check.bt'; +export {NAME as RADIO, directive as RadioDirective} from './radio/radio'; +export {NAME as RADIO_MDL, factory as radionMdl} from './radio/radio.mdl'; +export {NAME as RADIO_BT, factory as radioBt} from './radio/radio.bt'; +export {NAME as TEXTFIELD, directive as TextfieldDirective} from './textfield/textfield'; +export {NAME as TEXTFIELD_MDL, factory as textfieldMdl} from './textfield/textfield.mdl'; +export {NAME as TEXTFIELD_BT, factory as textfieldBt} from './textfield/textfield.bt'; +export {NAME as LABEL, directive as LabelDirective} from './label/label'; +export {NAME as LABEL_MDL, factory as labelMdl} from './label/label.mdl'; +export {NAME as LABEL_BT, factory as labelBt} from './label/label.bt'; +export {NAME as ICON_BUTTON, directive as IconButtonDirective} from './icon-button/icon-button'; +export {NAME as ICON_BUTTON_MDL, factory as iconButtonMdl} from './icon-button/icon-button.mdl'; +export {NAME as PASSWORD, directive as PasswordDirective} from './password/password'; +export {NAME as PASSWORD_MDL, factory as passwordMdl} from './password/password.mdl'; +export {NAME as SUBMIT, directive as SubmitDirective} from './submit/submit'; +export {NAME as SUBMIT_MDL, factory as submitMdl} from './submit/submit.mdl'; +export {NAME as SNACKBAR, directive as SnackbarDirective} from './snackbar/snackbar'; +export {NAME as SNACKBAR_MDL, factory as snackbarMdl} from './snackbar/snackbar.mdl'; +export {NAME as SPINNER, directive as SpinnerDirective} from './spinner/spinner'; +export {NAME as SPINNER_MDL, factory as spinnerMdl} from './spinner/spinner.mdl'; +export {NAME as COMBO, directive as ComboDirective} from './combo/combo'; +export {NAME as COMBO_MDL, factory as comboMdl} from './combo/combo.mdl'; +export {NAME as DATE_PICKER, directive as DatePickerDirective} from './date-picker/date-picker'; +export {NAME as DATE_PICKER_MDL, factory as datePickerMdl} from './date-picker/date-picker.mdl'; + +export {NAME as TITLE, COMPONENT as TITLE_COMPONENT} from './title/title'; +export {NAME as SUBTITLE, COMPONENT as SUBTITLE_COMPONENT} from './subtitle/subtitle'; diff --git a/@salix/core/src/focus.js b/@salix/core/src/focus.js index 196c904f3..ddfce791c 100644 --- a/@salix/core/src/focus.js +++ b/@salix/core/src/focus.js @@ -4,12 +4,12 @@ export const NAME = 'vnFocus'; export function directive() { return { restrict: 'A', - link: function (scope, elements, attrs){ + link: function(scope, elements, attrs) { let element = elements[0]; element.focus(); let len = element.value ? element.value.length : 0; element.setSelectionRange(0, len); - //element.select(); + // element.select(); } }; } diff --git a/@salix/core/src/inputAttrsNormalizer.js b/@salix/core/src/inputAttrsNormalizer.js index 05592f9a4..a6047b2bf 100644 --- a/@salix/core/src/inputAttrsNormalizer.js +++ b/@salix/core/src/inputAttrsNormalizer.js @@ -2,8 +2,7 @@ import {module} from './module'; export const NAME = 'vnInputAttrsNormalizer'; export class InputAttrsNormalizer { - constructor () {} - $get(){ + $get() { return { normalize: function(attrs) { // FIXME: No siempre se pasan estos atributos, ej: searchbar @@ -25,7 +24,7 @@ export class InputAttrsNormalizer { attrs.focus = 'vn-focus'; } }; - } + } } -module.provider (NAME, () => new InputAttrsNormalizer ()) \ No newline at end of file +module.provider(NAME, () => new InputAttrsNormalizer()); diff --git a/@salix/crud/src/client/basic-data/index.html b/@salix/crud/src/client/basic-data/index.html index c80ab62f5..447c8f0b3 100644 --- a/@salix/crud/src/client/basic-data/index.html +++ b/@salix/crud/src/client/basic-data/index.html @@ -11,7 +11,7 @@ - + diff --git a/@salix/crud/src/client/card/card.js b/@salix/crud/src/client/card/card.js index 37279a1ee..dd44f8eb6 100644 --- a/@salix/crud/src/client/card/card.js +++ b/@salix/crud/src/client/card/card.js @@ -10,21 +10,21 @@ export const COMPONENT = { controller: function($http, $stateParams) { this.client = null; $http.get(`/client/api/Clients/${$stateParams.id}`).then( - (json) => { - this.client = json.data; + json => { + this.client = json.data; this.descriptor = { clientId: this.client.id, name: this.client.name, phone: this.client.phone }; }, - (json) => console.error (json.data.error.message) + json => console.error(json.data.error.message) ); this.items = []; - routes['client'].routes.forEach ((i) => { + routes.client.routes.forEach(i => { if (i.description) - this.items.push ({ + this.items.push({ description: i.description, icon: i.icon, href: i.state diff --git a/@salix/crud/src/client/fiscal-data/index.html b/@salix/crud/src/client/fiscal-data/index.html index bd5f1fc6d..ca4f3234e 100644 --- a/@salix/crud/src/client/fiscal-data/index.html +++ b/@salix/crud/src/client/fiscal-data/index.html @@ -1,40 +1,40 @@ -
+ Datos fiscales y de facturación - - - - + + + + - - + + - - + + - - - + + +
Información de facturación
- - + + - - - - + + + +
Documentación
diff --git a/@salix/crud/src/client/fiscal-data/index.js b/@salix/crud/src/client/fiscal-data/index.js index d951f6b79..0bd3e0a7b 100644 --- a/@salix/crud/src/client/fiscal-data/index.js +++ b/@salix/crud/src/client/fiscal-data/index.js @@ -5,9 +5,19 @@ export const NAME = 'vnClientFiscalData'; export const COMPONENT = { template: template, controllerAs: 'fiscal', + bindings: { + client: '<' + }, controller: function($http) { + $http.get('/client/api/SalesPeople').then( + json => { + this.sales = json.data; + console.log(this.sales); + }, + json => console.error(json.data.error.message) + ); this.submit = function() { - $http.post('/client/api/Clients', this.model).then( + $http.put('/client/api/Clients', this.client).then( json => console.log(json.statusText), json => console.error(json.data.error.message) ); diff --git a/@salix/crud/src/client/routes.js b/@salix/crud/src/client/routes.js index e880fbc06..4d2c9d163 100644 --- a/@salix/crud/src/client/routes.js +++ b/@salix/crud/src/client/routes.js @@ -25,6 +25,9 @@ url: "/fiscal-data", state: "clientCard.fiscalData", component: "vn-client-fiscal-data", + params: { + client: "card.client" + }, description: "Datos facturación", icon: "assignment" }, @@ -39,6 +42,9 @@ url: "/web-access", state: "clientCard.webAccess", component: "vn-client-web-access", + params: { + client: "card.client" + }, description: "Acceso web", icon: "language" }, diff --git a/@salix/crud/src/client/web-access/index.html b/@salix/crud/src/client/web-access/index.html index d14b7f2f7..bd505a8c7 100644 --- a/@salix/crud/src/client/web-access/index.html +++ b/@salix/crud/src/client/web-access/index.html @@ -1,6 +1,6 @@ Acceso Web - - + + \ No newline at end of file diff --git a/@salix/crud/src/client/web-access/index.js b/@salix/crud/src/client/web-access/index.js index fb2807c33..92b861258 100644 --- a/@salix/crud/src/client/web-access/index.js +++ b/@salix/crud/src/client/web-access/index.js @@ -3,7 +3,19 @@ import {module} from '../../module'; export const NAME = 'vnClientWebAccess'; export const COMPONENT = { + template: template, controllerAs: 'web', - template: template + bindings: { + client: '<' + }, + controller: function($http) { + this.submit = function() { + $http.put('/client/api/Clients', this.client).then( + json => console.log(json.statusText), + json => console.error(json.data.error.message) + ); + }; + } }; -module.component(NAME, COMPONENT); \ No newline at end of file +COMPONENT.controller.$inject = ['$http']; +module.component(NAME, COMPONENT); diff --git a/@salix/gulpfile.js b/@salix/gulpfile.js index 29c2ed3f4..c28fc7529 100644 --- a/@salix/gulpfile.js +++ b/@salix/gulpfile.js @@ -13,86 +13,86 @@ var webpackConfig = require('./webpack.config.js'); // Clean -var buildDir = '../services/nginx/static' +var buildDir = '../services/nginx/static'; gulp.task('clean', function() { - return del(buildDir +'/*', {force: true}); + return del(buildDir + '/*', {force: true}); }); // Spliting var splitingDir = './app/src/spliting'; -var splitingFiles = splitingDir +'/*'; +var splitingFiles = splitingDir + '/*'; gulp.task('spliting', function() { - var jsonDeps = fs.readFileSync(splitingDir +'/deps.json'); - var modules = JSON.parse(jsonDeps); + var jsonDeps = fs.readFileSync(splitingDir + '/deps.json'); + var modules = JSON.parse(jsonDeps); - var importTpl = fs.readFileSync(splitingDir +'/import.tpl.js', 'utf8'); - var requireTpl = fs.readFileSync(splitingDir +'/require.tpl.js', 'utf8'); + var importTpl = fs.readFileSync(splitingDir + '/import.tpl.js', 'utf8'); + var requireTpl = fs.readFileSync(splitingDir + '/require.tpl.js', 'utf8'); - for(var modName in modules) + for (var modName in modules) { - var deps = modules[modName]; - var splitFile = './'+ modName +'/src/spliting.js'; - - try { - fs.unlinkSync(splitFile); - } - catch(e) {} - - fs.appendFileSync(splitFile, importTpl); - - var i = deps.length; - while(i--) - fs.appendFileSync(splitFile, + var deps = modules[modName]; + var splitFile = './' + modName + '/src/spliting.js'; + + try { + fs.unlinkSync(splitFile); + } + catch (e) {} + + fs.appendFileSync(splitFile, importTpl); + + var i = deps.length; + while (i--) + fs.appendFileSync(splitFile, requireTpl.replace(/\$module/g, deps[i])); - } + } }); // Webpack gulp.task('webpack', ['spliting'], function(callback) { - var myDevConfig = Object.create(webpackConfig); - myDevConfig.debug = true; + var myDevConfig = Object.create(webpackConfig); + myDevConfig.debug = true; - var devCompiler = webpack(myDevConfig); + var devCompiler = webpack(myDevConfig); - devCompiler.run(function(err, stats) { - if(err) throw new gutil.PluginError('webpack', err); - gutil.log('[webpack]', stats.toString({colors: true})); - callback(); - }); + devCompiler.run(function(err, stats) { + if (err) throw new gutil.PluginError('webpack', err); + gutil.log('[webpack]', stats.toString({colors: true})); + callback(); + }); }); gulp.task('webpack-dev-server', ['spliting'], function() { - var myConfig = Object.create(webpackConfig); - myConfig.debug = true; + var myConfig = Object.create(webpackConfig); + myConfig.debug = true; - for (var entry in myConfig.entry) - myConfig.entry[entry] + for (var entry in myConfig.entry) + myConfig.entry[entry] .unshift('webpack-dev-server/client?http://0.0.0.0:8081/'); - var devServer = new WebpackDevServer(webpack(myConfig), { - publicPath: '/', - contentBase: buildDir, - quiet: false, - noInfo: false, - //hot: true, - stats: { - assets: true, - colors: true, - version: false, - hash: false, - timings: true, - chunks: false, - chunkModules: false - } - }) + var devServer = new WebpackDevServer(webpack(myConfig), { + publicPath: '/', + contentBase: buildDir, + quiet: false, + noInfo: false, + // hot: true, + stats: { + assets: true, + colors: true, + version: false, + hash: false, + timings: true, + chunks: false, + chunkModules: false + } + }) .listen(8081, '0.0.0.0', function(err) { - if(err) throw new gutil.PluginError('webpack-dev-server', err); - gutil.log('[webpack-dev-server]', 'Listening'); - }); + if (err) throw new gutil.PluginError('webpack-dev-server', err); + gutil.log('[webpack-dev-server]', 'Listening'); +}); }); // Routes @@ -100,17 +100,17 @@ gulp.task('webpack-dev-server', ['spliting'], function() { var routeFiles = './crud/**/routes.js'; gulp.task('routes', function() { - var fileTpl = '\n"<%=dirname%>": <%=contents%>'; - var globalTpl = 'var routes = {<%=contents%>\n}'; - var regex = new RegExp('^src/(.*)/routes\.js$'); + 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}; - } + function cb(file) { + var relative = file.relative.replace(/\\/g, '/'); + var dirname = relative.match(regex)[1]; + return {dirname: dirname}; + } - return gulp.src(routeFiles) + return gulp.src(routeFiles) .pipe(wrap(fileTpl, cb)) .pipe(concat('salix.routes.js', {newLine: ','})) .pipe(wrap(globalTpl)) @@ -121,16 +121,16 @@ gulp.task('routes', function() { // Watch gulp.task('watch', function() { - gulp.watch(routeFiles, ['routes']); - gulp.watch(splitingFiles, ['spliting']); + gulp.watch(routeFiles, ['routes']); + gulp.watch(splitingFiles, ['spliting']); }); // Default gulp.task('build', ['clean'], function() { - return gulp.start('routes', 'webpack'); + return gulp.start('routes', 'webpack'); }); gulp.task('default', ['clean'], function() { - return gulp.start('watch', 'routes', 'webpack-dev-server'); + return gulp.start('watch', 'routes', 'webpack-dev-server'); }); diff --git a/db.json b/db.json index 80c1bb7bb..432248ede 100644 --- a/db.json +++ b/db.json @@ -14,8 +14,8 @@ "NUf7o684TmteojFX9KmPOpaDLthjP5Def4wuy83Yjv31i43HHiWgV3FyBp6pX8Ue": "{\"id\":\"NUf7o684TmteojFX9KmPOpaDLthjP5Def4wuy83Yjv31i43HHiWgV3FyBp6pX8Ue\",\"ttl\":1209600,\"created\":\"2016-11-21T11:06:11.113Z\",\"userId\":1}" }, "Client": { - "12": "{\"name\":\"Cliente 2\",\"id\":12,\"fi\":\"1111111111\",\"salesPerson\":\"2\"}", - "14": "{\"name\":\"cliente 1\",\"id\":14}" + "12": "{\"name\":\"fa\",\"id\":12,\"fi\":\"1111111111\",\"salesPerson\":\"2\",\"telefono\":\"654654654\",\"socialName\":\"asdfasdfasdf\",\"active\":true,\"user\":\"gva\",\"fax\":\"hn\",\"phone\":\"45745675\",\"email\":\"asdf@osij.com\",\"surcharge\":true,\"cyc\":\"2345\",\"credit\":1000,\"iban\":\"2352345234523452345\",\"street\":\"asdfasdf\",\"city\":\"algemesi\",\"postcode\":\"46680\",\"mobile\":\"654654654\",\"dueDay\":\"4\",\"gestdoc\":\"23452343\"}", + "14": "{\"name\":\"cliente f\",\"id\":14,\"street\":\"Aaaaaaaaaa\",\"fi\":\"20420\",\"socialName\":\"sdfg\",\"fax\":\"sdfg\",\"dischargeDate\":\"sdfg\",\"telefono\":\"sdfg\",\"salesPerson\":\"2\",\"email\":\"sdfg\",\"city\":\"asdf\",\"postcode\":\"asdf\",\"phone\":\"asdf\",\"mobile\":\"asdf\",\"credit\":2345,\"cyc\":123,\"iban\":\"asdf\",\"dueDay\":345,\"gestdoc\":2435,\"surcharge\":true}" }, "PaymentMethod": { "1": "{\"name\":\"Tarjeta\",\"id\":1}", diff --git a/services/client/common/models/Client.json b/services/client/common/models/Client.json index d539a62ee..80ac6775a 100644 --- a/services/client/common/models/Client.json +++ b/services/client/common/models/Client.json @@ -24,6 +24,28 @@ "contact": { "type": "string" }, + "street": { + "type": "string", + "required": "true" + }, + "consignee": { + "type": "string", + "required": "true" + }, + "city": { + "type": "string", + "required": "true" + }, + "postcode": { + "type": "string" + }, + "province": { + "type": "Number" + }, + "country": { + "type": "string", + "required": "true" + }, "email": { "type": "string" }, @@ -39,7 +61,7 @@ "credit": { "type": "Number" }, - "creditAndCaution": { + "cyc": { "type": "Number" }, "iban": { @@ -48,6 +70,12 @@ "payMethod": { "type": "string" }, + "dueDay": { + "type": "Number" + }, + "gestdoc":{ + "type":"Number" + }, "surcharge": { "type": "boolean", "description": "The client has equivalence surcharge" diff --git a/services/client/common/models/account.json b/services/client/common/models/account.json new file mode 100644 index 000000000..98a2b86f4 --- /dev/null +++ b/services/client/common/models/account.json @@ -0,0 +1,18 @@ +{ + "name": "account", + "base": "PersistedModel", + "properties": { + "id": { + "type": "Number", + "id": true, + "description": "Identifier" + }, + "name": { + "type": "string", + "required": "true" + }, + "active": { + "type": "boolean" + } + } +} From 5d9eb50527be872241cb56f77b0e5a7ae2c2026f Mon Sep 17 00:00:00 2001 From: jgallego Date: Mon, 2 Jan 2017 12:27:09 +0100 Subject: [PATCH 3/6] canvio crlf --- @salix/core/src/check/check.mdl.js | 42 +- @salix/core/src/interpolate.js | 408 ++++++++++---------- @salix/core/src/mdl-override.css | 4 +- @salix/core/src/resolveDefaultComponents.js | 78 ++-- @salix/core/src/routesLoader.js | 36 +- @salix/core/src/splitingregister.js | 26 +- @salix/core/src/textfield/textfield.js | 40 +- @salix/core/src/textfield/textfield.mdl.js | 50 +-- @salix/core/src/util.js | 96 ++--- 9 files changed, 385 insertions(+), 395 deletions(-) diff --git a/@salix/core/src/check/check.mdl.js b/@salix/core/src/check/check.mdl.js index 9ebe1cbd3..1f65309b6 100644 --- a/@salix/core/src/check/check.mdl.js +++ b/@salix/core/src/check/check.mdl.js @@ -1,21 +1,21 @@ -import {module as _module} from '../module'; -import * as util from '../util'; -import * as constant from '../constants'; -import template from './check.mdl.html'; - -const _NAME = 'check'; -const DEFAULT_CLASS = 'mdl-checkbox__input'; - -export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK); - -export function factory() { - return { - template: template, - default: { - enabled: 'true', - className: DEFAULT_CLASS - } - } -} - -_module.factory(NAME, factory); +import {module as _module} from '../module'; +import * as util from '../util'; +import * as constant from '../constants'; +import template from './check.mdl.html'; + +const _NAME = 'check'; +const DEFAULT_CLASS = 'mdl-checkbox__input'; + +export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK); + +export function factory() { + return { + template: template, + default: { + enabled: 'true', + className: DEFAULT_CLASS + } + }; +} + +_module.factory(NAME, factory); diff --git a/@salix/core/src/interpolate.js b/@salix/core/src/interpolate.js index 115c1f98e..bfaacd6fd 100644 --- a/@salix/core/src/interpolate.js +++ b/@salix/core/src/interpolate.js @@ -1,206 +1,202 @@ -import {module} from './module'; -import {ng} from 'vendor'; -import * as util from './util'; - -export const NAME = util.getProviderName('interpolate'); - -function minErr() {} - -function stringify(value) { - if (value == null) { // null || undefined - return ''; - } - switch (typeof value) { - case 'string': - break; - case 'number': - value = '' + value; - break; - default: - value = angular.toJson(value); - } - - return value; -} - -var $interpolateMinErr = ng.angular.$interpolateMinErr = ng.$$minErr('$interpolate'); - -$interpolateMinErr.throwNoconcat = function (text) { - throw $interpolateMinErr('noconcat', - 'Error while interpolating: {0}\nStrict Contextual Escaping disallows ' + - 'interpolations that concatenate multiple expressions when a trusted value is ' + - 'required. See http://docs.angularjs.org/api/ng.$sce', text); -}; - -$interpolateMinErr.interr = function (text, err) { - return $interpolateMinErr('interr', 'Can\'t interpolate: {0}\n{1}', text, err.toString()); -}; - -function $get($parse, $exceptionHandler, $sce) { - var startSymbolLength = this._startSymbol.length, - endSymbolLength = this._endSymbol.length, - escapedStartRegexp = new RegExp(this._startSymbol.replace(/./g, escape), 'g'), - escapedEndRegexp = new RegExp(this._endSymbol.replace(/./g, escape), 'g'), - self = this; - - function escape(ch) { - return '\\\\\\' + ch; - } - - function unescapeText(text) { - return text.replace(escapedStartRegexp, self._startSymbol). - replace(escapedEndRegexp, self._endSymbol); - } - - // TODO: this is the same as the constantWatchDelegate in parse.js - function constantWatchDelegate(scope, listener, objectEquality, constantInterp) { - var unwatch = scope.$watch(function constantInterpolateWatch(scope) { - unwatch(); - return constantInterp(scope); - }, listener, objectEquality); - return unwatch; - } - - function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) - { - // Provide a quick exit and simplified result function for text with no interpolation - if (!text.length || text.indexOf(self._startSymbol) === -1) - { - var constantInterp; - if (!mustHaveExpression) { - var unescapedText = unescapeText(text); - constantInterp = valueFn(unescapedText); - constantInterp.exp = text; - constantInterp.expressions = []; - constantInterp.$$watchDelegate = constantWatchDelegate; - } - return constantInterp; - } - - allOrNothing = !!allOrNothing; - var startIndex, - endIndex, - index = 0, - expressions = [], - parseFns = [], - textLength = text.length, - exp, - concat = [], - expressionPositions = []; - - while (index < textLength) { - if (((startIndex = text.indexOf(self._startSymbol, index)) !== -1) && - ((endIndex = text.indexOf(self._endSymbol, startIndex + startSymbolLength)) !== -1)) { - if (index !== startIndex) { - concat.push(unescapeText(text.substring(index, startIndex))); - } - exp = text.substring(startIndex + startSymbolLength, endIndex); - expressions.push(exp); - parseFns.push($parse(exp, parseStringifyInterceptor)); - index = endIndex + endSymbolLength; - expressionPositions.push(concat.length); - concat.push(''); - } else { - // we did not find an interpolation, so we have to add the remainder to the separators array - if (index !== textLength) { - concat.push(unescapeText(text.substring(index))); - } - break; - } - } - - if (trustedContext && concat.length > 1) { - $interpolateMinErr.throwNoconcat(text); - } - - if (!mustHaveExpression || expressions.length) { - var compute = function (values) { - for (var i = 0, ii = expressions.length; i < ii; i++) { - if (allOrNothing && isUndefined(values[i])) return; - concat[expressionPositions[i]] = values[i]; - } - return concat.join(''); - }; - - var getValue = function (value) { - return trustedContext ? - $sce.getTrusted(trustedContext, value) : - $sce.valueOf(value); - }; - - return angular.extend(function interpolationFn(context) { - var i = 0; - var ii = expressions.length; - var values = new Array(ii); - - try { - for (; i < ii; i++) { - values[i] = parseFns[i](context); - } - - return compute(values); - } catch (err) { - $exceptionHandler($interpolateMinErr.interr(text, err)); - } - - }, { - // all of these properties are undocumented for now - exp: text, //just for compatibility with regular watchers created via $watch - expressions: expressions, - }); - } - - function parseStringifyInterceptor(value) { - try { - value = getValue(value); - return allOrNothing && !isDefined(value) ? value : stringify(value); - } catch (err) { - $exceptionHandler($interpolateMinErr.interr(text, err)); - } - } - } - - $interpolate.startSymbol = function () { - return startSymbol; - }; - - $interpolate.endSymbol = function () { - return endSymbol; - }; - - return $interpolate; - } - -$get.$inject = ['$parse', '$exceptionHandler', '$sce']; - -export class Interpolate -{ - constructor () { - this._startSymbol='*['; - this._endSymbol = ']*'; - } - - set startSymbol (value) { - if (value) { - this._startSymbol = value; - return this; - } else { - return this._startSymbol; - } - }; - - set endSymbol (value) { - if (value) { - this._endSymbol = value; - return this; - } else { - return this._endSymbol; - } - }; - - -} - -Interpolate.prototype.$get = $get; -var interpolate = new Interpolate(); -module.provider(NAME, () => interpolate); +import {module} from './module'; +import {ng} from 'vendor'; +import * as util from './util'; + +export const NAME = util.getProviderName('interpolate'); + +function minErr() {} + +function stringify(value) { + if (value === null) { // null || undefined + return ''; + } + switch (typeof value) { + case 'string': + break; + case 'number': + value = String(value); + break; + default: + value = angular.toJson(value); + } + + return value; +} + +var $interpolateMinErr = ng.angular.$interpolateMinErr = ng.$$minErr('$interpolate'); + +$interpolateMinErr.throwNoconcat = function(text) { + throw $interpolateMinErr('noconcat', + 'Error while interpolating: {0}\nStrict Contextual Escaping disallows ' + + 'interpolations that concatenate multiple expressions when a trusted value is ' + + 'required. See http://docs.angularjs.org/api/ng.$sce', text); +}; + +$interpolateMinErr.interr = function(text, err) { + return $interpolateMinErr('interr', 'Can\'t interpolate: {0}\n{1}', text, err.toString()); +}; + +function $get($parse, $exceptionHandler, $sce) { + var startSymbolLength = this._startSymbol.length, + endSymbolLength = this._endSymbol.length, + escapedStartRegexp = new RegExp(this._startSymbol.replace(/./g, escape), 'g'), + escapedEndRegexp = new RegExp(this._endSymbol.replace(/./g, escape), 'g'), + self = this; + + function escape(ch) { + return '\\\\\\' + ch; + } + + function unescapeText(text) { + return text.replace(escapedStartRegexp, self._startSymbol) + .replace(escapedEndRegexp, self._endSymbol); + } + + // TODO: this is the same as the constantWatchDelegate in parse.js + function constantWatchDelegate(scope, listener, objectEquality, constantInterp) { + var unwatch = scope.$watch(function constantInterpolateWatch(scope) { + unwatch(); + return constantInterp(scope); + }, listener, objectEquality); + return unwatch; + } + + function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) { + // Provide a quick exit and simplified result function for text with no interpolation + if (!text.length || text.indexOf(self._startSymbol) === -1) { + var constantInterp; + if (!mustHaveExpression) { + var unescapedText = unescapeText(text); + constantInterp = valueFn(unescapedText); + constantInterp.exp = text; + constantInterp.expressions = []; + constantInterp.$$watchDelegate = constantWatchDelegate; + } + return constantInterp; + } + + allOrNothing = Boolean(allOrNothing); + var startIndex, + endIndex, + index = 0, + expressions = [], + parseFns = [], + textLength = text.length, + exp, + concat = [], + expressionPositions = []; + + while (index < textLength) { + if (((startIndex = text.indexOf(self._startSymbol, index)) !== -1) && + ((endIndex = text.indexOf(self._endSymbol, startIndex + startSymbolLength)) !== -1)) { + if (index !== startIndex) { + concat.push(unescapeText(text.substring(index, startIndex))); + } + exp = text.substring(startIndex + startSymbolLength, endIndex); + expressions.push(exp); + parseFns.push($parse(exp, parseStringifyInterceptor)); + index = endIndex + endSymbolLength; + expressionPositions.push(concat.length); + concat.push(''); + } else { + // we did not find an interpolation, so we have to add the remainder to the separators array + if (index !== textLength) { + concat.push(unescapeText(text.substring(index))); + } + break; + } + } + + if (trustedContext && concat.length > 1) { + $interpolateMinErr.throwNoconcat(text); + } + + if (!mustHaveExpression || expressions.length) { + var compute = function(values) { + for (var i = 0, ii = expressions.length; i < ii; i++) { + if (allOrNothing && isUndefined(values[i])) return; + concat[expressionPositions[i]] = values[i]; + } + return concat.join(''); + }; + + var getValue = function(value) { + return trustedContext ? + $sce.getTrusted(trustedContext, value) : + $sce.valueOf(value); + }; + + return angular.extend(function interpolationFn(context) { + var i = 0; + var ii = expressions.length; + var values = new Array(ii); + + try { + for (; i < ii; i++) { + values[i] = parseFns[i](context); + } + + return compute(values); + } catch (err) { + $exceptionHandler($interpolateMinErr.interr(text, err)); + } + }, { + // all of these properties are undocumented for now + exp: text, // just for compatibility with regular watchers created via $watch + expressions: expressions + }); + } + + function parseStringifyInterceptor(value) { + try { + value = getValue(value); + return allOrNothing && !isDefined(value) ? value : stringify(value); + } catch (err) { + $exceptionHandler($interpolateMinErr.interr(text, err)); + } + } + } + + $interpolate.startSymbol = function() { + return startSymbol; + }; + + $interpolate.endSymbol = function() { + return endSymbol; + }; + + return $interpolate; +} + +$get.$inject = ['$parse', '$exceptionHandler', '$sce']; + +export class Interpolate +{ + constructor() { + this._startSymbol = '*['; + this._endSymbol = ']*'; + } + + set startSymbol(value) { + if (value) { + this._startSymbol = value; + return this; + } else { + return this._startSymbol; + } + } + + set endSymbol(value) { + if (value) { + this._endSymbol = value; + return this; + } else { + return this._endSymbol; + } + } + +} + +Interpolate.prototype.$get = $get; +var interpolate = new Interpolate(); +module.provider(NAME, () => interpolate); diff --git a/@salix/core/src/mdl-override.css b/@salix/core/src/mdl-override.css index fedc64395..3420da49e 100644 --- a/@salix/core/src/mdl-override.css +++ b/@salix/core/src/mdl-override.css @@ -1,4 +1,4 @@ - +/* .mdl-textfield { width: 100%; } @@ -19,4 +19,4 @@ .mdl-button--raised:hover { background-color: #ffa410; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/@salix/core/src/resolveDefaultComponents.js b/@salix/core/src/resolveDefaultComponents.js index fa45672c2..5fa37cd75 100644 --- a/@salix/core/src/resolveDefaultComponents.js +++ b/@salix/core/src/resolveDefaultComponents.js @@ -1,39 +1,39 @@ -import {module as _module} from './module'; -import * as util from './util'; -import constant from './constants'; -import Interpolate from './interpolate'; - -export const NAME = util.getProviderName('ResolveDefaultComponent'); - -function $get($injector, vnInterpolate){ - return { - getTemplate:function(name, attrs) { - this._frameworkName = 'Mdl'; - let _name = util.getFactoryName( name + this._frameworkName); - let defaultfactory = $injector.has(_name) ? $injector.get(_name) : undefined; - - if(!defaultfactory) { - throw new Error("factory is not defined"); - } - - let defaultValues = defaultfactory.default; - let template = defaultfactory.template; - let scope = Object.assign({}, defaultValues || {}, attrs || {}); - return template && vnInterpolate(template)(scope); - } - }; -} -$get.$inject = ['$injector', 'vnInterpolate']; - -export class ResolveDefaultComponent { - constructor() { - this._frameworkName='Mdl'; - } - set frameworkName(value) { - this._frameworkName = value; - } -} - -ResolveDefaultComponent.prototype.$get = $get; -var resolve = new ResolveDefaultComponent(); -_module.provider(NAME,() => resolve); \ No newline at end of file +import {module as _module} from './module'; +import * as util from './util'; +import constant from './constants'; +import Interpolate from './interpolate'; + +export const NAME = util.getProviderName('ResolveDefaultComponent'); + +function $get($injector, vnInterpolate) { + return { + getTemplate: function(name, attrs) { + this._frameworkName = 'Mdl'; + let _name = util.getFactoryName(name + this._frameworkName); + let defaultfactory = $injector.has(_name) ? $injector.get(_name) : undefined; + + if (!defaultfactory) { + throw new Error("factory is not defined"); + } + + let defaultValues = defaultfactory.default; + let template = defaultfactory.template; + let scope = Object.assign({}, defaultValues || {}, attrs || {}); + return template && vnInterpolate(template)(scope); + } + }; +} +$get.$inject = ['$injector', 'vnInterpolate']; + +export class ResolveDefaultComponent { + constructor() { + this._frameworkName = 'Mdl'; + } + set frameworkName(value) { + this._frameworkName = value; + } +} + +ResolveDefaultComponent.prototype.$get = $get; +var resolve = new ResolveDefaultComponent(); +_module.provider(NAME, () => resolve); diff --git a/@salix/core/src/routesLoader.js b/@salix/core/src/routesLoader.js index eef26ff85..25a0eec6f 100644 --- a/@salix/core/src/routesLoader.js +++ b/@salix/core/src/routesLoader.js @@ -1,27 +1,27 @@ -import {module as _module} from './module' -import * as util from './util' +import {module as _module} from './module'; +import * as util from './util'; -export const NAME = util.getProviderName ('RoutesLoader') +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 - }); +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 + }); } $get.$inject = ["$http"]; -export class RoutesLoader{ constructor () {} } +export class RoutesLoader { constructor() {} } RoutesLoader.prototype.$get = $get; -var routes = new RoutesLoader (); -_module.provider (NAME, () => routes) +var routes = new RoutesLoader(); +_module.provider(NAME, () => routes); diff --git a/@salix/core/src/splitingregister.js b/@salix/core/src/splitingregister.js index 725efab45..281a925de 100644 --- a/@salix/core/src/splitingregister.js +++ b/@salix/core/src/splitingregister.js @@ -1,5 +1,4 @@ const _SplitingRegister = () => { - var _graph; var dependencies = {}; @@ -16,15 +15,14 @@ const _SplitingRegister = () => { } return { - registerGraph: function (graph) { + registerGraph: function(graph) { _graph = graph; }, - register: function (dependency, loader) { + register: function(dependency, loader) { dependencies[dependency] = loader; }, - execute: function (dependency) { + execute: function(dependency) { return new Promise(resolve => { - var array = getDependencies(dependency); var arrayClone = array.concat([]); @@ -34,26 +32,22 @@ const _SplitingRegister = () => { } (function loadDependency(dependency) { - - if(!dependency){ + if (!dependency) { resolve(arrayClone); return; } - dependency().then(function (data) { - var _dependency = getDependency(); - loadDependency(_dependency); + dependency().then(function(data) { + var _dependency = getDependency(); + loadDependency(_dependency); }); - } (getDependency())) - + })(getDependency()); }); - - }, - write: function () { + write: function() { console.log(_graph); } - } + }; }; window.dependencies = _SplitingRegister(); export const SplitingRegister = window.dependencies; diff --git a/@salix/core/src/textfield/textfield.js b/@salix/core/src/textfield/textfield.js index 30130329a..11bc336df 100644 --- a/@salix/core/src/textfield/textfield.js +++ b/@salix/core/src/textfield/textfield.js @@ -1,20 +1,20 @@ -import {module as _module} from '../module'; -import * as resolveFactory from '../resolveDefaultComponents'; -import * as normalizerFactory from '../inputAttrsNormalizer'; -import * as util from '../util'; - -const _NAME = 'textfield'; -export const NAME = util.getName(_NAME); - -directive.$inject =[resolveFactory.NAME, normalizerFactory.NAME]; -export function directive (resolve, normalizer){ - return{ - require:'E', - template: function(_, attrs){ - normalizer.normalize (attrs); - return resolve.getTemplate(_NAME, attrs); - } - } -} - -_module.directive(NAME,directive); +import {module as _module} from '../module'; +import * as resolveFactory from '../resolveDefaultComponents'; +import * as normalizerFactory from '../inputAttrsNormalizer'; +import * as util from '../util'; + +const _NAME = 'textfield'; +export const NAME = util.getName(_NAME); + +directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME]; +export function directive(resolve, normalizer) { + return { + require: 'E', + template: function(_, attrs) { + normalizer.normalize(attrs); + return resolve.getTemplate(_NAME, attrs); + } + }; +} + +_module.directive(NAME, directive); diff --git a/@salix/core/src/textfield/textfield.mdl.js b/@salix/core/src/textfield/textfield.mdl.js index a8b2554c1..cf8344c77 100644 --- a/@salix/core/src/textfield/textfield.mdl.js +++ b/@salix/core/src/textfield/textfield.mdl.js @@ -1,25 +1,25 @@ -import {module as _module} from '../module'; -import * as util from '../util'; -import * as constant from '../constants'; -import template from './textfield.mdl.html'; - -const _NAME = 'textfield'; -const DEFAULT_LABEL = 'text'; -const DEFAULT_CLASS = 'mdl-textfield__input'; -const DEFAULT_TYPE = 'text'; - -export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK); - -export function factory() { - return { - template: template, - default: { - label: DEFAULT_LABEL, - name: 'textfield', - className: DEFAULT_CLASS, - type: DEFAULT_TYPE - } - } -} - -_module.factory(NAME, factory); +import {module as _module} from '../module'; +import * as util from '../util'; +import * as constant from '../constants'; +import template from './textfield.mdl.html'; + +const _NAME = 'textfield'; +const DEFAULT_LABEL = 'text'; +const DEFAULT_CLASS = 'mdl-textfield__input'; +const DEFAULT_TYPE = 'text'; + +export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK); + +export function factory() { + return { + template: template, + default: { + label: DEFAULT_LABEL, + name: 'textfield', + className: DEFAULT_CLASS, + type: DEFAULT_TYPE + } + }; +} + +_module.factory(NAME, factory); diff --git a/@salix/core/src/util.js b/@salix/core/src/util.js index 5206d3768..75528c1c2 100644 --- a/@salix/core/src/util.js +++ b/@salix/core/src/util.js @@ -1,48 +1,48 @@ -import * as constant from './constants'; - -const FACTORY = 'Factory'; -const SERVICE = 'Service'; -const DEFAULT = 'default'; - -export function getName(name) { - return constant.PREFIX + toUpperCamelCase(name) -} - -export function toUpperCamelCase(stringToConvert){ - return stringToConvert.substr( 0, 1 ).toUpperCase() + stringToConvert.substr( 1 ) -} - -export function getFactoryName(name){ - return getName(name) + FACTORY -} - -export function getServiceName(name){ - return getName(name) + SERVICE -} - -export function getModuleName(name){ - return constant.PREFIX + name; -} - -export function getProviderNameFromConfig(name){ - return getName(name) + 'Provider'; -} - -export function getProviderName(name){ - return getName(name); -} - -export function getTemplateName(componentName,frameworkName){ - return componentName + '.' + frameworkName + '.' + '.html' -} - -export function getVendorDependencies(vendors){ - let dependencies = []; - Object.keys(vendors).forEach((vendor)=>{ - let name = vendors[vendor].name; - if(name){ - dependencies.push(name) - } - }); - return dependencies; -} +import * as constant from './constants'; + +const FACTORY = 'Factory'; +const SERVICE = 'Service'; +const DEFAULT = 'default'; + +export function getName(name) { + return constant.PREFIX + toUpperCamelCase(name); +} + +export function toUpperCamelCase(stringToConvert) { + return stringToConvert.substr(0, 1).toUpperCase() + stringToConvert.substr(1); +} + +export function getFactoryName(name) { + return getName(name) + FACTORY; +} + +export function getServiceName(name) { + return getName(name) + SERVICE; +} + +export function getModuleName(name) { + return constant.PREFIX + name; +} + +export function getProviderNameFromConfig(name) { + return getName(name) + 'Provider'; +} + +export function getProviderName(name) { + return getName(name); +} + +export function getTemplateName(componentName, frameworkName) { + return componentName + '.' + frameworkName + '.html'; +} + +export function getVendorDependencies(vendors) { + let dependencies = []; + Object.keys(vendors).forEach(vendor => { + let name = vendors[vendor].name; + if (name) { + dependencies.push(name); + } + }); + return dependencies; +} From 6e095d61ec4b7b98e5ac21bcb4d4f4ff70c63d29 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Mon, 2 Jan 2017 12:51:40 +0100 Subject: [PATCH 4/6] label overlap textbox --- @salix/core/src/mdl-override.css | 4 ++++ @salix/crud/src/client/basic-data/index.html | 16 ++++++++-------- @salix/package.json | 2 +- @salix/vendor/src/materialdesignlite-vendor.js | 6 +++--- services/nginx/logs/error.log | 4 ++++ 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/@salix/core/src/mdl-override.css b/@salix/core/src/mdl-override.css index fedc64395..a06f49b6d 100644 --- a/@salix/core/src/mdl-override.css +++ b/@salix/core/src/mdl-override.css @@ -19,4 +19,8 @@ .mdl-button--raised:hover { background-color: #ffa410; +} + +.mdl-textfield__label{ + top: 0px; } \ No newline at end of file diff --git a/@salix/crud/src/client/basic-data/index.html b/@salix/crud/src/client/basic-data/index.html index 447c8f0b3..52227af0d 100644 --- a/@salix/crud/src/client/basic-data/index.html +++ b/@salix/crud/src/client/basic-data/index.html @@ -1,20 +1,20 @@
Datos básicos - - + + - - + + - - - + + + - + diff --git a/@salix/package.json b/@salix/package.json index b4e6068db..e9520bc8d 100644 --- a/@salix/package.json +++ b/@salix/package.json @@ -13,7 +13,7 @@ "angular-translate": "^2.13.1", "angular-ui-router": "^1.0.0-beta.3", "express": "^4.14.0", - "material-design-lite": "^1.2.1", + "material-design-lite": "^1.3.0", "oclazyload": "^0.6.3" }, "devDependencies": { diff --git a/@salix/vendor/src/materialdesignlite-vendor.js b/@salix/vendor/src/materialdesignlite-vendor.js index 7765281a9..ef28cb3a7 100644 --- a/@salix/vendor/src/materialdesignlite-vendor.js +++ b/@salix/vendor/src/materialdesignlite-vendor.js @@ -1,4 +1,4 @@ -import * as _materialdesignlite from 'material-design-lite'; -import * as css from 'material-design-lite/material.min.css'; - +import * as _materialdesignlite from 'material-design-lite'; +import * as css from 'material-design-lite/material.min.css'; + export const materialdesignlite = _materialdesignlite; \ No newline at end of file diff --git a/services/nginx/logs/error.log b/services/nginx/logs/error.log index 3b4e114bb..ed37c24e6 100644 --- a/services/nginx/logs/error.log +++ b/services/nginx/logs/error.log @@ -5,3 +5,7 @@ 2016/12/28 14:08:07 [notice] 7984#8980: signal process started 2016/12/28 14:13:33 [notice] 10144#6644: signal process started 2016/12/28 14:44:57 [notice] 3248#9176: signal process started +2017/01/02 09:41:56 [notice] 9224#8900: signal process started +2017/01/02 10:05:09 [notice] 2788#8880: signal process started +2017/01/02 11:46:35 [notice] 8308#7808: signal process started +2017/01/02 12:45:38 [notice] 8064#2328: signal process started From 378b4935a34dacbd508f4b4a578e01188b3f1c59 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Mon, 2 Jan 2017 13:05:24 +0100 Subject: [PATCH 5/6] mdl css --- @salix/core/src/mdl-override.css | 7 +------ services/nginx/logs/error.log | 5 +++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/@salix/core/src/mdl-override.css b/@salix/core/src/mdl-override.css index f33dc4047..b818c4521 100644 --- a/@salix/core/src/mdl-override.css +++ b/@salix/core/src/mdl-override.css @@ -1,4 +1,3 @@ -/* .mdl-textfield { width: 100%; } @@ -19,12 +18,8 @@ .mdl-button--raised:hover { background-color: #ffa410; -<<<<<<< HEAD } .mdl-textfield__label{ top: 0px; -} -======= -}*/ ->>>>>>> 5d9eb50527be872241cb56f77b0e5a7ae2c2026f +} \ No newline at end of file diff --git a/services/nginx/logs/error.log b/services/nginx/logs/error.log index ed37c24e6..a98a714fb 100644 --- a/services/nginx/logs/error.log +++ b/services/nginx/logs/error.log @@ -9,3 +9,8 @@ 2017/01/02 10:05:09 [notice] 2788#8880: signal process started 2017/01/02 11:46:35 [notice] 8308#7808: signal process started 2017/01/02 12:45:38 [notice] 8064#2328: signal process started +2017/01/02 12:58:52 [notice] 6156#4768: signal process started +2017/01/02 12:59:47 [notice] 9624#10876: signal process started +2017/01/02 13:00:51 [notice] 12020#492: signal process started +2017/01/02 13:01:46 [notice] 9952#2156: signal process started +2017/01/02 13:02:34 [notice] 7640#11040: signal process started From 178b41a6ba51aaa270dde9fd428aac6d6f1712a3 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Mon, 2 Jan 2017 13:28:34 +0100 Subject: [PATCH 6/6] mdl css --- @salix/core/src/mdl-override.css | 1 + 1 file changed, 1 insertion(+) diff --git a/@salix/core/src/mdl-override.css b/@salix/core/src/mdl-override.css index b818c4521..c3d1d5f10 100644 --- a/@salix/core/src/mdl-override.css +++ b/@salix/core/src/mdl-override.css @@ -22,4 +22,5 @@ .mdl-textfield__label{ top: 0px; + font-size: 12px; } \ No newline at end of file