Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into dev
This commit is contained in:
commit
4709a55b8f
|
@ -93,7 +93,7 @@ export default class Calendar extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
applyOffset(date) {
|
applyOffset(date) {
|
||||||
date.setTime(date.getTime() - date.getTimezoneOffset() * 60000);
|
// date.setTime(date.getTime() - date.getTimezoneOffset() * 60000);
|
||||||
}
|
}
|
||||||
|
|
||||||
repaint() {
|
repaint() {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<div class="textField">
|
<div class="textField">
|
||||||
<div class="leftIcons">
|
<div class="leftIcons">
|
||||||
<vn-icon-button
|
<vn-icon-button
|
||||||
|
ng-if="::$ctrl.step"
|
||||||
icon="remove"
|
icon="remove"
|
||||||
ng-click="$ctrl.remove()"
|
ng-click="$ctrl.remove()"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
|
@ -13,7 +14,7 @@
|
||||||
<input
|
<input
|
||||||
class="mdl-textfield__input"
|
class="mdl-textfield__input"
|
||||||
type="number"
|
type="number"
|
||||||
name="{{$ctrl.name}}"
|
name="{{::$ctrl.name}}"
|
||||||
ng-model="$ctrl.value"
|
ng-model="$ctrl.value"
|
||||||
ng-disabled="$ctrl.disabled"
|
ng-disabled="$ctrl.disabled"
|
||||||
ng-readonly="$ctrl.readonly"
|
ng-readonly="$ctrl.readonly"
|
||||||
|
@ -26,14 +27,15 @@
|
||||||
<div class="selected underline"></div>
|
<div class="selected underline"></div>
|
||||||
<div class="suffix">
|
<div class="suffix">
|
||||||
<vn-icon-button
|
<vn-icon-button
|
||||||
|
ng-if="::$ctrl.step"
|
||||||
icon="add"
|
icon="add"
|
||||||
ng-click="$ctrl.add()"
|
ng-click="$ctrl.add()"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
translate-attr="{title: 'Add'}">
|
translate-attr="{title: 'Add'}">
|
||||||
</vn-icon-button>
|
</vn-icon-button>
|
||||||
<i class="material-icons"
|
<i class="material-icons"
|
||||||
ng-if="$ctrl.hasInfo"
|
ng-if="::$ctrl.hasInfo"
|
||||||
vn-tooltip="{{$ctrl.info}}">
|
vn-tooltip="{{::$ctrl.info}}">
|
||||||
info_outline
|
info_outline
|
||||||
</i>
|
</i>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,7 +3,6 @@ import Textfield from '../textfield/textfield';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
export default class InputNumber extends Textfield {
|
export default class InputNumber extends Textfield {
|
||||||
|
|
||||||
constructor($element, $scope, $attrs, vnTemplate, $transclude) {
|
constructor($element, $scope, $attrs, vnTemplate, $transclude) {
|
||||||
super($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()) ||
|
if ((this.validate() !== undefined && !this.validate()) ||
|
||||||
(this.max && this.value > this.max) ||
|
(this.max && this.value > this.max) ||
|
||||||
(this.min && this.value < this.min) ||
|
(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');
|
this.$element[0].querySelector('.infix').classList.add('invalid', 'validated');
|
||||||
}
|
|
||||||
|
|
||||||
if (this.onChange)
|
if (this.onChange)
|
||||||
this.onChange();
|
this.onChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
add() {
|
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);
|
this.value += (this.step - this.value % this.step);
|
||||||
} else {
|
else
|
||||||
this.value += this.step;
|
this.value += this.step;
|
||||||
}
|
|
||||||
|
|
||||||
this.validateValue();
|
this.validateValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
remove() {
|
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);
|
this.value -= (this.step + this.value % this.step);
|
||||||
} else {
|
else
|
||||||
this.value -= this.step;
|
this.value -= this.step;
|
||||||
}
|
|
||||||
this.validateValue();
|
this.validateValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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().
|
* Promisified version of execute().
|
||||||
*
|
*
|
||||||
|
@ -34,6 +46,16 @@ class VnMySQL extends MySQL {
|
||||||
* @return {Promise} The operation promise
|
* @return {Promise} The operation promise
|
||||||
*/
|
*/
|
||||||
executeP(query, params, options = {}, cb) {
|
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) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.execute(query, params, options, (error, response) => {
|
this.execute(query, params, options, (error, response) => {
|
||||||
if (cb)
|
if (cb)
|
||||||
|
@ -230,11 +252,12 @@ exports.initialize = function initialize(dataSource, callback) {
|
||||||
|
|
||||||
dataSource.EnumFactory = EnumFactory;
|
dataSource.EnumFactory = EnumFactory;
|
||||||
|
|
||||||
if (callback)
|
if (callback) {
|
||||||
if (dataSource.settings.lazyConnect) {
|
if (dataSource.settings.lazyConnect) {
|
||||||
process.nextTick(function() {
|
process.nextTick(function() {
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
} else
|
} else
|
||||||
dataSource.connector.connect(callback);
|
dataSource.connector.connect(callback);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,7 +17,9 @@ class Controller {
|
||||||
this.ndMonth = this.$scope.ndMonth;
|
this.ndMonth = this.$scope.ndMonth;
|
||||||
}
|
}
|
||||||
|
|
||||||
get zone() {
|
// Disabled until implementation
|
||||||
|
// of holidays by node
|
||||||
|
/* get zone() {
|
||||||
return this._zone;
|
return this._zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +43,7 @@ class Controller {
|
||||||
|
|
||||||
this.events = this.events.concat(events);
|
this.events = this.events.concat(events);
|
||||||
});
|
});
|
||||||
}
|
} */
|
||||||
|
|
||||||
get data() {
|
get data() {
|
||||||
return this._data;
|
return this._data;
|
||||||
|
|
|
@ -51,14 +51,12 @@
|
||||||
<vn-input-number vn-one
|
<vn-input-number vn-one
|
||||||
label="Price"
|
label="Price"
|
||||||
field="$ctrl.zone.price"
|
field="$ctrl.zone.price"
|
||||||
min="0.00"
|
min="0.00">
|
||||||
step="0.50">
|
|
||||||
</vn-input-number>
|
</vn-input-number>
|
||||||
<vn-input-number vn-one
|
<vn-input-number vn-one
|
||||||
label="Bonus"
|
label="Bonus"
|
||||||
field="$ctrl.zone.bonus"
|
field="$ctrl.zone.bonus"
|
||||||
min="0.00"
|
min="0.00">
|
||||||
step="0.50">
|
|
||||||
</vn-input-number>
|
</vn-input-number>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
</vn-card>
|
</vn-card>
|
||||||
|
|
|
@ -23,12 +23,13 @@ class Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
onSelection(item, isIncluded) {
|
onSelection(item, isIncluded) {
|
||||||
item.isIncluded = isIncluded;
|
let node = Object.assign({}, item);
|
||||||
const path = '/agency/api/ZoneIncludeds/toggleIsIncluded';
|
node.isIncluded = isIncluded;
|
||||||
const params = {zoneFk: this.zone.id, item};
|
node.childs = []; // Data too large
|
||||||
this.$http.post(path, params).then(() => {
|
|
||||||
|
|
||||||
});
|
const path = '/agency/api/ZoneIncludeds/toggleIsIncluded';
|
||||||
|
const params = {zoneFk: this.zone.id, item: node};
|
||||||
|
this.$http.post(path, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<vn-card>
|
<vn-card>
|
||||||
<vn-horizontal class="catalog-header" pad-medium-h>
|
<vn-horizontal class="catalog-header" pad-medium-h>
|
||||||
<vn-one>
|
<vn-one>
|
||||||
<div> <!-- ng-if="model.moreRows" -->
|
<div ng-if="model.moreRows">
|
||||||
<span translate>More than</span> {{model.limit}} <span translate>results</span>
|
<span translate>More than</span> {{model.limit}} <span translate>results</span>
|
||||||
</div>
|
</div>
|
||||||
</vn-one>
|
</vn-one>
|
||||||
|
|
Loading…
Reference in New Issue