From 45f56078d7939bc793b764d5dae5536fff1be0a4 Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 21 May 2024 01:04:52 +0200 Subject: [PATCH] feat: refs #7187 add vnconfirm on delete --- src/pages/Worker/Card/WorkerPda.vue | 12 +++++++++++- test/cypress/integration/worker/workerPda.spec.js | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/pages/Worker/Card/WorkerPda.vue b/src/pages/Worker/Card/WorkerPda.vue index 06f1e0e80..976469476 100644 --- a/src/pages/Worker/Card/WorkerPda.vue +++ b/src/pages/Worker/Card/WorkerPda.vue @@ -7,6 +7,7 @@ import axios from 'axios'; import useNotify from 'src/composables/useNotify.js'; import FetchData from 'components/FetchData.vue'; import FormModelPopup from 'src/components/FormModelPopup.vue'; +import { useVnConfirm } from 'composables/useVnConfirm'; import VnPaginate from 'src/components/ui/VnPaginate.vue'; import VnRow from 'components/ui/VnRow.vue'; @@ -19,6 +20,7 @@ const { notify } = useNotify(); const paginate = ref(); const dialog = ref(); const route = useRoute(); +const { openConfirmationModal } = useVnConfirm(); const routeId = computed(() => route.params.id); const initialData = computed(() => { @@ -115,7 +117,13 @@ function reloadData() { size="sm" class="cursor-pointer" color="primary" - @click="deallocatePDA(row.deviceProductionFk)" + @click=" + openConfirmationModal( + t(`Remove PDA`), + t('Do you want to remove this PDA?'), + () => deallocatePDA(row.deviceProductionFk) + ) + " > {{ t('worker.pda.removePDA') }} @@ -194,6 +202,8 @@ function reloadData() { es: + Remove PDA: Eliminar PDA + Do you want to remove this PDA?: ¿Desea eliminar este PDA? PDA deallocated: PDA desasignada SIM serial number: Número de serie de la SIM Model: Modelo diff --git a/test/cypress/integration/worker/workerPda.spec.js b/test/cypress/integration/worker/workerPda.spec.js index 79940232b..9af994a70 100644 --- a/test/cypress/integration/worker/workerPda.spec.js +++ b/test/cypress/integration/worker/workerPda.spec.js @@ -16,6 +16,9 @@ describe('WorkerPda', () => { it('delete pda', () => { cy.get('.q-card > .q-item > .q-item__section--side > .q-icon').click(); + cy.get( + '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block' + ).click(); cy.get('.q-notification__message').should('have.text', 'PDA deallocated'); }); });