From c3f20dba3cd6840e95d36c6f8dbe8dddc793b7b2 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 22 Feb 2019 17:23:03 +0100 Subject: [PATCH 1/3] Small fix --- modules/order/front/catalog/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/order/front/catalog/index.html b/modules/order/front/catalog/index.html index 2ad3af2f6..1d834a66c 100644 --- a/modules/order/front/catalog/index.html +++ b/modules/order/front/catalog/index.html @@ -10,7 +10,7 @@ -
+
More than {{model.limit}} results
From ac1e619b060c22ede0e8f71bda9e20861cb9638e Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 25 Feb 2019 10:03:50 +0100 Subject: [PATCH 2/3] fixed zone bugs --- front/core/components/calendar/index.js | 2 +- front/core/components/input-number/index.html | 8 +++++--- front/core/components/input-number/index.js | 17 ++++++++--------- modules/agency/front/calendar/index.js | 6 ++++-- modules/agency/front/create/index.html | 6 ++---- modules/agency/front/location/index.js | 11 ++++++----- 6 files changed, 26 insertions(+), 24 deletions(-) diff --git a/front/core/components/calendar/index.js b/front/core/components/calendar/index.js index 62b28b03b..de03a70c9 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() { diff --git a/front/core/components/input-number/index.html b/front/core/components/input-number/index.html index 894844375..3ff74a116 100644 --- a/front/core/components/input-number/index.html +++ b/front/core/components/input-number/index.html @@ -3,6 +3,7 @@
+ ng-if="::$ctrl.hasInfo" + vn-tooltip="{{::$ctrl.info}}"> info_outline
diff --git a/front/core/components/input-number/index.js b/front/core/components/input-number/index.js index e554c2e5d..f91fac2e7 100644 --- a/front/core/components/input-number/index.js +++ b/front/core/components/input-number/index.js @@ -3,7 +3,6 @@ import Textfield from '../textfield/textfield'; import './style.scss'; export default class InputNumber extends Textfield { - constructor($element, $scope, $attrs, vnTemplate, $transclude) { super($element, $scope, $attrs, vnTemplate, $transclude); @@ -56,30 +55,30 @@ export default class InputNumber extends Textfield { if ((this.validate() !== undefined && !this.validate()) || (this.max && this.value > this.max) || (this.min && this.value < this.min) || - (this.step && this.value % this.step != 0)) { + (this.step && this.value % this.step != 0)) this.$element[0].querySelector('.infix').classList.add('invalid', 'validated'); - } + if (this.onChange) this.onChange(); } add() { - if (this.step && this.value % this.step != 0) { + if (this.step && this.value % this.step != 0) this.value += (this.step - this.value % this.step); - } else { + else this.value += this.step; - } + this.validateValue(); } remove() { - if (this.step && this.value % this.step != 0) { + if (this.step && this.value % this.step != 0) this.value -= (this.step + this.value % this.step); - } else { + else this.value -= this.step; - } + this.validateValue(); } } diff --git a/modules/agency/front/calendar/index.js b/modules/agency/front/calendar/index.js index 81b07dafe..64dd5ef84 100644 --- a/modules/agency/front/calendar/index.js +++ b/modules/agency/front/calendar/index.js @@ -17,7 +17,9 @@ class Controller { this.ndMonth = this.$scope.ndMonth; } - get zone() { + // Disabled until implementation + // of holidays by node + /* get zone() { return this._zone; } @@ -41,7 +43,7 @@ class Controller { this.events = this.events.concat(events); }); - } + } */ get data() { return this._data; diff --git a/modules/agency/front/create/index.html b/modules/agency/front/create/index.html index 43575d179..4a4237fd9 100644 --- a/modules/agency/front/create/index.html +++ b/modules/agency/front/create/index.html @@ -51,14 +51,12 @@ + min="0.00"> + min="0.00"> diff --git a/modules/agency/front/location/index.js b/modules/agency/front/location/index.js index 00b0159ec..9a28fd3d1 100644 --- a/modules/agency/front/location/index.js +++ b/modules/agency/front/location/index.js @@ -23,12 +23,13 @@ class Controller { } onSelection(item, isIncluded) { - item.isIncluded = isIncluded; - const path = '/agency/api/ZoneIncludeds/toggleIsIncluded'; - const params = {zoneFk: this.zone.id, item}; - this.$http.post(path, params).then(() => { + let node = Object.assign({}, item); + node.isIncluded = isIncluded; + node.childs = []; // Data too large - }); + const path = '/agency/api/ZoneIncludeds/toggleIsIncluded'; + const params = {zoneFk: this.zone.id, item: node}; + this.$http.post(path, params); } } From 5ec352b71a198936e1fefc1d8dc6efd394e6a19c Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 25 Feb 2019 10:04:11 +0100 Subject: [PATCH 3/3] fixed vn-mysql time offset --- loopback/server/connectors/vn-mysql.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/loopback/server/connectors/vn-mysql.js b/loopback/server/connectors/vn-mysql.js index dee523be7..efe859a06 100644 --- a/loopback/server/connectors/vn-mysql.js +++ b/loopback/server/connectors/vn-mysql.js @@ -24,6 +24,18 @@ 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; + } + /** * Promisified version of execute(). * @@ -34,6 +46,16 @@ 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') { + let locale = new Date(param); + let offset = locale.getTimezoneOffset() * 60000; + param.setTime(param.getTime() - offset); + } + } + } + return new Promise((resolve, reject) => { this.execute(query, params, options, (error, response) => { if (cb) @@ -230,11 +252,12 @@ exports.initialize = function initialize(dataSource, callback) { dataSource.EnumFactory = EnumFactory; - if (callback) + if (callback) { if (dataSource.settings.lazyConnect) { process.nextTick(function() { callback(); }); } else dataSource.connector.connect(callback); + } };