From 4c1d9cd7679242392237b511efd5171ee892c346 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 24 Aug 2023 11:32:20 +0200 Subject: [PATCH 1/2] hotFix(priceDifference): import UserError --- modules/ticket/back/methods/ticket/priceDifference.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ticket/back/methods/ticket/priceDifference.js b/modules/ticket/back/methods/ticket/priceDifference.js index 495e9e1aa..7dc85bd3d 100644 --- a/modules/ticket/back/methods/ticket/priceDifference.js +++ b/modules/ticket/back/methods/ticket/priceDifference.js @@ -1,3 +1,5 @@ +const UserError = require('vn-loopback/util/user-error'); + module.exports = Self => { Self.remoteMethodCtx('priceDifference', { description: 'Returns sales with price difference if the ticket is editable', -- 2.40.1 From 7e0865e4b7feb0d1fe7f20b5e726c07c14cdeddd Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 25 Aug 2023 08:01:11 +0200 Subject: [PATCH 2/2] refs #5941 feat(sendToSupport): don't show the button if it doesn't have token --- front/core/components/snackbar/snackbar.js | 2 +- front/core/components/support-dialog/index.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/front/core/components/snackbar/snackbar.js b/front/core/components/snackbar/snackbar.js index 7f4583188..b380c47c3 100644 --- a/front/core/components/snackbar/snackbar.js +++ b/front/core/components/snackbar/snackbar.js @@ -27,7 +27,7 @@ export default class Controller extends Component { setTimeout(() => element.classList.add('shown'), 30); shape.element = element; - if (data.additionalData) { + if (data.additionalData && this.vnToken.token) { this.additionalData = data.additionalData; let supportButton = document.createElement('i'); supportButton.setAttribute('class', 'material-icons clickable'); diff --git a/front/core/components/support-dialog/index.js b/front/core/components/support-dialog/index.js index eaaab047f..d15c14b4a 100644 --- a/front/core/components/support-dialog/index.js +++ b/front/core/components/support-dialog/index.js @@ -7,12 +7,15 @@ export default class Controller extends Dialog { } responseHandler(response) { + if (response !== 'accept') + return super.responseHandler(response); + this.$http.post('Ostickets/send-to-support', { reason: this.reason, additionalData: this.additionalData }) - .then(() => super.responseHandler(response)) - .then(() => this.vnApp.showSuccess(this.$t('Email sended!'))); + .then(() => super.responseHandler(response)) + .then(() => this.vnApp.showSuccess(this.$t('Email sended!'))); } } -- 2.40.1