From ac1e619b060c22ede0e8f71bda9e20861cb9638e Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 25 Feb 2019 10:03:50 +0100 Subject: [PATCH] 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); } }