From ac8e9cbfd25e2391627943e0ab50990438886b87 Mon Sep 17 00:00:00 2001 From: jtubau <jtubau@verdnatura.es> Date: Wed, 29 Jan 2025 12:43:02 +0100 Subject: [PATCH 01/14] refactor: refs #7414 update VnLog component to change display order value changes on update action --- src/components/common/VnLog.vue | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index fdf2e52ee..d1d8d8360 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -641,16 +641,7 @@ watch( > {{ prop.nameI18n }}: </span> - <VnJsonValue :value="prop.val.val" /> - <span - v-if="prop.val.id" - class="id-value" - > - #{{ prop.val.id }} - </span> - <span v-if="log.action == 'update'"> - ← - <VnJsonValue + <VnJsonValue :value="prop.old.val" /> <span @@ -659,6 +650,15 @@ watch( > #{{ prop.old.id }} </span> + <span v-if="log.action == 'update'"> + → + <VnJsonValue :value="prop.val.val" /> + <span + v-if="prop.val.id" + class="id-value" + > + #{{ prop.val.id }} + </span> </span> </div> </span> From 3172ce8cecad5659239f2c7f66e4f86f43dff21b Mon Sep 17 00:00:00 2001 From: jtubau <jtubau@verdnatura.es> Date: Mon, 10 Feb 2025 09:40:43 +0100 Subject: [PATCH 02/14] fix: refs #7414 updated default value rendering for non-update scenarios --- src/components/common/VnLog.vue | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index a90766c84..5a70edf6c 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -641,24 +641,20 @@ watch( > {{ prop.nameI18n }}: </span> - <VnJsonValue - :value="prop.old.val" - /> - <span - v-if="prop.old.id" - class="id-value" - > - #{{ prop.old.id }} - </span> <span v-if="log.action == 'update'"> + <VnJsonValue :value="prop.old.val" /> + <span v-if="prop.old.id" class="id-value"> + #{{ prop.old.id }} + </span> → <VnJsonValue :value="prop.val.val" /> - <span - v-if="prop.val.id" - class="id-value" - > - #{{ prop.val.id }} + <span v-if="prop.val.id" class="id-value"> + #{{ prop.val.id }} + </span> </span> + <span v-else="prop.old.val"> + <VnJsonValue :value="prop.val.val" /> + <span v-if="prop.old.id" class="id-value">#{{ prop.old.id }}</span> </span> </div> </span> From 12aeb63f27ad9e10e844a55a8bee4b5396db249e Mon Sep 17 00:00:00 2001 From: jtubau <jtubau@verdnatura.es> Date: Wed, 12 Feb 2025 12:27:57 +0100 Subject: [PATCH 03/14] fix: refs #7414 update VnLog.vue to correctly display log actions and values --- src/components/common/VnLog.vue | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index a90766c84..8f106a9f1 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -641,7 +641,8 @@ watch( > {{ prop.nameI18n }}: </span> - <VnJsonValue + <span v-if="log.action == 'update'"> + <VnJsonValue :value="prop.old.val" /> <span @@ -650,15 +651,26 @@ watch( > #{{ prop.old.id }} </span> - <span v-if="log.action == 'update'"> → - <VnJsonValue :value="prop.val.val" /> - <span - v-if="prop.val.id" - class="id-value" - > - #{{ prop.val.id }} + <VnJsonValue + :value="prop.val.val" + /> + <span + v-if="prop.val.id" + class="id-value" + > + #{{ prop.val.id }} + </span> </span> + <span v-else="prop.old.val"> + <VnJsonValue + :value="prop.val.val" + /> + <span + v-if="prop.old.id" + class="id-value" + >#{{ prop.old.id }}</span + > </span> </div> </span> From faa245899708a0cb01b06b532d400b11b6b8243e Mon Sep 17 00:00:00 2001 From: jtubau <jtubau@verdnatura.es> Date: Fri, 21 Feb 2025 12:02:38 +0100 Subject: [PATCH 04/14] test: refs #8594 add vehicle summary component and integration tests for vehicle list functionality --- .../Route/Vehicle/Card/VehicleSummary.vue | 7 ++- .../route/vehicle/vehicleList.spec.js | 58 +++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 test/cypress/integration/route/vehicle/vehicleList.spec.js diff --git a/src/pages/Route/Vehicle/Card/VehicleSummary.vue b/src/pages/Route/Vehicle/Card/VehicleSummary.vue index 981870cb2..e4b0a9497 100644 --- a/src/pages/Route/Vehicle/Card/VehicleSummary.vue +++ b/src/pages/Route/Vehicle/Card/VehicleSummary.vue @@ -22,7 +22,12 @@ const links = { }; </script> <template> - <CardSummary data-key="Vehicle" :url="`Vehicles/${entityId}`" :filter="VehicleFilter"> + <CardSummary + data-key="Vehicle" + :url="`Vehicles/${entityId}`" + module-name="Vehicle" + :filter="VehicleFilter" + > <template #header="{ entity }"> <div>{{ entity.id }} - {{ entity.numberPlate }}</div> </template> diff --git a/test/cypress/integration/route/vehicle/vehicleList.spec.js b/test/cypress/integration/route/vehicle/vehicleList.spec.js new file mode 100644 index 000000000..e633b2fa2 --- /dev/null +++ b/test/cypress/integration/route/vehicle/vehicleList.spec.js @@ -0,0 +1,58 @@ +describe('Vehicle list', () => { + const selectors = { + saveFormBtn: 'FormModelPopup_save', + summaryPopupBtn: 'tr:last-child > .q-table--col-auto-width > .q-btn', + summaryGoToSummaryBtn: '.header > .q-icon', + summaryHeader: '.summaryHeader > div', + numberPlate: 'tr:last-child > [data-col-field="numberPlate"] > .no-padding', + }; + + const data = { + 'Nº Plate': { val: '9465-LPA' }, + 'Trade Mark': { val: 'WAYNE INDUSTRIES' }, + Model: { val: 'BATREMOLQUE' }, + Type: { val: 'remolque', type: 'select' }, + Warehouse: { val: 'Warehouse One', type: 'select' }, + Country: { val: 'Portugal', type: 'select' }, + Description: { val: 'Exclusive for batpod transport' }, + }; + + const summaryUrl = '/summary'; + + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('developer'); + cy.visit(`/#/route/vehicle/list`); + cy.typeSearchbar('{enter}'); + }); + + it('should list vehicles', () => { + cy.get('.q-table') + .children() + .should('be.visible') + .should('have.length.greaterThan', 0); + }); + + it('Should add new vehicle', () => { + cy.addBtnClick(); + cy.fillInForm(data); + cy.dataCy(selectors.saveFormBtn).should('be.visible').click(); + + cy.checkNotification('Data created'); + cy.get(selectors.summaryHeader).should('contain', data['Nº Plate'].val); + cy.url().should('include', summaryUrl); + }); + + it('should open summary by clicking a vehicle', () => { + cy.get(selectors.numberPlate).click(); + cy.get(selectors.summaryHeader).should('contain', data['Nº Plate'].val); + cy.url().should('include', summaryUrl); + }); + + it('should redirect to vehicle summary when click summary icon on summary pop-up', () => { + cy.get(selectors.summaryPopupBtn).click(); + cy.get(selectors.summaryHeader).should('contain', data['Nº Plate'].val); + cy.get(selectors.summaryGoToSummaryBtn).click(); + cy.url().should('include', summaryUrl); + }); +}); From 70c2f6b2b06a779aed5fcf1067579af3cac71541 Mon Sep 17 00:00:00 2001 From: jtubau <jtubau@verdnatura.es> Date: Wed, 26 Feb 2025 12:33:35 +0100 Subject: [PATCH 05/14] refactor: refs #8594 update vehicle summary tests to use expected variable for consistency --- test/cypress/integration/route/vehicle/vehicleList.spec.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/cypress/integration/route/vehicle/vehicleList.spec.js b/test/cypress/integration/route/vehicle/vehicleList.spec.js index e633b2fa2..2b3c9cdbc 100644 --- a/test/cypress/integration/route/vehicle/vehicleList.spec.js +++ b/test/cypress/integration/route/vehicle/vehicleList.spec.js @@ -17,6 +17,7 @@ describe('Vehicle list', () => { Description: { val: 'Exclusive for batpod transport' }, }; + const expected = data['Nº Plate'].val; const summaryUrl = '/summary'; beforeEach(() => { @@ -39,19 +40,19 @@ describe('Vehicle list', () => { cy.dataCy(selectors.saveFormBtn).should('be.visible').click(); cy.checkNotification('Data created'); - cy.get(selectors.summaryHeader).should('contain', data['Nº Plate'].val); + cy.get(selectors.summaryHeader).should('contain', expected); cy.url().should('include', summaryUrl); }); it('should open summary by clicking a vehicle', () => { cy.get(selectors.numberPlate).click(); - cy.get(selectors.summaryHeader).should('contain', data['Nº Plate'].val); + cy.get(selectors.summaryHeader).should('contain', expected); cy.url().should('include', summaryUrl); }); it('should redirect to vehicle summary when click summary icon on summary pop-up', () => { cy.get(selectors.summaryPopupBtn).click(); - cy.get(selectors.summaryHeader).should('contain', data['Nº Plate'].val); + cy.get(selectors.summaryHeader).should('contain', expected); cy.get(selectors.summaryGoToSummaryBtn).click(); cy.url().should('include', summaryUrl); }); From 8cf4d36f47707cb018a33bfd98aa338a41f14cb9 Mon Sep 17 00:00:00 2001 From: pablone <pablone@verdnatura.es> Date: Fri, 28 Feb 2025 12:55:15 +0100 Subject: [PATCH 06/14] refactor: refs #6897 update component props and improve UI handling in Entry pages --- src/pages/Entry/Card/EntryBuys.vue | 3 +- src/pages/Entry/EntryFilter.vue | 2 +- src/pages/Entry/EntryStockBought.vue | 46 +++++++---------- src/pages/Entry/EntryStockBoughtDetail.vue | 2 +- src/pages/Item/Card/ItemDiary.vue | 12 +++-- src/pages/Item/Card/ItemLastEntries.vue | 57 ++++++++++++++++------ 6 files changed, 72 insertions(+), 50 deletions(-) diff --git a/src/pages/Entry/Card/EntryBuys.vue b/src/pages/Entry/Card/EntryBuys.vue index 67333b5bd..401f5c793 100644 --- a/src/pages/Entry/Card/EntryBuys.vue +++ b/src/pages/Entry/Card/EntryBuys.vue @@ -61,9 +61,10 @@ const columns = [ name: 'workerFk', component: 'select', attrs: { - url: 'Workers/search', + url: 'TicketRequests/getItemTypeWorker', fields: ['id', 'nickname'], optionLabel: 'nickname', + sortBy: 'nickname ASC', optionValue: 'id', }, visible: false, diff --git a/src/pages/Entry/EntryFilter.vue b/src/pages/Entry/EntryFilter.vue index 8c60918a8..6bce6aa04 100644 --- a/src/pages/Entry/EntryFilter.vue +++ b/src/pages/Entry/EntryFilter.vue @@ -248,7 +248,7 @@ const entryFilterPanel = ref(); <i18n> en: params: - isExcludedFromAvailable: Inventory + isExcludedFromAvailable: Is excluded isOrdered: Ordered isReceived: Received isConfirmed: Confirmed diff --git a/src/pages/Entry/EntryStockBought.vue b/src/pages/Entry/EntryStockBought.vue index 4bd0fe640..41f78617c 100644 --- a/src/pages/Entry/EntryStockBought.vue +++ b/src/pages/Entry/EntryStockBought.vue @@ -19,6 +19,7 @@ const { t } = useI18n(); const quasar = useQuasar(); const state = useState(); const user = state.getUser(); +const footer = ref({ bought: 0, reserve: 0 }); const columns = computed(() => [ { align: 'left', @@ -38,16 +39,14 @@ const columns = computed(() => [ cardVisible: true, create: true, attrs: { - url: 'Workers/activeWithInheritedRole', - fields: ['id', 'name', 'nickname'], - where: { role: 'buyer' }, - optionFilter: 'firstName', + url: 'TicketRequests/getItemTypeWorker', + fields: ['id', 'nickname'], optionLabel: 'nickname', + sortBy: 'nickname ASC', optionValue: 'id', - useLike: false, }, columnFilter: false, - width: '70px', + width: '50px', }, { align: 'center', @@ -58,6 +57,7 @@ const columns = computed(() => [ component: 'number', summation: true, width: '50px', + format: ({ reserve }, dashIfEmpty) => dashIfEmpty(round(reserve)), }, { align: 'center', @@ -65,6 +65,7 @@ const columns = computed(() => [ name: 'bought', summation: true, cardVisible: true, + style: ({ reserve, bought }) => boughtStyle(bought, reserve), columnFilter: false, }, { @@ -95,7 +96,6 @@ const columns = computed(() => [ }, }, ], - 'data-cy': 'table-actions', }, ]); @@ -137,20 +137,20 @@ function openDialog() { } function setFooter(data) { - const footer = { - bought: 0, - reserve: 0, - }; + footer.value = { bought: 0, reserve: 0 }; data.forEach((row) => { - footer.bought += row?.bought; - footer.reserve += row?.reserve; + footer.value.bought += row?.bought; + footer.value.reserve += row?.reserve; }); - tableRef.value.footer = footer; } function round(value) { return Math.round(value * 100) / 100; } + +function boughtStyle(bought, reserve) { + return reserve < bought ? { color: 'var(--q-negative)' } : ''; +} </script> <template> <VnSubToolbar> @@ -253,24 +253,14 @@ function round(value) { <WorkerDescriptorProxy :id="row?.workerFk" /> </span> </template> - <template #column-bought="{ row }"> - <span :class="{ 'text-negative': row.reserve < row.bought }"> - {{ row?.bought }} - </span> - </template> <template #column-footer-reserve> <span> - {{ round(tableRef.footer.reserve) }} + {{ round(footer.reserve) }} </span> </template> <template #column-footer-bought> - <span - :class="{ - 'text-negative': - tableRef.footer.reserve < tableRef.footer.bought, - }" - > - {{ round(tableRef.footer.bought) }} + <span :style="boughtStyle(footer?.bought, footer?.reserve)"> + {{ round(footer.bought) }} </span> </template> </VnTable> @@ -286,7 +276,7 @@ function round(value) { justify-content: center; } .column { - min-width: 40%; + min-width: 35%; margin-top: 5%; display: flex; flex-direction: column; diff --git a/src/pages/Entry/EntryStockBoughtDetail.vue b/src/pages/Entry/EntryStockBoughtDetail.vue index 1a37994d9..4f002ecb9 100644 --- a/src/pages/Entry/EntryStockBoughtDetail.vue +++ b/src/pages/Entry/EntryStockBoughtDetail.vue @@ -14,7 +14,7 @@ const $props = defineProps({ required: true, }, dated: { - type: Date, + type: [Date, String], required: true, }, }); diff --git a/src/pages/Item/Card/ItemDiary.vue b/src/pages/Item/Card/ItemDiary.vue index 31b3c328e..b63a13423 100644 --- a/src/pages/Item/Card/ItemDiary.vue +++ b/src/pages/Item/Card/ItemDiary.vue @@ -12,7 +12,7 @@ import FetchData from 'components/FetchData.vue'; import VnSelect from 'src/components/common/VnSelect.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue'; -import { toDateFormat } from 'src/filters/date.js'; +import { toDateTimeFormat } from 'src/filters/date.js'; import { dashIfEmpty } from 'src/filters'; import { date } from 'quasar'; import { useState } from 'src/composables/useState'; @@ -143,7 +143,12 @@ onMounted(async () => { const fetchItemBalances = async () => await arrayDataItemBalances.fetch({}); const getBadgeAttrs = (_date) => { - const isSameDate = date.isSameDate(today, _date); + let today = Date.vnNew(); + today.setHours(0, 0, 0, 0); + let timeTicket = new Date(_date); + timeTicket.setHours(0, 0, 0, 0); + + const isSameDate = date.isSameDate(today, timeTicket); const attrs = { 'text-color': isSameDate ? 'black' : 'white', color: isSameDate ? 'warning' : 'transparent', @@ -153,6 +158,7 @@ const getBadgeAttrs = (_date) => { const scrollToToday = async () => { await nextTick(); + console.log('today.toISOString(): ', today.toISOString()); const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`); if (todayCell) { todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' }); @@ -244,7 +250,7 @@ async function updateWarehouse(warehouseFk) { dense style="font-size: 14px" > - {{ toDateFormat(row.shipped) }} + {{ toDateTimeFormat(row.shipped) }} </QBadge> </QTd> </template> diff --git a/src/pages/Item/Card/ItemLastEntries.vue b/src/pages/Item/Card/ItemLastEntries.vue index 7d8890c2b..1eaaa931f 100644 --- a/src/pages/Item/Card/ItemLastEntries.vue +++ b/src/pages/Item/Card/ItemLastEntries.vue @@ -11,7 +11,6 @@ import { toCurrency } from 'filters/index'; import { useArrayData } from 'composables/useArrayData'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue'; - const { t } = useI18n(); const route = useRoute(); const from = ref(); @@ -41,7 +40,7 @@ const itemLastEntries = ref([]); const columns = computed(() => [ { - label: 'Nv', + label: 'NV', name: 'ig', align: 'center', }, @@ -70,6 +69,7 @@ const columns = computed(() => [ field: 'reference', align: 'center', format: (_, row) => toCurrency(row.price2) + ' / ' + toCurrency(row.price3), + style: (row) => highlightedRow(row), }, { label: t('lastEntries.printedStickers'), @@ -84,6 +84,7 @@ const columns = computed(() => [ field: 'stickers', align: 'center', format: (val) => dashIfEmpty(val), + style: (row) => highlightedRow(row), }, { label: 'Packing', @@ -102,12 +103,14 @@ const columns = computed(() => [ name: 'stems', field: 'stems', align: 'center', + style: (row) => highlightedRow(row), }, { label: t('lastEntries.quantity'), name: 'quantity', field: 'quantity', align: 'center', + style: (row) => highlightedRow(row), }, { label: t('lastEntries.cost'), @@ -120,12 +123,14 @@ const columns = computed(() => [ name: 'weight', field: 'weight', align: 'center', + style: (row) => highlightedRow(row), }, { label: t('lastEntries.cube'), name: 'cube', field: 'packagingFk', align: 'center', + style: (row) => highlightedRow(row), }, { label: t('lastEntries.supplier'), @@ -203,11 +208,28 @@ onMounted(async () => { if (nTo && nTo != oTo) nTo = getDate(new Date(nTo), 'to'); updateFilter(); }); + + const rows = document.querySelectorAll('tr'); + console.log('rows: ', rows); + rows.forEach((row) => { + const td = row.querySelector('td[data-is-inventory="1"]'); + if (td) { + row.classList.add('inventory-row'); + } + }); }); function getBadgeClass(groupingMode, expectedGrouping) { return groupingMode === expectedGrouping ? 'accent-badge' : 'simple-badge'; } + +function highlightedRow(row) { + return row?.isInventorySupplier + ? { + 'background-color': 'var(--vn-section-hover-color)', + } + : ''; +} </script> <template> <VnSubToolbar> @@ -236,7 +258,7 @@ function getBadgeClass(groupingMode, expectedGrouping) { :no-data-label="t('globals.noResults')" > <template #body-cell-ig="{ row }"> - <QTd class="text-center"> + <QTd class="text-center" :style="highlightedRow(row)"> <QIcon :name="row.isIgnored ? 'check_box' : 'check_box_outline_blank'" style="color: var(--vn-label-color)" @@ -245,38 +267,38 @@ function getBadgeClass(groupingMode, expectedGrouping) { </QTd> </template> <template #body-cell-warehouse="{ row }"> - <QTd> + <QTd :style="highlightedRow(row)"> <span>{{ row.warehouse }}</span> </QTd> </template> <template #body-cell-date="{ row }"> - <QTd class="text-center"> + <QTd class="text-center" :style="highlightedRow(row)"> <VnDateBadge :date="row.landed" /> </QTd> </template> <template #body-cell-entry="{ row }"> - <QTd @click.stop> + <QTd @click.stop :style="highlightedRow(row)"> <div class="full-width flex justify-center"> <EntryDescriptorProxy :id="row.entryFk" class="q-ma-none" dense /> <span class="link">{{ row.entryFk }}</span> </div> </QTd> </template> - <template #body-cell-pvp="{ value }"> - <QTd @click.stop class="text-center"> + <template #body-cell-pvp="{ row, value }"> + <QTd @click.stop class="text-center" :style="highlightedRow(row)"> <span> {{ value }}</span> - <QTooltip> {{ t('lastEntries.grouping') }}/Packing </QTooltip></QTd - > + <QTooltip> {{ t('lastEntries.grouping') }}/Packing </QTooltip> + </QTd> </template> <template #body-cell-printedStickers="{ row }"> - <QTd @click.stop class="text-center"> + <QTd @click.stop class="text-center" :style="highlightedRow(row)"> <span style="color: var(--vn-label-color)"> {{ row.printedStickers }}</span > </QTd> </template> <template #body-cell-packing="{ row }"> - <QTd @click.stop> + <QTd @click.stop :style="highlightedRow(row)"> <QBadge class="center-content" :class="getBadgeClass(row.groupingMode, 'packing')" @@ -288,7 +310,7 @@ function getBadgeClass(groupingMode, expectedGrouping) { </QTd> </template> <template #body-cell-grouping="{ row }"> - <QTd @click.stop> + <QTd @click.stop :style="highlightedRow(row)"> <QBadge class="center-content" :class="getBadgeClass(row.groupingMode, 'grouping')" @@ -300,7 +322,7 @@ function getBadgeClass(groupingMode, expectedGrouping) { </QTd> </template> <template #body-cell-cost="{ row }"> - <QTd @click.stop class="text-center"> + <QTd @click.stop class="text-center" :style="highlightedRow(row)"> <span> {{ toCurrency(row.cost, 'EUR', 3) }} <QTooltip> @@ -319,7 +341,7 @@ function getBadgeClass(groupingMode, expectedGrouping) { </QTd> </template> <template #body-cell-supplier="{ row }"> - <QTd @click.stop> + <QTd @click.stop :style="highlightedRow(row)"> <div class="full-width flex justify-left"> <QBadge :class=" @@ -341,6 +363,10 @@ function getBadgeClass(groupingMode, expectedGrouping) { Hide inventory supplier: Ocultar proveedor inventario </i18n> <style lang="scss" scoped> +.inventory-row { + background-color: #f0f0f0; /* Cambia el color de fondo o cualquier otro estilo */ +} + .q-badge--rounded { border-radius: 50%; } @@ -354,7 +380,6 @@ function getBadgeClass(groupingMode, expectedGrouping) { .th :first-child { .td { text-align: center; - background-color: red; } } .accent-badge { From 61aa750ae0f64b471f9ac30b52de3b1c8fe56bb3 Mon Sep 17 00:00:00 2001 From: pablone <pablone@verdnatura.es> Date: Fri, 28 Feb 2025 13:00:15 +0100 Subject: [PATCH 07/14] refactor: refs #6897 remove debug logs and unused style --- src/pages/Item/Card/ItemDiary.vue | 1 - src/pages/Item/Card/ItemLastEntries.vue | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/src/pages/Item/Card/ItemDiary.vue b/src/pages/Item/Card/ItemDiary.vue index b63a13423..83cd562a0 100644 --- a/src/pages/Item/Card/ItemDiary.vue +++ b/src/pages/Item/Card/ItemDiary.vue @@ -158,7 +158,6 @@ const getBadgeAttrs = (_date) => { const scrollToToday = async () => { await nextTick(); - console.log('today.toISOString(): ', today.toISOString()); const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`); if (todayCell) { todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' }); diff --git a/src/pages/Item/Card/ItemLastEntries.vue b/src/pages/Item/Card/ItemLastEntries.vue index 1eaaa931f..1fb8bc287 100644 --- a/src/pages/Item/Card/ItemLastEntries.vue +++ b/src/pages/Item/Card/ItemLastEntries.vue @@ -208,15 +208,6 @@ onMounted(async () => { if (nTo && nTo != oTo) nTo = getDate(new Date(nTo), 'to'); updateFilter(); }); - - const rows = document.querySelectorAll('tr'); - console.log('rows: ', rows); - rows.forEach((row) => { - const td = row.querySelector('td[data-is-inventory="1"]'); - if (td) { - row.classList.add('inventory-row'); - } - }); }); function getBadgeClass(groupingMode, expectedGrouping) { @@ -363,10 +354,6 @@ function highlightedRow(row) { Hide inventory supplier: Ocultar proveedor inventario </i18n> <style lang="scss" scoped> -.inventory-row { - background-color: #f0f0f0; /* Cambia el color de fondo o cualquier otro estilo */ -} - .q-badge--rounded { border-radius: 50%; } From 15a6e3a3c5c0457e9dcf70e3faa1a23567ba7614 Mon Sep 17 00:00:00 2001 From: alexm <alexm@verdnatura.es> Date: Fri, 28 Feb 2025 14:12:12 +0100 Subject: [PATCH 08/14] test: skip EntryStockBought test suite --- test/cypress/integration/entry/stockBought.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cypress/integration/entry/stockBought.spec.js b/test/cypress/integration/entry/stockBought.spec.js index b282a19a5..87cbb3f9c 100644 --- a/test/cypress/integration/entry/stockBought.spec.js +++ b/test/cypress/integration/entry/stockBought.spec.js @@ -1,4 +1,4 @@ -describe('EntryStockBought', () => { +describe.skip('EntryStockBought', () => { beforeEach(() => { cy.viewport(1920, 1080); cy.login('buyer'); From c3b9a4f719ca6c6b58e1952d05d0613b21b2342a Mon Sep 17 00:00:00 2001 From: Javier Segarra <jsegarra@verdnatura.es> Date: Sat, 1 Mar 2025 02:23:47 +0100 Subject: [PATCH 09/14] feat: add --browser chromium --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e78b0cf3c..fc7f9c15d 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "resetDatabase": "cd ../salix && gulp docker", "lint": "eslint --ext .js,.vue ./", "format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore", - "test:e2e": "cypress open", - "test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run", + "test:e2e": "cypress open --browser chromium", + "test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run --browser chromium", "test": "echo \"See package.json => scripts for available tests.\" && exit 0", "test:unit": "vitest", "test:unit:ci": "vitest run", From e97c499e399e435fac2cac4f7a5690ca6ee69942 Mon Sep 17 00:00:00 2001 From: Javier Segarra <jsegarra@verdnatura.es> Date: Sat, 1 Mar 2025 02:23:59 +0100 Subject: [PATCH 10/14] feat: rename test:unit by test:front --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fc7f9c15d..709d17f40 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,8 @@ "test:e2e": "cypress open --browser chromium", "test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run --browser chromium", "test": "echo \"See package.json => scripts for available tests.\" && exit 0", - "test:unit": "vitest", - "test:unit:ci": "vitest run", + "test:front": "vitest", + "test:front:ci": "vitest run", "commitlint": "commitlint --edit", "prepare": "npx husky install", "addReferenceTag": "node .husky/addReferenceTag.js", From 1e9158b723f4df57b30d5f7ab14b81b5cbae8ae3 Mon Sep 17 00:00:00 2001 From: Javier Segarra <jsegarra@verdnatura.es> Date: Sat, 1 Mar 2025 09:46:02 +0100 Subject: [PATCH 11/14] revert: browser chromium package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 709d17f40..1361d1fd8 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "resetDatabase": "cd ../salix && gulp docker", "lint": "eslint --ext .js,.vue ./", "format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore", - "test:e2e": "cypress open --browser chromium", - "test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run --browser chromium", + "test:e2e": "cypress open", + "test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run", "test": "echo \"See package.json => scripts for available tests.\" && exit 0", "test:front": "vitest", "test:front:ci": "vitest run", From 15969eff43befda19e24ea03a91e96784f736e69 Mon Sep 17 00:00:00 2001 From: Javier Segarra <jsegarra@verdnatura.es> Date: Sat, 1 Mar 2025 09:46:21 +0100 Subject: [PATCH 12/14] ci: replace test:unit by test:front --- Jenkinsfile | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a52a9e91d..ea3f1b439 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -94,7 +94,7 @@ pipeline { parallel { stage('Unit') { steps { - sh 'pnpm run test:unit:ci' + sh 'pnpm run test:front:ci' } post { always { diff --git a/README.md b/README.md index e87a84d60..262e12e58 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ quasar dev ### Run unit tests ```bash -pnpm run test:unit +pnpm run test:front ``` ### Run e2e tests From 2d316b3721ac2a53560818800f6856c06fb98bc7 Mon Sep 17 00:00:00 2001 From: pablone <pablone@verdnatura.es> Date: Sat, 1 Mar 2025 20:57:03 +0100 Subject: [PATCH 13/14] feat: refs #8697 enable data-cy attribute for VnTable, update test cases to remove skips and adjust selectors --- src/components/VnTable/VnTable.vue | 1 + src/pages/Entry/Card/EntryBuys.vue | 1 - test/cypress/integration/entry/entryList.spec.js | 2 +- test/cypress/integration/entry/stockBought.spec.js | 4 ++-- test/cypress/integration/ticket/ticketList.spec.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index dd2cefd89..7e9f7aae0 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -681,6 +681,7 @@ const rowCtrlClickFunction = computed(() => { @update:selected="emit('update:selected', $event)" @selection="(details) => handleSelection(details, rows)" :hide-selected-banner="true" + :data-cy="$props.dataCy ?? 'vnTable'" > <template #top-left v-if="!$props.withoutHeader"> <slot name="top-left"> </slot> diff --git a/src/pages/Entry/Card/EntryBuys.vue b/src/pages/Entry/Card/EntryBuys.vue index 6e67c31ed..684ed5f59 100644 --- a/src/pages/Entry/Card/EntryBuys.vue +++ b/src/pages/Entry/Card/EntryBuys.vue @@ -656,7 +656,6 @@ onMounted(() => { :without-header="!editableMode" :with-filters="editableMode" :right-search="editableMode" - :right-search-icon="true" :row-click="false" :columns="columns" :beforeSaveFn="beforeSave" diff --git a/test/cypress/integration/entry/entryList.spec.js b/test/cypress/integration/entry/entryList.spec.js index bdaa66f79..d43ec895a 100644 --- a/test/cypress/integration/entry/entryList.spec.js +++ b/test/cypress/integration/entry/entryList.spec.js @@ -1,4 +1,4 @@ -describe.skip('Entry', () => { +describe('Entry', () => { beforeEach(() => { cy.viewport(1920, 1080); cy.login('buyer'); diff --git a/test/cypress/integration/entry/stockBought.spec.js b/test/cypress/integration/entry/stockBought.spec.js index 87cbb3f9c..2a8431cf0 100644 --- a/test/cypress/integration/entry/stockBought.spec.js +++ b/test/cypress/integration/entry/stockBought.spec.js @@ -16,9 +16,9 @@ describe.skip('EntryStockBought', () => { cy.get('input[aria-label="Reserve"]').type('1'); cy.get('input[aria-label="Date"]').eq(1).clear(); cy.get('input[aria-label="Date"]').eq(1).type('01-01'); - cy.get('input[aria-label="Buyer"]').type('buyerBossNick'); + cy.get('input[aria-label="Buyer"]').type('itNick'); cy.get('div[role="listbox"] > div > div[role="option"]') - .eq(0) + .eq(1) .should('be.visible') .click(); diff --git a/test/cypress/integration/ticket/ticketList.spec.js b/test/cypress/integration/ticket/ticketList.spec.js index 1c96b027f..593021e6e 100644 --- a/test/cypress/integration/ticket/ticketList.spec.js +++ b/test/cypress/integration/ticket/ticketList.spec.js @@ -1,5 +1,5 @@ /// <reference types="cypress" /> -describe.skip('TicketList', () => { +describe('TicketList', () => { const firstRow = 'tbody > :nth-child(1)'; beforeEach(() => { From e4f83de123732449b6f3d8757fff4f4ce7db5deb Mon Sep 17 00:00:00 2001 From: pablone <pablone@verdnatura.es> Date: Sun, 2 Mar 2025 00:15:24 +0100 Subject: [PATCH 14/14] test: refs #8697 enable EntryStockBought test suite by removing skip --- test/cypress/integration/entry/stockBought.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cypress/integration/entry/stockBought.spec.js b/test/cypress/integration/entry/stockBought.spec.js index 2a8431cf0..91e0d507e 100644 --- a/test/cypress/integration/entry/stockBought.spec.js +++ b/test/cypress/integration/entry/stockBought.spec.js @@ -1,4 +1,4 @@ -describe.skip('EntryStockBought', () => { +describe('EntryStockBought', () => { beforeEach(() => { cy.viewport(1920, 1080); cy.login('buyer');