diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index f1019e7ae..5efea65a9 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -493,6 +493,11 @@ async function renderInput(rowId, field, clickedElement) { console.log('target: ', event.target); await handleTabKey(event, rowId, field); event.stopPropagation(); + const column = $props.columns.find((col) => col.name === field); + if (typeof column?.beforeDestroy === 'function') + await column.beforeDestroy( + CrudModelRef.value.formData[editingRow.value], + ); break; case 'Escape': console.log('destroyInput 5'); @@ -530,10 +535,6 @@ async function updateSelectValue(value, column, row, oldValue) { } async function destroyInput(rowIndex, field, clickedElement) { - const column = $props.columns.find((col) => col.name === field); - if (typeof column?.beforeDestroy === 'function') - await column.beforeDestroy(CrudModelRef.value.formData[rowIndex]); - if (!clickedElement) clickedElement = document.querySelector( `[data-row-index="${rowIndex}"][data-col-field="${field}"]`, diff --git a/src/pages/Item/ItemList.vue b/src/pages/Item/ItemList.vue index 353f001a3..e6f046722 100644 --- a/src/pages/Item/ItemList.vue +++ b/src/pages/Item/ItemList.vue @@ -282,7 +282,6 @@ const columns = computed(() => [ actions: [ { title: t('globals.clone'), - icon: 'vn:clone', action: openCloneDialog, isPrimary: true, diff --git a/src/pages/Item/ItemRequest.vue b/src/pages/Item/ItemRequest.vue index af3b681c0..1e444a04f 100644 --- a/src/pages/Item/ItemRequest.vue +++ b/src/pages/Item/ItemRequest.vue @@ -158,7 +158,7 @@ const columns = computed(() => [ await tableRef.value.reload(); } catch (error) { notify(error.response.data.error.message, 'negative'); - console.log('error: ', error); + await tableRef.value.reload(); } }, }, @@ -200,6 +200,7 @@ const columns = computed(() => [ { title: t('Discard'), icon: 'thumb_down', + fill: true, isPrimary: true, action: (row) => showDenyRequestForm(row.id), }, diff --git a/test/cypress/integration/item/itemList.spec.js b/test/cypress/integration/item/itemList.spec.js index 337dd12db..fc2a81896 100644 --- a/test/cypress/integration/item/itemList.spec.js +++ b/test/cypress/integration/item/itemList.spec.js @@ -7,7 +7,9 @@ describe('Item list', () => { it('should filter the items and redirect to the summary', () => { cy.selectOption('[data-cy="Category_select"]', 'Plant'); cy.selectOption('[data-cy="Type_select"]', 'Anthurium'); - cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click(); + cy.get('td[data-row-index="0"][data-col-field="description"]') + .should('exist') + .click(); cy.url().should('include', '/summary'); });