From 947f913679b79451d5b790a41d41fdf69873f581 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 7 Oct 2024 09:25:06 +0200 Subject: [PATCH 1/8] refactor: refs #8019 create VnDate --- src/components/common/VnDate.vue | 11 +++++++++++ src/components/common/VnInputDate.vue | 23 +++++++++++------------ src/components/common/VnTime.vue | 6 ++++++ 3 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 src/components/common/VnDate.vue create mode 100644 src/components/common/VnTime.vue diff --git a/src/components/common/VnDate.vue b/src/components/common/VnDate.vue new file mode 100644 index 000000000..4b65ec4da --- /dev/null +++ b/src/components/common/VnDate.vue @@ -0,0 +1,11 @@ + + diff --git a/src/components/common/VnInputDate.vue b/src/components/common/VnInputDate.vue index 3d5afaf80..1aa797ab7 100644 --- a/src/components/common/VnInputDate.vue +++ b/src/components/common/VnInputDate.vue @@ -3,6 +3,7 @@ import { onMounted, watch, computed, ref } from 'vue'; import { date } from 'quasar'; import { useI18n } from 'vue-i18n'; import { useAttrs } from 'vue'; +import VnDate from './VnDate.vue'; const model = defineModel({ type: [String, Date] }); const $props = defineProps({ @@ -87,6 +88,11 @@ const styleAttrs = computed(() => { } : {}; }); + +const manageDate = (date) => { + formattedDate.value = date; + isPopupOpen.value = false; +}; { :no-focus="true" :no-parent-event="true" > - + + + + diff --git a/src/components/common/VnTime.vue b/src/components/common/VnTime.vue new file mode 100644 index 000000000..135709d2b --- /dev/null +++ b/src/components/common/VnTime.vue @@ -0,0 +1,6 @@ + + From 5c5a35998615b270d4f2423b4247f828fd9524fb Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 7 Oct 2024 09:38:39 +0200 Subject: [PATCH 2/8] refactor: refs #8019 create VnTime --- src/components/common/VnInputTime.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/common/VnInputTime.vue b/src/components/common/VnInputTime.vue index a5e7d3002..6d69bc4a5 100644 --- a/src/components/common/VnInputTime.vue +++ b/src/components/common/VnInputTime.vue @@ -3,6 +3,8 @@ import { computed, ref, useAttrs } from 'vue'; import { useI18n } from 'vue-i18n'; import { date } from 'quasar'; import { useValidator } from 'src/composables/useValidator'; +import VnTime from './VnTime.vue'; + const { validations } = useValidator(); const $attrs = useAttrs(); const model = defineModel({ type: String }); @@ -107,6 +109,7 @@ function dateToTime(newDate) { /> - + + + + From d1b3e01d871e95a7472900225fa2b2d545aef19c Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 7 Oct 2024 13:36:27 +0200 Subject: [PATCH 3/8] chore: refs #8019 refactor css scoped --- src/components/common/VnDate.vue | 36 ++++++++++++++++++++++++++++++++ src/components/ui/VnImg.vue | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/components/common/VnDate.vue b/src/components/common/VnDate.vue index 4b65ec4da..cdfa0d258 100644 --- a/src/components/common/VnDate.vue +++ b/src/components/common/VnDate.vue @@ -9,3 +9,39 @@ const model = defineModel({ type: [String, Number], required: true }); :options="$attrs.options" /> + diff --git a/src/components/ui/VnImg.vue b/src/components/ui/VnImg.vue index ceb4e8468..1b57c20d0 100644 --- a/src/components/ui/VnImg.vue +++ b/src/components/ui/VnImg.vue @@ -58,7 +58,7 @@ defineExpose({ :class="{ zoomIn: zoom }" :src="getUrl()" v-bind="$attrs" - @click.stop="show = $props.zoom ? true : false" + @click.stop="show = $props.zoom" spinner-color="primary" /> From c81506695314e291aa22d7433d65521711921d37 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 7 Oct 2024 15:55:18 +0200 Subject: [PATCH 4/8] feat: refs #8019 fine-tunning vnDate --- src/components/common/VnDate.vue | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/src/components/common/VnDate.vue b/src/components/common/VnDate.vue index cdfa0d258..761ac995e 100644 --- a/src/components/common/VnDate.vue +++ b/src/components/common/VnDate.vue @@ -2,46 +2,28 @@ const model = defineModel({ type: [String, Number], required: true }); From 4344458bb067f4c6595f02df580dffd3e5e08a84 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 7 Oct 2024 16:02:29 +0200 Subject: [PATCH 5/8] feat: refs #8019 fine-tunning vnTime --- src/components/common/VnTime.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/common/VnTime.vue b/src/components/common/VnTime.vue index 135709d2b..369f80432 100644 --- a/src/components/common/VnTime.vue +++ b/src/components/common/VnTime.vue @@ -2,5 +2,15 @@ const model = defineModel({ type: [String, Number], required: true }); + From e0f60ed1181c2548ba77b4e2a55461c7b6492e5e Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 8 Oct 2024 11:07:05 +0000 Subject: [PATCH 6/8] test: fix VnLocation --- .../integration/vnComponent/vnLocation.spec.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/cypress/integration/vnComponent/vnLocation.spec.js b/test/cypress/integration/vnComponent/vnLocation.spec.js index 78dc38899..c1b0cf929 100644 --- a/test/cypress/integration/vnComponent/vnLocation.spec.js +++ b/test/cypress/integration/vnComponent/vnLocation.spec.js @@ -64,7 +64,7 @@ describe('VnLocation', () => { `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) > .q-icon` ).click(); cy.get( - `#q-portal--dialog--4 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input` + `#q-portal--dialog--5 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input` ).should('have.value', province); }); }); @@ -133,6 +133,8 @@ describe('VnLocation', () => { ); cy.get('.q-mt-lg > .q-btn--standard').click(); cy.get(`${createForm.prefix}`).should('not.exist'); + cy.waitForElement('.q-form'); + checkVnLocation(postCode, province); }); it('Create city', () => { @@ -144,10 +146,12 @@ describe('VnLocation', () => { cy.get( `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) > .q-icon` ).click(); - cy.selectOption('#q-portal--dialog--2 .q-select', 'one'); - cy.get('#q-portal--dialog--2 .q-input').type(province); - cy.get('#q-portal--dialog--2 .q-btn--standard').click(); + cy.selectOption('#q-portal--dialog--3 .q-select', 'one'); + cy.get('#q-portal--dialog--3 .q-input').type(province); + cy.get('#q-portal--dialog--3 .q-btn--standard').click(); cy.get('#q-portal--dialog--1 .q-btn--standard').click(); + cy.waitForElement('.q-form'); + checkVnLocation(postCode, province); }); From 6a797460806cf628f9310a7c54d35fb878c29b03 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 8 Oct 2024 13:18:51 +0200 Subject: [PATCH 7/8] test: fix TicketDescriptor --- test/cypress/integration/ticket/ticketDescriptor.spec.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/cypress/integration/ticket/ticketDescriptor.spec.js b/test/cypress/integration/ticket/ticketDescriptor.spec.js index 8192b7c7c..0ba2723a2 100644 --- a/test/cypress/integration/ticket/ticketDescriptor.spec.js +++ b/test/cypress/integration/ticket/ticketDescriptor.spec.js @@ -1,7 +1,8 @@ /// describe('Ticket descriptor', () => { - const toCloneOpt = '[role="menu"] .q-list > :nth-child(5)'; - const setWeightOpt = '[role="menu"] .q-list > :nth-child(6)'; + const listItem = '[role="menu"] .q-list .q-item'; + const toCloneOpt = 'To clone ticket'; + const setWeightOpt = 'Set weight'; const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span'; const summaryHeader = '.summaryHeader > div'; const weight = 25; @@ -14,7 +15,7 @@ describe('Ticket descriptor', () => { it('should clone the ticket without warehouse', () => { cy.visit('/#/ticket/1/summary'); cy.openActionsDescriptor(); - cy.get(toCloneOpt).click(); + cy.contains(listItem, toCloneOpt).click(); cy.clickConfirm(); cy.get(warehouseValue).contains('Warehouse One'); cy.get(summaryHeader) @@ -28,7 +29,7 @@ describe('Ticket descriptor', () => { it('should set the weight of the ticket', () => { cy.visit('/#/ticket/10/summary'); cy.openActionsDescriptor(); - cy.get(setWeightOpt).click(); + cy.contains(listItem, setWeightOpt).click(); cy.intercept('POST', /\/api\/Tickets\/\d+\/setWeight/).as('weight'); cy.get('.q-dialog input').type(weight); cy.clickConfirm(); From eebac7b36cc41c19f5df82f485e02efb5989acbe Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 14 Oct 2024 08:51:26 +0200 Subject: [PATCH 8/8] fix: fixed e2e test --- test/cypress/integration/entry/myEntry.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cypress/integration/entry/myEntry.spec.js b/test/cypress/integration/entry/myEntry.spec.js index dca74dec2..4addec1c4 100644 --- a/test/cypress/integration/entry/myEntry.spec.js +++ b/test/cypress/integration/entry/myEntry.spec.js @@ -11,7 +11,7 @@ describe('EntryMy when is supplier', () => { it('should open buyLabel when is supplier', () => { cy.get( - '[to="/null/2"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon' + '[to="/null/3"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon' ).click(); cy.get('.q-card__actions > .q-btn').click(); cy.window().its('open').should('be.called');