diff --git a/src/composables/showResultsTable.js b/src/composables/showResultsTable.js new file mode 100644 index 000000000..128d7c625 --- /dev/null +++ b/src/composables/showResultsTable.js @@ -0,0 +1,31 @@ +import { useI18n } from 'vue-i18n'; + +import { useQuasar } from 'quasar'; +export function showResultsAsTable() { + const quasar = useQuasar(); + const { t } = useI18n(); + function openTable(dialog, results, tag, action, title) { + quasar.notify({ + message: t('bulkEdit.completed'), + color: 'positive', + actions: [ + { + label: t('bulkEdit.openTable'), + color: 'white', + handler: () => { + quasar.dialog({ + component: dialog, + componentProps: { + title, + results, + tag, + action, + }, + }); + }, + }, + ], + }); + } + return { openTable }; +} diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 9a60e9da1..b508d0be6 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -909,3 +909,8 @@ months: oct: October nov: November dec: December +bulkEdit: + completed: Bulk edit completed + failed: Bulk edit failed + edit: Bulk edit + inProgress: Bulk edit in progress diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 846c442ea..1a46aee70 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -996,3 +996,9 @@ months: oct: Octubre nov: Noviembre dec: Diciembre +bulkEdit: + completed: Edición masiva completada + failed: Edición masiva fallida + edit: Edición masiva + inProgress: Edición masiva en progreso + openTable: Abrir resultados diff --git a/src/pages/Ticket/Card/components/split.js b/src/pages/Ticket/Card/components/split.js index afa1d5cd6..feef6dbb1 100644 --- a/src/pages/Ticket/Card/components/split.js +++ b/src/pages/Ticket/Card/components/split.js @@ -1,6 +1,7 @@ import axios from 'axios'; import notifyResults from 'src/utils/notifyResults'; - +import { showResultsAsTable } from 'src/composables/showResultsTable'; +import HandleSplitDialog from 'src/pages/Ticket/Negative/components/HandleSplitDialog.vue'; export default async function (data, date) { const reducedData = data.reduce((acc, item) => { const existing = acc.find(({ ticketFk }) => ticketFk === item.id); @@ -13,8 +14,10 @@ export default async function (data, date) { }, []); const promises = reducedData.map((params) => axios.post(`Tickets/split`, params)); + const { openTable } = showResultsAsTable(); const results = await Promise.allSettled(promises); + openTable(HandleSplitDialog, result, 'ticketFk', 'changeState'); notifyResults(results, 'ticketFk'); diff --git a/src/pages/Ticket/Negative/TicketLackDetail.vue b/src/pages/Ticket/Negative/TicketLackDetail.vue index dcf835d03..97e19366d 100644 --- a/src/pages/Ticket/Negative/TicketLackDetail.vue +++ b/src/pages/Ticket/Negative/TicketLackDetail.vue @@ -146,7 +146,12 @@ const showItemProposal = () => { @@ -160,7 +165,12 @@ const showItemProposal = () => { @@ -175,7 +185,12 @@ const showItemProposal = () => { diff --git a/src/pages/Ticket/Negative/components/ChangeItemDialog.vue b/src/pages/Ticket/Negative/components/ChangeItemDialog.vue index cc8f391c2..bcba4caf0 100644 --- a/src/pages/Ticket/Negative/components/ChangeItemDialog.vue +++ b/src/pages/Ticket/Negative/components/ChangeItemDialog.vue @@ -1,9 +1,18 @@ + + + + diff --git a/src/pages/Ticket/Negative/components/HandleSplited.vue b/src/pages/Ticket/Negative/components/HandleSplited.vue new file mode 100644 index 000000000..b2bf94f26 --- /dev/null +++ b/src/pages/Ticket/Negative/components/HandleSplited.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/src/pages/Ticket/locale/es.yml b/src/pages/Ticket/locale/es.yml index 75d3c6a2b..03800f6e7 100644 --- a/src/pages/Ticket/locale/es.yml +++ b/src/pages/Ticket/locale/es.yml @@ -286,7 +286,7 @@ negative: title: Gestionar tickets spliteados subTitle: Confir fecha y agencia split: - ticket: Ticket viejo + ticket: Ticket origen newTicket: Ticket nuevo status: Estado message: Mensaje diff --git a/test/cypress/integration/ticket/ticketExpedition.spec.js b/test/cypress/integration/ticket/ticketExpedition.spec.js index d957f2136..db5d3dde5 100644 --- a/test/cypress/integration/ticket/ticketExpedition.spec.js +++ b/test/cypress/integration/ticket/ticketExpedition.spec.js @@ -1,19 +1,18 @@ /// // https://redmine.verdnatura.es/issues/8423 -describe.skip('Ticket expedtion', () => { +describe('Ticket expedtion', () => { const tableContent = '.q-table .q-virtual-scroll__content'; const stateTd = 'td:nth-child(9)'; beforeEach(() => { cy.login('developer'); cy.viewport(1920, 1080); + cy.visit('#/ticket/1/expedition'); }); it('should change the state', () => { - cy.visit('#/ticket/1/expedition'); cy.intercept('GET', /\/api\/Expeditions\/filter/).as('show'); cy.intercept('POST', /\/api\/ExpeditionStates\/addExpeditionState/).as('add'); - cy.wait('@show'); cy.selectRows([1, 2]);