refs #5253 #22

Merged
juan merged 20 commits from test into master 2023-02-23 09:30:53 +00:00
8 changed files with 44 additions and 81 deletions
Showing only changes of commit 17e54cfc60 - Show all commits

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (22.48.4) stable; urgency=low hedera-web (22.48.5) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -150,13 +150,9 @@ export default new Class({
this.$.assistant.moveNext(); this.$.assistant.moveNext();
}, },
goNextStep() {
this.$.assistant.moveNext();
},
onAddressClick(addressId) { onAddressClick(addressId) {
this.$.lot.set('address', addressId); this.$.lot.set('address', addressId);
this.goNextStep(); this.$.assistant.moveNext();
}, },
onAddressChange() { onAddressChange() {

View File

@ -24,21 +24,17 @@ module.exports = new Class({
} }
,async _realPay(amount, company) { ,async _realPay(amount, company) {
if (!isNumeric(amount) || amount <= 0) if (!isNumeric(amount) || amount <= 0) {
throw new UserError(_('AmountError')); Htk.Toast.showError(_('AmountError'));
return;
}
let json; const json = await this.conn.send('tpv/transaction', {
try {
json = await this.conn.send('tpv/transaction', {
amount: parseInt(amount) amount: parseInt(amount)
,urlOk: this._makeUrl('ok') ,urlOk: this._makeUrl('ok')
,urlKo: this._makeUrl('ko') ,urlKo: this._makeUrl('ko')
,company: company ,company
}); });
} catch(err) {
throw new UserError(_('PayError'));
}
const postValues = json.postValues; const postValues = json.postValues;

View File

@ -10,15 +10,7 @@ module.exports = new Class({
value: { value: {
type: String type: String
,set(x) { ,set(x) {
if (Vn.Value.compare(x, this._value)) this._setValue(x);
return;
if (x instanceof Date)
x = x.clone();
this.valueChanged(x);
this.putValue(x);
this._notifyChanges();
} }
,get() { ,get() {
return this._value; return this._value;
@ -109,11 +101,11 @@ module.exports = new Class({
,_lockField: false ,_lockField: false
,_setValue(newValue) { ,_setValue(newValue) {
if (!this._putValue(newValue)) if (!this._putValue(newValue)) return;
return; newValue = this._value;
if (!this._lockField) if (!this._lockField)
this.putValue(newValue); this.putValue(this._value);
if (this.conditionalFunc) if (this.conditionalFunc)
this.conditionalFunc(this, newValue); this.conditionalFunc(this, newValue);

View File

@ -54,7 +54,7 @@ module.exports = new Class({
,render() { ,render() {
var radio = Vn.Browser.createRadio('', this.doc); var radio = Vn.Browser.createRadio('', this.doc);
radio.checked = false; radio.checked = false;
radio.addEventListener('change', this._onChange.bind(this)); radio.addEventListener('change', () => this._onChange());
this._node = radio; this._node = radio;
} }

View File

@ -5,8 +5,6 @@ module.exports = new Class({
Extends: Htk.Field Extends: Htk.Field
,Tag: 'htk-radio-group' ,Tag: 'htk-radio-group'
,radioLock: false
,initialize(props) { ,initialize(props) {
this.clear(); this.clear();
Htk.Field.prototype.initialize.call(this, props); Htk.Field.prototype.initialize.call(this, props);

View File

@ -140,52 +140,33 @@ function sprintf(formatString) {
}); });
} }
module.exports = { function format(value, format) {
regexpNumber: /%\.([0-9]+)d/g
,regexpString: /%s/g
,equals
,diff
,partialDiff
,kvClone
,simpleClone
,simpleEquals
,sprintf
,compare(a, b) {
if (a === b)
return true;
if (a instanceof Date && b instanceof Date)
return a.getTime() === b.getTime();
return false;
}
,format(value, format) {
if (value === null || value === undefined) if (value === null || value === undefined)
return ''; return '';
if (format) if (format)
switch (typeof value) { switch (typeof value) {
case 'number': case 'number':
return format.replace(this.regexpNumber, return format.replace(/%\.([0-9]+)d/g,
this.replaceNumber.bind(null, value)); (_, digits) => new Number(value).toFixed(parseInt(digits)));
case 'string': case 'string':
return format.replace(this.regexpString, return format.replace(/%s/g,
this.replaceString.bind(null, value)); () => value);
case 'object': case 'object':
if (value instanceof Date) if (value instanceof Date)
return VnDate.strftime(value, format); return VnDate.strftime(value, format);
} }
return value; return value;
} }
,replaceNumber(value, token, digits) { module.exports = {
return new Number(value).toFixed(parseInt(digits)); equals,
} diff,
partialDiff,
,replaceString(value) { kvClone,
return value; simpleClone,
} simpleEquals,
sprintf,
format,
}; };

View File

@ -1,6 +1,6 @@
{ {
"name": "hedera-web", "name": "hedera-web",
"version": "22.48.4", "version": "22.48.5",
"description": "Verdnatura web page", "description": "Verdnatura web page",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": { "repository": {