From 8861ee038dfbf44da1b97f8cf91a6bb4517f86ab Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 9 Jan 2024 10:35:39 +0100 Subject: [PATCH 001/111] refs #6384 fix: redirect to same path when id change --- src/components/ui/VnSearchbar.vue | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index 35f6c1548..bb54f6d31 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -72,15 +72,10 @@ async function search() { }); if (!props.redirect) return; - const rows = store.data; - const module = route.matched[1]; - if (rows.length === 1) { - const [firstRow] = rows; - await router.push({ path: `${module.path}/${firstRow.id}` }); - } else if (route.matched.length > 3) { - await router.push({ path: `/${module.path}` }); - arrayData.updateStateParams(); - } + const { matched: matches } = route; + const { path } = matches[matches.length-1]; + const newRoute = path.replace(':id', searchText.value); + await router.push(newRoute); } From d139d670f17bc8f239455937b7ed47b12e41d20e Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 9 Jan 2024 10:37:59 +0100 Subject: [PATCH 002/111] refs #6384 perf: replace code with VnSubToolbar --- src/pages/Claim/Card/ClaimCard.vue | 1 - src/pages/Customer/Card/CustomerCard.vue | 7 ++----- src/pages/InvoiceIn/Card/InvoiceInCard.vue | 7 ++----- src/pages/Supplier/Card/SupplierCard.vue | 7 ++----- src/pages/Ticket/Card/TicketCard.vue | 7 ++----- src/pages/Travel/Card/TravelCard.vue | 7 ++----- src/pages/Worker/Card/WorkerCard.vue | 7 ++----- 7 files changed, 12 insertions(+), 31 deletions(-) diff --git a/src/pages/Claim/Card/ClaimCard.vue b/src/pages/Claim/Card/ClaimCard.vue index b6c948c96..8ebfcc285 100644 --- a/src/pages/Claim/Card/ClaimCard.vue +++ b/src/pages/Claim/Card/ClaimCard.vue @@ -1,6 +1,5 @@ @@ -11,11 +12,7 @@ const stateStore = useStateStore(); - -
- -
-
+
diff --git a/src/pages/Worker/Card/WorkerCard.vue b/src/pages/Worker/Card/WorkerCard.vue index 972eb52ec..19397b62e 100644 --- a/src/pages/Worker/Card/WorkerCard.vue +++ b/src/pages/Worker/Card/WorkerCard.vue @@ -4,6 +4,7 @@ import { useStateStore } from 'stores/useStateStore'; import WorkerDescriptor from './WorkerDescriptor.vue'; import LeftMenu from 'components/LeftMenu.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; +import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; const stateStore = useStateStore(); const { t } = useI18n(); @@ -26,11 +27,7 @@ const { t } = useI18n(); - -
- -
-
+
From 762daa620b6e62da265491912e915b948e33fcde Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 9 Jan 2024 12:06:17 +0100 Subject: [PATCH 003/111] refs #6384 test: e2e --- test/cypress/integration/vnSearchBar.spec.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/cypress/integration/vnSearchBar.spec.js diff --git a/test/cypress/integration/vnSearchBar.spec.js b/test/cypress/integration/vnSearchBar.spec.js new file mode 100644 index 000000000..6a769c9d9 --- /dev/null +++ b/test/cypress/integration/vnSearchBar.spec.js @@ -0,0 +1,20 @@ +/// +describe('VnSearchBar', () => { + beforeEach(() => { + cy.login('developer'); + cy.visit('/'); + }); + + it('should redirect to new customer', () => { + cy.visit('#/customer/1112/basic-data') + cy.get('.q-toolbar > .q-btn--round.q-btn--dense > .q-btn__content > .q-icon').click(); + cy.get('.q-item > .q-item__label').should('have.text',' #1112') + cy.get('.fullscreen').click(); + cy.get('#searchbar > form > label > div:nth-child(1) input').clear(); + cy.get('#searchbar > form > label > div:nth-child(1) input').type('1{enter}'); + cy.get('.q-toolbar > .q-btn--round.q-btn--dense > .q-btn__content > .q-icon').click(); + cy.get('.q-item > .q-item__label').should('have.text',' #1') + }); + + + }); From b4f330a2378ea217ee8e10a4d8f955b055a33e8b Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 9 Jan 2024 12:20:56 +0100 Subject: [PATCH 004/111] refs #6384 test: e2e --- test/cypress/integration/vnSearchBar.spec.js | 15 +++++++-------- test/cypress/support/commands.js | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/test/cypress/integration/vnSearchBar.spec.js b/test/cypress/integration/vnSearchBar.spec.js index 6a769c9d9..d6dea0780 100644 --- a/test/cypress/integration/vnSearchBar.spec.js +++ b/test/cypress/integration/vnSearchBar.spec.js @@ -7,14 +7,13 @@ describe('VnSearchBar', () => { it('should redirect to new customer', () => { cy.visit('#/customer/1112/basic-data') - cy.get('.q-toolbar > .q-btn--round.q-btn--dense > .q-btn__content > .q-icon').click(); + cy.openLeftMenu(); cy.get('.q-item > .q-item__label').should('have.text',' #1112') - cy.get('.fullscreen').click(); - cy.get('#searchbar > form > label > div:nth-child(1) input').clear(); - cy.get('#searchbar > form > label > div:nth-child(1) input').type('1{enter}'); - cy.get('.q-toolbar > .q-btn--round.q-btn--dense > .q-btn__content > .q-icon').click(); + cy.closeLeftMenu(); + cy.clearSearchbar(); + cy.writeSearchbar('1{enter}'); + cy.openLeftMenu(); cy.get('.q-item > .q-item__label').should('have.text',' #1') + cy.closeLeftMenu(); }); - - - }); +}); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 4dfde6e21..7effb94a6 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -166,6 +166,23 @@ Cypress.Commands.add('openRightMenu', (element) => { cy.get('#actions-append').click(); }); +Cypress.Commands.add('openLeftMenu', (element) => { + if (element) cy.waitForElement(element); + cy.get('.q-toolbar > .q-btn--round.q-btn--dense > .q-btn__content > .q-icon').click(); +}); +Cypress.Commands.add('closeLeftMenu', (element) => { + if (element) cy.waitForElement(element); + cy.get('.fullscreen').click(); +}); + +Cypress.Commands.add('clearSearchbar', (element) => { + if (element) cy.waitForElement(element); + cy.get('#searchbar > form > label > div:nth-child(1) input').clear(); +}); + +Cypress.Commands.add('writeSearchbar', (value) => { + cy.get('#searchbar > form > label > div:nth-child(1) input').type(value); +}); Cypress.Commands.add('validateContent', (selector, expectedValue) => { cy.get(selector).should('have.text', expectedValue); }); From bdbc34d4e7fb9a1a1bb9f5183cf9f7f955f7471b Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 9 Jan 2024 14:00:51 +0100 Subject: [PATCH 005/111] refs #6325 claimRatio --- src/pages/Customer/Card/CustomerSummary.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Customer/Card/CustomerSummary.vue b/src/pages/Customer/Card/CustomerSummary.vue index 6693274ac..4ebd6efab 100644 --- a/src/pages/Customer/Card/CustomerSummary.vue +++ b/src/pages/Customer/Card/CustomerSummary.vue @@ -38,7 +38,7 @@ const balanceDue = computed(() => { const balanceDueWarning = computed(() => (balanceDue.value ? 'negative' : '')); const claimRate = computed(() => { - return customer.value.claimsRatio.claimingRate * 100; + return customer.value.claimsRatio.claimingRate; }); const priceIncreasingRate = computed(() => { From 3e8744c8371be5ea1df84cb5c542223ca0629196 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 9 Jan 2024 14:24:29 +0100 Subject: [PATCH 006/111] fix: refs #6630 fix css --- src/components/common/VnLog.vue | 51 ++++++++++++++++----------------- src/components/ui/VnAvatar.vue | 3 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index 0949fb5cb..1794c3850 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -415,7 +415,7 @@ setLogTree();
@@ -425,6 +425,7 @@ setLogTree(); class="cursor-pointer" :worker="userLog.user.id" :title="userLog.user.nickname" + size="lg" /> .loading { + display: flex; + justify-content: center; + } + & > .q-card { + min-width: 180px; + max-width: 400px; + + & > .header { + color: $dark; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + } +} .origin-log { &:first-child > .origin-info { margin-top: 0; } & > .origin-info { - width: 100%; - max-width: 42em; margin-top: 28px; gap: 6px; @@ -847,14 +864,15 @@ setLogTree(); } } .user-log { + display: flex; width: 100%; max-width: 40em; - & > .timeline { position: relative; - padding-right: 5px; - width: 50px; + padding-right: 1px; + width: 38px; min-width: 38px; + flex-grow: auto; & > .arrow { height: 8px; width: 8px; @@ -874,7 +892,7 @@ setLogTree(); position: absolute; background-color: $primary; width: 2px; - left: 23px; + left: 19px; z-index: -1; top: 0; bottom: -8px; @@ -984,25 +1002,6 @@ setLogTree(); } } } -.q-menu { - display: block; - - & > .loading { - display: flex; - justify-content: center; - } - & > .q-card { - min-width: 180px; - max-width: 400px; - - & > .header { - color: $dark; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - } -} en: diff --git a/src/components/ui/VnAvatar.vue b/src/components/ui/VnAvatar.vue index 85bece243..0cda98b32 100644 --- a/src/components/ui/VnAvatar.vue +++ b/src/components/ui/VnAvatar.vue @@ -5,13 +5,14 @@ const $props = defineProps({ worker: { type: Number, required: true }, description: { type: String, default: null }, clickable: { type: Boolean, default: false }, + size: { type: String, default: 'xl' }, }); const session = useSession(); const token = session.getToken(); @@ -666,7 +667,6 @@ setLogTree(); option-label="locale" :options="actions" @update:model-value="selectFilter('action')" - @clear="() => selectFilter('action')" hide-selected /> diff --git a/src/components/ui/VnAvatar.vue b/src/components/ui/VnAvatar.vue index 566497395..d26aeac19 100644 --- a/src/components/ui/VnAvatar.vue +++ b/src/components/ui/VnAvatar.vue @@ -4,6 +4,7 @@ import { useSession } from 'src/composables/useSession'; const $props = defineProps({ workerId: { type: Number, required: true }, description: { type: String, default: null }, + size: { type: String, default: 'xl' }, }); const session = useSession(); const token = session.getToken(); From 3c8022ac459f92d10cc67959e2e4ca3ebfdb47ec Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 10 Jan 2024 16:49:09 +0100 Subject: [PATCH 014/111] feat: refs #6630 VnAvatar letter feature added --- src/components/common/VnLog.vue | 4 ++-- src/components/ui/VnAvatar.vue | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index b42dac386..4dcb86780 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -422,13 +422,13 @@ setLogTree(); >
- + diff --git a/src/components/ui/VnAvatar.vue b/src/components/ui/VnAvatar.vue index d26aeac19..5a5483084 100644 --- a/src/components/ui/VnAvatar.vue +++ b/src/components/ui/VnAvatar.vue @@ -1,20 +1,37 @@