refs #3971 Fixes: Checkout, pay
gitea/hedera-web/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2022-12-09 12:51:51 +01:00
parent e8b727ab6c
commit 87d75be910
8 changed files with 44 additions and 81 deletions

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.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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