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) {
|
||||
date.setTime(date.getTime() - date.getTimezoneOffset() * 60000);
|
||||
// date.setTime(date.getTime() - date.getTimezoneOffset() * 60000);
|
||||
}
|
||||
|
||||
repaint() {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<div class="textField">
|
||||
<div class="leftIcons">
|
||||
<vn-icon-button
|
||||
ng-if="::$ctrl.step"
|
||||
icon="remove"
|
||||
ng-click="$ctrl.remove()"
|
||||
tabindex="-1"
|
||||
|
@ -13,7 +14,7 @@
|
|||
<input
|
||||
class="mdl-textfield__input"
|
||||
type="number"
|
||||
name="{{$ctrl.name}}"
|
||||
name="{{::$ctrl.name}}"
|
||||
ng-model="$ctrl.value"
|
||||
ng-disabled="$ctrl.disabled"
|
||||
ng-readonly="$ctrl.readonly"
|
||||
|
@ -26,14 +27,15 @@
|
|||
<div class="selected underline"></div>
|
||||
<div class="suffix">
|
||||
<vn-icon-button
|
||||
ng-if="::$ctrl.step"
|
||||
icon="add"
|
||||
ng-click="$ctrl.add()"
|
||||
tabindex="-1"
|
||||
translate-attr="{title: 'Add'}">
|
||||
</vn-icon-button>
|
||||
<i class="material-icons"
|
||||
ng-if="$ctrl.hasInfo"
|
||||
vn-tooltip="{{$ctrl.info}}">
|
||||
ng-if="::$ctrl.hasInfo"
|
||||
vn-tooltip="{{::$ctrl.info}}">
|
||||
info_outline
|
||||
</i>
|
||||
</div>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -51,14 +51,12 @@
|
|||
<vn-input-number vn-one
|
||||
label="Price"
|
||||
field="$ctrl.zone.price"
|
||||
min="0.00"
|
||||
step="0.50">
|
||||
min="0.00">
|
||||
</vn-input-number>
|
||||
<vn-input-number vn-one
|
||||
label="Bonus"
|
||||
field="$ctrl.zone.bonus"
|
||||
min="0.00"
|
||||
step="0.50">
|
||||
min="0.00">
|
||||
</vn-input-number>
|
||||
</vn-horizontal>
|
||||
</vn-card>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<vn-card>
|
||||
<vn-horizontal class="catalog-header" pad-medium-h>
|
||||
<vn-one>
|
||||
<div> <!-- ng-if="model.moreRows" -->
|
||||
<div ng-if="model.moreRows">
|
||||
<span translate>More than</span> {{model.limit}} <span translate>results</span>
|
||||
</div>
|
||||
</vn-one>
|
||||
|
|
Loading…
Reference in New Issue