From 54a835eefdfb1048ceb66ebf36befacade0122db Mon Sep 17 00:00:00 2001 From: Gerard Date: Mon, 25 Feb 2019 09:50:51 +0100 Subject: [PATCH 01/13] added disabled property --- front/core/components/td-editable/index.js | 11 +++++++++-- front/core/components/td-editable/style.scss | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/front/core/components/td-editable/index.js b/front/core/components/td-editable/index.js index a6be8b9b8..502a5e87b 100644 --- a/front/core/components/td-editable/index.js +++ b/front/core/components/td-editable/index.js @@ -11,7 +11,11 @@ export default class Controller extends Component { element.tabIndex = 0; element.addEventListener('focus', () => { - if (this.field) return; + if (this.field || this.disabled) { + console.log(element.style.cursor); + // element.style.cursor = 'none!important'; + return; + } $transclude((tClone, tScope) => { this.field = tClone; this.tScope = tScope; @@ -26,7 +30,7 @@ export default class Controller extends Component { }); element.addEventListener('focusout', event => { - this.destroyTimer(); + if (this.field || this.disabled) return; this.lastEvent = event; let target = event.relatedTarget; while (target && target != element) @@ -57,6 +61,9 @@ Controller.$inject = ['$element', '$scope', '$transclude', '$timeout']; ngModule.component('vnTdEditable', { template: require('./index.html'), controller: Controller, + bindings: { + disabled: ' .text { visibility: hidden; } From 007139f2f68af588dc036c6c295fd8abb4019ae9 Mon Sep 17 00:00:00 2001 From: Gerard Date: Mon, 25 Feb 2019 10:10:44 +0100 Subject: [PATCH 02/13] added disable property --- front/core/components/td-editable/index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/front/core/components/td-editable/index.js b/front/core/components/td-editable/index.js index 502a5e87b..780e6160c 100644 --- a/front/core/components/td-editable/index.js +++ b/front/core/components/td-editable/index.js @@ -11,11 +11,8 @@ export default class Controller extends Component { element.tabIndex = 0; element.addEventListener('focus', () => { - if (this.field || this.disabled) { - console.log(element.style.cursor); - // element.style.cursor = 'none!important'; - return; - } + if (this.field || this.disabled) return; + $transclude((tClone, tScope) => { this.field = tClone; this.tScope = tScope; From a389ca46a29d2c96189e07de3a73b537445fa644 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 25 Feb 2019 11:32:29 +0100 Subject: [PATCH 03/13] calendar offset --- front/core/components/calendar/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/front/core/components/calendar/index.js b/front/core/components/calendar/index.js index de03a70c9..dfc69d837 100644 --- a/front/core/components/calendar/index.js +++ b/front/core/components/calendar/index.js @@ -93,7 +93,7 @@ export default class Calendar extends Component { } applyOffset(date) { - // date.setTime(date.getTime() - date.getTimezoneOffset() * 60000); + date.setTime(date.getTime() - date.getTimezoneOffset() * 60000); } repaint() { @@ -133,11 +133,13 @@ export default class Calendar extends Component { date.getFullYear(), date.getMonth(), day); - this.applyOffset(newDate); let event = this.events.find(event => { return event.date >= newDate && event.date <= newDate; }); + console.log(this.events); + console.log(newDate); + /* if (curDate >= newDate && curDate <= newDate) color = 'orange'; */ From dd4f4e39fbe689c8624e1de6a05c974d7f50fec5 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 25 Feb 2019 11:40:50 +0100 Subject: [PATCH 04/13] date offset --- loopback/server/connectors/vn-mysql.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/loopback/server/connectors/vn-mysql.js b/loopback/server/connectors/vn-mysql.js index efe859a06..051d8738f 100644 --- a/loopback/server/connectors/vn-mysql.js +++ b/loopback/server/connectors/vn-mysql.js @@ -36,6 +36,11 @@ class VnMySQL extends MySQL { return date; } + isIsoDate(dateString) { + let isoRegexp = /^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/g; + return isoRegexp.test(dateString); + } + /** * Promisified version of execute(). * @@ -48,10 +53,12 @@ class VnMySQL extends MySQL { executeP(query, params, options = {}, cb) { if (params) { for (let param of params) { - if (param && typeof param.getMonth === 'function') { + if (param && typeof param.getMonth === 'function' || this.isIsoDate(param)) { + if (this.isIsoDate(param)) param = new Date(param); let locale = new Date(param); let offset = locale.getTimezoneOffset() * 60000; param.setTime(param.getTime() - offset); + console.log(param); } } } From 7a7b2c67d09b8ffa418fcbc7e256a86ee44c1fdd Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 25 Feb 2019 11:55:59 +0100 Subject: [PATCH 05/13] offset changes --- front/core/components/calendar/index.js | 3 ++- loopback/server/connectors/vn-mysql.js | 29 ------------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/front/core/components/calendar/index.js b/front/core/components/calendar/index.js index dfc69d837..99b20c92f 100644 --- a/front/core/components/calendar/index.js +++ b/front/core/components/calendar/index.js @@ -133,14 +133,15 @@ export default class Calendar extends Component { date.getFullYear(), date.getMonth(), day); + this.applyOffset(newDate); let event = this.events.find(event => { return event.date >= newDate && event.date <= newDate; }); + console.log(this.events); console.log(newDate); - /* if (curDate >= newDate && curDate <= newDate) color = 'orange'; */ diff --git a/loopback/server/connectors/vn-mysql.js b/loopback/server/connectors/vn-mysql.js index 051d8738f..3df0878c9 100644 --- a/loopback/server/connectors/vn-mysql.js +++ b/loopback/server/connectors/vn-mysql.js @@ -24,23 +24,6 @@ class VnMySQL extends MySQL { } } - fromColumnValue(prop, val) { - if (val == null || !prop || prop.type !== Date) - return MySQL.prototype.fromColumnValue.call(this, prop, val); - - let date = new Date(val); - let locale = new Date(val); - let offset = locale.getTimezoneOffset() * 60000; - date.setTime(date.getTime() + offset); - - return date; - } - - isIsoDate(dateString) { - let isoRegexp = /^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/g; - return isoRegexp.test(dateString); - } - /** * Promisified version of execute(). * @@ -51,18 +34,6 @@ class VnMySQL extends MySQL { * @return {Promise} The operation promise */ executeP(query, params, options = {}, cb) { - if (params) { - for (let param of params) { - if (param && typeof param.getMonth === 'function' || this.isIsoDate(param)) { - if (this.isIsoDate(param)) param = new Date(param); - let locale = new Date(param); - let offset = locale.getTimezoneOffset() * 60000; - param.setTime(param.getTime() - offset); - console.log(param); - } - } - } - return new Promise((resolve, reject) => { this.execute(query, params, options, (error, response) => { if (cb) From 23ed5e4ddf38f0d27976bb27091c5ff33662958f Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 25 Feb 2019 12:22:04 +0100 Subject: [PATCH 06/13] added offset calendar remove selection --- front/core/components/calendar/index.js | 9 --------- modules/agency/front/calendar/index.js | 5 +---- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/front/core/components/calendar/index.js b/front/core/components/calendar/index.js index 99b20c92f..fbc3932cf 100644 --- a/front/core/components/calendar/index.js +++ b/front/core/components/calendar/index.js @@ -139,15 +139,6 @@ export default class Calendar extends Component { return event.date >= newDate && event.date <= newDate; }); - console.log(this.events); - console.log(newDate); - - /* if (curDate >= newDate && curDate <= newDate) - color = 'orange'; */ - - /* if (newDate.getMonth() === this.currentMonth.getMonth() && newDate.getDay() == 6) - color = 'light-blue'; */ - if (newDate.getMonth() === this.currentMonth.getMonth() && newDate.getDay() == 0) color = 'red'; diff --git a/modules/agency/front/calendar/index.js b/modules/agency/front/calendar/index.js index 64dd5ef84..133d6cdf3 100644 --- a/modules/agency/front/calendar/index.js +++ b/modules/agency/front/calendar/index.js @@ -116,10 +116,7 @@ class Controller { if (event && !event.isRemovable) return false; - // FIXME - Date offset - let date = new Date(day.date); - date.setHours(0, 0, 0, 0); - dates.push(date); + dates.push(day.date); this.stMonth.removeEvent(day.date); this.stMonth.repaint(); From 353cd2110bada8bc55577a8b511c69d9c0d2047d Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 25 Feb 2019 12:52:23 +0100 Subject: [PATCH 07/13] added CET timezone to dockerfile --- .dockerignore | 1 + Dockerfile | 1 + 2 files changed, 2 insertions(+) diff --git a/.dockerignore b/.dockerignore index aaa5f610a..afe81bb0f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ node_modules +print/node_modules front/node_modules services \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 9f203033a..c7565db0c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM debian:stretch-slim +ENV TZ Europe/Madrid ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update \ From b5f29954ed22f5622c48802cd12622bf0da73528 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Mon, 25 Feb 2019 13:07:32 +0100 Subject: [PATCH 08/13] #796 Test front left-menu.js --- front/salix/components/left-menu/left-menu.spec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/front/salix/components/left-menu/left-menu.spec.js b/front/salix/components/left-menu/left-menu.spec.js index 5eb5c8126..93bc96827 100644 --- a/front/salix/components/left-menu/left-menu.spec.js +++ b/front/salix/components/left-menu/left-menu.spec.js @@ -17,6 +17,11 @@ describe('Component vnLeftMenu', () => { ]; })); + it(`should set items in the controller for the left menu`, () => { + expect(controller.items.length).toEqual(3); + expect(controller.items[2].state).toEqual('client.card.summary'); + }); + describe('depth() setter', () => { it(`should set depth property and call activateItem()`, () => { spyOn(controller, 'activateItem'); From 8a137e7713d6394201af84851d7f039f109feb0f Mon Sep 17 00:00:00 2001 From: Gerard Date: Mon, 25 Feb 2019 13:40:53 +0100 Subject: [PATCH 09/13] grouping and packing added --- modules/item/back/methods/item/filter.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/item/back/methods/item/filter.js b/modules/item/back/methods/item/filter.js index b6d4eff59..4f8cbd36e 100644 --- a/modules/item/back/methods/item/filter.js +++ b/modules/item/back/methods/item/filter.js @@ -75,7 +75,8 @@ module.exports = Self => { t.name type, u.id userId, intr.description AS intrastat, i.stems, ori.code AS origin, t.name AS type, - ic.name AS category, i.density, tc.description AS taxClass + ic.name AS category, i.density, tc.description AS taxClass, + b.grouping, b.packing FROM item i JOIN itemType t ON t.id = i.typeFk LEFT JOIN itemCategory ic ON ic.id = t.categoryFk @@ -84,7 +85,9 @@ module.exports = Self => { LEFT JOIN intrastat intr ON intr.id = i.intrastatFk LEFT JOIN producer pr ON pr.id = i.producerFk LEFT JOIN origin ori ON ori.id = i.originFk - LEFT JOIN taxClass tc ON tc.id = i.taxClassFk` + LEFT JOIN taxClass tc ON tc.id = i.taxClassFk + LEFT JOIN cache.last_buy lb ON lb.item_id = i.id AND lb.warehouse_id = t.warehouseFk + LEFT JOIN vn.buy b ON b.id = lb.buy_id` ); if (ctx.args.tags) { From 94e2f933e9983fee68785eefcfeb179a8dd522fa Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 25 Feb 2019 13:41:56 +0100 Subject: [PATCH 10/13] Docker file fix: install print modules --- Dockerfile | 1 + print/package-lock.json | 380 +++++----------------------------------- 2 files changed, 42 insertions(+), 339 deletions(-) diff --git a/Dockerfile b/Dockerfile index c7565db0c..79831cf06 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,7 @@ COPY package.json package-lock.json ./ COPY loopback/package.json loopback/ COPY print/package.json print/ RUN npm install --only=prod +RUN npm --prefix ./print install --only=prod ./print COPY loopback loopback COPY back back diff --git a/print/package-lock.json b/print/package-lock.json index 17866b012..65f4abb6f 100644 --- a/print/package-lock.json +++ b/print/package-lock.json @@ -69,11 +69,6 @@ "tweetnacl": "^0.14.3" } }, - "bluebird": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", - "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==" - }, "boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -82,7 +77,8 @@ "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "optional": true }, "caseless": { "version": "0.12.0", @@ -124,56 +120,6 @@ "lodash.some": "^4.4.0" } }, - "color": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz", - "integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==", - "requires": { - "color-convert": "^1.9.1", - "color-string": "^1.5.2" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "color-string": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz", - "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", - "requires": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, - "colornames": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/colornames/-/colornames-1.1.1.tgz", - "integrity": "sha1-+IiQMGhcfE/54qVZ9Qd+t2qBb5Y=" - }, - "colors": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", - "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==" - }, - "colorspace": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.1.tgz", - "integrity": "sha512-pI3btWyiuz7Ken0BWh9Elzsmv2bM9AhA7psXib4anUXy/orfZ/E0MbQwhSOG/9L8hLlalqrU0UhOuqxW1YjmVw==", - "requires": { - "color": "3.0.x", - "text-hex": "1.0.x" - } - }, "combined-stream": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", @@ -191,6 +137,7 @@ "version": "1.6.2", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "optional": true, "requires": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", @@ -202,6 +149,7 @@ "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "optional": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -216,6 +164,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "optional": true, "requires": { "safe-buffer": "~5.1.0" } @@ -277,6 +226,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "optional": true, "requires": { "ms": "2.0.0" } @@ -296,16 +246,6 @@ "resolved": "https://registry.npmjs.org/denque/-/denque-1.3.0.tgz", "integrity": "sha512-4SRaSj+PqmrS1soW5/Avd7eJIM2JJIqLLmwhRqIGleZM/8KwZq80njbSS2Iqas+6oARkSkLDHEk4mm78q3JlIg==" }, - "diagnostics": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/diagnostics/-/diagnostics-1.1.1.tgz", - "integrity": "sha512-8wn1PmdunLJ9Tqbx+Fx/ZEuHfJf4NKSN2ZBj7SJC/OWRWha843+WsTjqMe1B5E3p28jqBlp+mJ2fPVxPyNgYKQ==", - "requires": { - "colorspace": "1.1.x", - "enabled": "1.0.x", - "kuler": "1.0.x" - } - }, "dom-serializer": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", @@ -353,28 +293,16 @@ "safer-buffer": "^2.1.0" } }, - "enabled": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", - "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", - "requires": { - "env-variable": "0.0.x" - } - }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" }, - "env-variable": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/env-variable/-/env-variable-0.0.5.tgz", - "integrity": "sha512-zoB603vQReOFvTg5xMl9I1P2PnHsHQQKTEowsKKD7nseUfJq6UWzK+4YtlWUO1nhiQUxe6XMkk+JleSZD1NZFA==" - }, "es6-promise": { "version": "4.2.5", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", - "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==" + "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==", + "optional": true }, "escape-string-regexp": { "version": "1.0.5", @@ -390,6 +318,7 @@ "version": "1.6.7", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", "integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=", + "optional": true, "requires": { "concat-stream": "1.6.2", "debug": "2.6.9", @@ -412,24 +341,15 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, - "fast-safe-stringify": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.6.tgz", - "integrity": "sha512-q8BZ89jjc+mz08rSxROs8VsrBBcn1SIw1kq9NjolL509tkABRk9io01RAjSaEv1Xb2uFLt8VtRiZbGp5H8iDtg==" - }, "fd-slicer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", + "optional": true, "requires": { "pend": "~1.2.0" } }, - "fecha": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", - "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==" - }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -507,6 +427,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", "integrity": "sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE=", + "optional": true, "requires": { "is-stream": "^1.0.1", "pinkie-promise": "^2.0.0" @@ -566,11 +487,6 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, - "is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" - }, "is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", @@ -579,7 +495,8 @@ "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "optional": true }, "is-typedarray": { "version": "1.0.0", @@ -589,7 +506,8 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "optional": true }, "isexe": { "version": "2.0.0", @@ -657,24 +575,18 @@ "kew": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", - "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=" + "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=", + "optional": true }, "klaw": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "optional": true, "requires": { "graceful-fs": "^4.1.9" } }, - "kuler": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/kuler/-/kuler-1.0.1.tgz", - "integrity": "sha512-J9nVUucG1p/skKul6DU3PUZrhs0LPulNaeUOox0IyXDi8S4CztTHs1gQphhuZmzXG7VOQSf6NJfKuzteQLv9gQ==", - "requires": { - "colornames": "^1.1.1" - } - }, "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", @@ -772,25 +684,6 @@ "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" }, - "logform": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/logform/-/logform-1.10.0.tgz", - "integrity": "sha512-em5ojIhU18fIMOw/333mD+ZLE2fis0EzXl1ZwHx4iQzmpQi6odNiY/t+ITNr33JZhT9/KEaH+UPIipr6a9EjWg==", - "requires": { - "colors": "^1.2.1", - "fast-safe-stringify": "^2.0.4", - "fecha": "^2.3.3", - "ms": "^2.1.1", - "triple-beam": "^1.2.0" - }, - "dependencies": { - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - } - } - }, "long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", @@ -831,12 +724,14 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "optional": true }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "optional": true, "requires": { "minimist": "0.0.8" } @@ -844,7 +739,8 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "optional": true }, "mysql2": { "version": "1.6.4", @@ -899,16 +795,6 @@ "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" }, - "one-time": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/one-time/-/one-time-0.0.4.tgz", - "integrity": "sha1-+M33eISCb+Tf+T46nMN7HkSAdC4=" - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" - }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", @@ -922,96 +808,19 @@ "pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "optional": true }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, - "phantom": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/phantom/-/phantom-6.0.3.tgz", - "integrity": "sha512-8bb8urWoUiZ0E+JC4goaYBDPxljTnnxGwogz5cvash2SQovf//QAPoshXQz06kY/tpI+5caBVng0K0oZkVMNIQ==", - "requires": { - "phantomjs-prebuilt": "^2.1.16", - "split": "^1.0.1", - "winston": "^3.0.0" - } - }, - "phantom-html2pdf": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/phantom-html2pdf/-/phantom-html2pdf-4.0.1.tgz", - "integrity": "sha512-dnfX4wrYTqyA81dc8/ZKnVQVGXLWPG37G3ynfYJKTDly5rQ5z92Ojr83mMqvutI/jbFP4PLHTKekepZGdsQDmw==", - "requires": { - "async": "^2.6.1", - "bluebird": "^3.4.6", - "debug": "^4.1.1", - "phantomjs-prebuilt": "^2.1.16", - "tmp": "^0.0.33" - }, - "dependencies": { - "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "requires": { - "lodash": "^4.17.10" - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "fs-extra": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", - "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0" - } - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - }, - "phantomjs-prebuilt": { - "version": "2.1.16", - "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz", - "integrity": "sha1-79ISpKOWbTZHaE6ouniFSb4q7+8=", - "requires": { - "es6-promise": "^4.0.3", - "extract-zip": "^1.6.5", - "fs-extra": "^1.0.0", - "hasha": "^2.2.0", - "kew": "^0.7.0", - "progress": "^1.1.8", - "request": "^2.81.0", - "request-progress": "^2.0.1", - "which": "^1.2.10" - } - } - } - }, "phantomjs-prebuilt": { "version": "2.1.16", "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz", "integrity": "sha1-79ISpKOWbTZHaE6ouniFSb4q7+8=", + "optional": true, "requires": { "es6-promise": "^4.0.3", "extract-zip": "^1.6.5", @@ -1028,6 +837,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", + "optional": true, "requires": { "graceful-fs": "^4.1.2", "jsonfile": "^2.1.0", @@ -1038,6 +848,7 @@ "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "optional": true, "requires": { "graceful-fs": "^4.1.6" } @@ -1047,12 +858,14 @@ "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "optional": true }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "optional": true, "requires": { "pinkie": "^2.0.0" } @@ -1060,12 +873,14 @@ "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "optional": true }, "progress": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=" + "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "optional": true }, "pseudomap": { "version": "1.0.2", @@ -1128,6 +943,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-2.0.1.tgz", "integrity": "sha1-XTa7V5YcZzqlt4jbyBQf3yO0Tgg=", + "optional": true, "requires": { "throttleit": "^1.0.0" } @@ -1178,14 +994,6 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" }, - "simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", - "requires": { - "is-arrayish": "^0.3.1" - } - }, "slick": { "version": "1.12.2", "resolved": "https://registry.npmjs.org/slick/-/slick-1.12.2.tgz", @@ -1196,14 +1004,6 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=" }, - "split": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "requires": { - "through": "2" - } - }, "sqlstring": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", @@ -1225,11 +1025,6 @@ "tweetnacl": "~0.14.0" } }, - "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" - }, "strftime": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/strftime/-/strftime-0.10.0.tgz", @@ -1256,28 +1051,11 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" }, - "text-hex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", - "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" - }, "throttleit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", - "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=" - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "requires": { - "os-tmpdir": "~1.0.2" - } + "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=", + "optional": true }, "tough-cookie": { "version": "2.4.3", @@ -1295,11 +1073,6 @@ } } }, - "triple-beam": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", - "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -1316,7 +1089,8 @@ "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "optional": true }, "universalify": { "version": "0.1.2", @@ -1404,79 +1178,6 @@ "isexe": "^2.0.0" } }, - "winston": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.1.0.tgz", - "integrity": "sha512-FsQfEE+8YIEeuZEYhHDk5cILo1HOcWkGwvoidLrDgPog0r4bser1lEIOco2dN9zpDJ1M88hfDgZvxe5z4xNcwg==", - "requires": { - "async": "^2.6.0", - "diagnostics": "^1.1.1", - "is-stream": "^1.1.0", - "logform": "^1.9.1", - "one-time": "0.0.4", - "readable-stream": "^2.3.6", - "stack-trace": "0.0.x", - "triple-beam": "^1.3.0", - "winston-transport": "^4.2.0" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "winston-transport": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.3.0.tgz", - "integrity": "sha512-B2wPuwUi3vhzn/51Uukcao4dIduEiPOcOt9HJ3QeaXgkJ5Z7UwpBzxS4ZGNHtrxrUvTwemsQiSys0ihOf8Mp1A==", - "requires": { - "readable-stream": "^2.3.6", - "triple-beam": "^1.2.0" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", @@ -1491,6 +1192,7 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", + "optional": true, "requires": { "fd-slicer": "~1.0.1" } From 6068ede6ee960e5f09d45462218cc028efc1547a Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 25 Feb 2019 14:02:47 +0100 Subject: [PATCH 11/13] removed offset from agency module --- front/Dockerfile | 1 + front/core/components/calendar/index.js | 12 ---------- loopback/server/connectors/vn-mysql.js | 30 ++++++++++++++++++++++++- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/front/Dockerfile b/front/Dockerfile index d6fe5d4f8..098ee161e 100644 --- a/front/Dockerfile +++ b/front/Dockerfile @@ -1,5 +1,6 @@ FROM debian:stretch-slim EXPOSE 80 +ENV TZ Europe/Madrid ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update \ diff --git a/front/core/components/calendar/index.js b/front/core/components/calendar/index.js index fbc3932cf..cc90846f7 100644 --- a/front/core/components/calendar/index.js +++ b/front/core/components/calendar/index.js @@ -71,8 +71,6 @@ export default class Calendar extends Component { date.getFullYear(), date.getMonth(), 1); - this.applyOffset(newDate); - return newDate; } @@ -87,15 +85,9 @@ export default class Calendar extends Component { date.getFullYear(), date.getMonth() + 1, 0); - this.applyOffset(newDate); - return newDate; } - applyOffset(date) { - date.setTime(date.getTime() - date.getTimezoneOffset() * 60000); - } - repaint() { const firstWeekday = this.firstDay(this.currentMonth).getDay(); const previousLastDay = this.lastDay(this.previousMonth).getDate(); @@ -127,14 +119,10 @@ export default class Calendar extends Component { const curDate = new Date(); curDate.setHours(0, 0, 0, 0); - this.applyOffset(curDate); - const newDate = new Date( date.getFullYear(), date.getMonth(), day); - this.applyOffset(newDate); - let event = this.events.find(event => { return event.date >= newDate && event.date <= newDate; }); diff --git a/loopback/server/connectors/vn-mysql.js b/loopback/server/connectors/vn-mysql.js index 3df0878c9..03418307b 100644 --- a/loopback/server/connectors/vn-mysql.js +++ b/loopback/server/connectors/vn-mysql.js @@ -1,4 +1,3 @@ - const mysql = require('mysql'); const ParameterizedSQL = require('loopback-connector').ParameterizedSQL; const MySQL = require('loopback-connector-mysql').MySQL; @@ -24,6 +23,23 @@ class VnMySQL extends MySQL { } } + fromColumnValue(prop, val) { + if (val == null || !prop || prop.type !== Date) + return MySQL.prototype.fromColumnValue.call(this, prop, val); + + let date = new Date(val); + let locale = new Date(val); + let offset = locale.getTimezoneOffset() * 60000; + date.setTime(date.getTime() + offset); + + return date; + } + + isIsoDate(dateString) { + let isoRegexp = /^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/g; + return isoRegexp.test(dateString); + } + /** * Promisified version of execute(). * @@ -34,6 +50,18 @@ class VnMySQL extends MySQL { * @return {Promise} The operation promise */ executeP(query, params, options = {}, cb) { + if (params) { + for (let param of params) { + if (param && typeof param.getMonth === 'function' || this.isIsoDate(param)) { + if (this.isIsoDate(param)) param = new Date(param); + let locale = new Date(param); + let offset = locale.getTimezoneOffset() * 60000; + param.setTime(param.getTime() - offset); + console.log(param); + } + } + } + return new Promise((resolve, reject) => { this.execute(query, params, options, (error, response) => { if (cb) From 65d844152c6faf44ebb4c7dc77324e30480f29d5 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Mon, 25 Feb 2019 14:11:16 +0100 Subject: [PATCH 12/13] removed a comma --- e2e/helpers/selectors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 1f04c4339..bd850ef3f 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -466,7 +466,7 @@ export default { secondClaimResponsibleAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[field="claimDevelopment.claimResponsibleFk"]', secondClaimWorkerAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[field="claimDevelopment.workerFk"]', secondClaimRedeliveryAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[field="claimDevelopment.claimRedeliveryFk"]', - saveDevelopmentButton: `${components.vnSubmit}`, + saveDevelopmentButton: `${components.vnSubmit}` }, claimAction: { importClaimButton: 'vn-claim-action vn-button[label="Import claim"]', From 4b37b0fc1e5379f9818c7d097effa4b6be601a74 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Mon, 25 Feb 2019 14:55:06 +0100 Subject: [PATCH 13/13] =?UTF-8?q?#1155=20item.index=20a=C3=B1adir=20groupi?= =?UTF-8?q?ng=20y=20packing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/item/front/index/index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/item/front/index/index.html b/modules/item/front/index/index.html index 3b1cc6d22..38bcde738 100644 --- a/modules/item/front/index/index.html +++ b/modules/item/front/index/index.html @@ -22,6 +22,8 @@ Id + Grouping + packing Description Stems Type @@ -53,6 +55,8 @@ {{::item.id | zeroFill:6}} + {{::item.grouping | dashIfEmpty}} + {{::item.packing | dashIfEmpty}}