diff --git a/src/boot/quasar.js b/src/boot/quasar.js index b3fb62ee7..5e10bacf1 100644 --- a/src/boot/quasar.js +++ b/src/boot/quasar.js @@ -61,9 +61,6 @@ export default boot(({ app }) => { }, httpRequest: error.request.response, }; - - const isErrorPrivaleges = response?.code == 'ACCESS_DENIED'; - const opts = { actions: [ { @@ -72,36 +69,33 @@ export default boot(({ app }) => { dense: true, flat: false, round: true, - noDismiss: isErrorPrivaleges, handler: async () => { - if (isErrorPrivaleges) { - // Create message and send to support - console.log('QUIERO ACCEDER!!!'); - } else { - const reason = ref(); - openConfirmationModal( - i18n.global.t('globals.sendCau'), - false, - async () => { - await axios.post('OsTickets/send-to-support', { - reason: reason.value, - additionalData, - }); + const reason = ref( + response.data.error.code == 'ACCESS_DENIED' + ? i18n.global.t('cau.askPrivileges') + : '' + ); + openConfirmationModal( + i18n.global.t('cau.title'), + i18n.global.t('cau.subtitle'), + async () => { + await axios.post('OsTickets/send-to-support', { + reason: reason.value, + additionalData, + }); + }, + null, + { + component: VnInput, + props: { + modelValue: reason, + 'onUpdate:modelValue': (val) => (reason.value = val), + label: i18n.global.t('cau.inputLabel'), + class: 'full-width', + required: true, }, - null, - { - component: VnInput, - props: { - modelValue: reason, - 'onUpdate:modelValue': (val) => - (reason.value = val), - label: i18n.global.t('globals.ExplainReason'), - class: 'full-width', - required: true, - }, - } - ); - } + } + ); }, }, ], diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index e0d35d7e7..2eda4ddce 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -317,8 +317,6 @@ globals: deleteConfirmTitle: Delete selected elements changeState: Change state raid: 'Raid {daysInForward} days' - sendCau: Send cau - ExplainReason: Explain why this error should not appear errors: statusUnauthorized: Access denied statusInternalServerError: An internal server error has ocurred @@ -356,6 +354,11 @@ resetPassword: repeatPassword: Repeat password passwordNotMatch: Passwords don't match passwordChanged: Password changed +cau: + title: Send cau + subtitle: By sending this ticket, all the data related to the error, the section, the user, etc., are already sent. + inputLabel: Explain why this error should not appear + askPrivileges: Ask for privileges entry: list: newEntry: New entry diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index ce8a8bf01..af475d27d 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -321,9 +321,6 @@ globals: deleteConfirmTitle: Eliminar los elementos seleccionados changeState: Cambiar estado raid: 'Redada {daysInForward} días' - sendCau: Enviar cau - ExplainReason: Explique el motivo por el que no deberia aparecer este fallo - By sending this ticket, all the data related to the error, the section, the user, etc., are already sent.: Al enviar este cau ya se envían todos los datos relacionados con el error, la sección, el usuario, etc errors: statusUnauthorized: Acceso denegado statusInternalServerError: Ha ocurrido un error interno del servidor @@ -359,6 +356,11 @@ resetPassword: repeatPassword: Repetir contraseña passwordNotMatch: Las contraseñas no coinciden passwordChanged: Contraseña cambiada +cau: + title: Enviar cau + subtitle: Al enviar este cau ya se envían todos los datos relacionados con el error, la sección, el usuario, etc + inputLabel: Explique el motivo por el que no deberia aparecer este fallo + askPrivileges: Solicitar permisos entry: list: newEntry: Nueva entrada