From 31ac61b01f183a652add0b6e2fdd3cbd7d638fe4 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 13 Mar 2024 11:33:10 +0100 Subject: [PATCH 01/11] refactor: #6988 changed ticket summary view and fixed notes functionality --- src/css/app.scss | 2 +- src/pages/Ticket/Card/TicketSummary.vue | 64 ++++++++++++++++--------- 2 files changed, 42 insertions(+), 24 deletions(-) diff --git a/src/css/app.scss b/src/css/app.scss index 38dd642a3..741dbe332 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -110,4 +110,4 @@ input::-webkit-inner-spin-button { appearance: none; -webkit-appearance: none; -moz-appearance: none; -} +} \ No newline at end of file diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue index fbca21086..72bfe4a67 100644 --- a/src/pages/Ticket/Card/TicketSummary.vue +++ b/src/pages/Ticket/Card/TicketSummary.vue @@ -130,22 +130,6 @@ async function changeState(value) { + + + {{t('Summary')}} + + +
+ + + +
+ +
{{ t('ticket.summary.saleLines') }} @@ -452,20 +458,32 @@ async function changeState(value) { width: max-content; } .cardSummary .summaryBody > .q-card > .taxes { - border: 2px solid gray; + margin-right: 90px; padding: 0; - > .vn-label-value { - text-align: right; + & > .vn-label-value { + text-align: left; display: flex; flex-direction: row; margin-top: 5px; - justify-content: flex-end; - padding-right: 20px; + justify-content: flex-start; + padding-left: 10px; + } +} + +.q-card.q-card--dark.q-dark.vn-one { + & > .bodyCard{ + padding: 1%; + margin-right: 40%; } } .cardSummary .summaryBody > .q-card:has(.taxes) { margin-top: 2px; - padding: 0; + padding: 0%; } + + + es: + Summary: Resumen + From 17145b7fe8d33f12ad06aa4b471a1343b3cb510b Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 22 Mar 2024 13:36:31 +0100 Subject: [PATCH 02/11] fix: refs #6988 fix style --- src/pages/Ticket/Card/TicketSummary.vue | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue index c0c271bfc..93c9fa081 100644 --- a/src/pages/Ticket/Card/TicketSummary.vue +++ b/src/pages/Ticket/Card/TicketSummary.vue @@ -243,10 +243,7 @@ async function changeState(value) { - - {{ t('Summary') }} - - +
.q-card > .taxes { - margin-right: 90px; - padding: 0; - & > .vn-label-value { - text-align: left; - display: flex; - flex-direction: row; - margin-top: 5px; - justify-content: flex-start; - padding-left: 10px; - } -} .q-card.q-card--dark.q-dark.vn-one { & > .bodyCard { padding: 1%; - margin-right: 40%; } } - -.cardSummary .summaryBody > .q-card:has(.taxes) { - margin-top: 2px; - padding: 0%; -} From 84a25acf22db975eeaae12435952a0b60260bb0c Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 25 Mar 2024 11:42:29 +0100 Subject: [PATCH 03/11] refactor: refs #6988 used global translations --- src/i18n/en/index.js | 1 + src/i18n/es/index.js | 1 + src/pages/Ticket/Card/TicketSummary.vue | 7 +------ 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index a9ce1a6ed..1365d4c17 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -492,6 +492,7 @@ export default { request: 'Request', weight: 'Weight', goTo: 'Go to', + summaryAmount: 'Resumen', }, }, claim: { diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 0977448fb..f5f07f543 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -491,6 +491,7 @@ export default { request: 'Petición de compra', weight: 'Peso', goTo: 'Ir a', + summaryAmount: 'Resumen', }, }, claim: { diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue index 93c9fa081..5d2b62944 100644 --- a/src/pages/Ticket/Card/TicketSummary.vue +++ b/src/pages/Ticket/Card/TicketSummary.vue @@ -243,7 +243,7 @@ async function changeState(value) { - +
- - - es: - Summary: Resumen - From 3e0f1515703a8deedad200aee1a48dcee17880eb Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 25 Mar 2024 12:36:50 +0100 Subject: [PATCH 04/11] refactor: refs #6988 fixed error --- src/i18n/en/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 1365d4c17..839d768b4 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -492,7 +492,7 @@ export default { request: 'Request', weight: 'Weight', goTo: 'Go to', - summaryAmount: 'Resumen', + summaryAmount: 'Summary', }, }, claim: { From b46760116fcfafc7c422e72493e29801a28dd415 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 26 Mar 2024 08:34:15 +0100 Subject: [PATCH 05/11] Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6942-improveInvoceIn --- src/components/ui/VnSearchbar.vue | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index d86b02166..25560cee0 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -1,11 +1,9 @@ From 1ec54d7664b7e3c9c068010a58af3d9d10b4e8ff Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 26 Mar 2024 08:55:01 +0100 Subject: [PATCH 06/11] feat: #6514 create supplierDms lilium --- src/i18n/en/index.js | 1 + src/i18n/es/index.js | 1 + src/pages/Supplier/Card/SupplierDms.vue | 11 +++++++++++ src/router/modules/Supplier.js | 10 ++++++++++ 4 files changed, 23 insertions(+) create mode 100644 src/pages/Supplier/Card/SupplierDms.vue diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index a0dea0555..e2c3e9547 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -1014,6 +1014,7 @@ export default { addresses: 'Addresses', consumption: 'Consumption', agencyTerm: 'Agency agreement', + dms: 'File management', }, list: { payMethod: 'Pay method', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index be16bc2f8..8f28bc984 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -1014,6 +1014,7 @@ export default { addresses: 'Direcciones', consumption: 'Consumo', agencyTerm: 'Acuerdo agencia', + dms: 'Gestión documental', }, list: { payMethod: 'Método de pago', diff --git a/src/pages/Supplier/Card/SupplierDms.vue b/src/pages/Supplier/Card/SupplierDms.vue new file mode 100644 index 000000000..2848f858d --- /dev/null +++ b/src/pages/Supplier/Card/SupplierDms.vue @@ -0,0 +1,11 @@ + + diff --git a/src/router/modules/Supplier.js b/src/router/modules/Supplier.js index 379a2c2c2..64c48146b 100644 --- a/src/router/modules/Supplier.js +++ b/src/router/modules/Supplier.js @@ -22,6 +22,7 @@ export default { 'SupplierAddresses', 'SupplierConsumption', 'SupplierAgencyTerm', + 'SupplierDms', ], }, children: [ @@ -161,6 +162,15 @@ export default { component: () => import('src/pages/Supplier/Card/SupplierAgencyTerm.vue'), }, + { + path: 'dms', + name: 'SupplierDms', + meta: { + title: 'dms', + icon: 'smb_share', + }, + component: () => import('src/pages/Supplier/Card/SupplierDms.vue'), + }, { path: 'agency-term/create', name: 'SupplierAgencyTermCreate', From a0dcd6aee165a70e5412e7341c2ee6dd46dd1da0 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 26 Mar 2024 09:11:53 +0100 Subject: [PATCH 07/11] feat: refs #6893 replace id & redirect to Card or list --- src/components/ui/VnSearchbar.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index 25560cee0..34da7cbf5 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -97,12 +97,18 @@ async function search() { const { matched: matches } = currentRoute.value; const { path } = matches.at(-1); + const [, moduleName] = path.split('/'); - let targetUrl = path.replace(':id', searchText.value); - if (path.endsWith('/list') && store.data.length === 1) - targetUrl = targetUrl.replace('/list', `/${store.data[0].id}/summary`); + if (!store.data.length || store.data.length > 1) + return push({ path: `/${moduleName}/list` }); - await push(targetUrl); + const targetId = store.data[0].id; + let targetUrl; + + if (path.endsWith('/list')) targetUrl = path.replace('/list', `/${targetId}/summary`); + else if (path.includes(':id')) targetUrl = path.replace(':id', targetId); + + await push({ path: targetUrl }); } From 20102a89abbe03649e617d180255276e5519b434 Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 27 Mar 2024 11:14:54 +0100 Subject: [PATCH 08/11] feat: refs #6893 improve VnSearchbar & create tests --- CHANGELOG.md | 3 ++ src/components/ui/VnSearchbar.vue | 12 ++--- test/cypress/integration/vnSearchBar.spec.js | 45 ++++++++++++++----- .../components/common/VnSearchBar.spec.js | 43 +++++++++++------- 4 files changed, 69 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51dd2010c..d15ad787d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - (Tickets) => Se añade la opción de clonar ticket. #6951 +- (Parking) => Se añade la sección Parking. #5186 ### Changed ### Fixed +- (General) => Se corrige la redirección cuando hay 1 solo registro y cuando se aplica un filtro diferente al id al hacer una búsqueda general. #6893 + ## [2400.01] - 2024-01-04 ### Added diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index 34da7cbf5..ddf520d0f 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -65,9 +65,9 @@ const props = defineProps({ }, }); -const { currentRoute, push } = useRouter(); +const router = useRouter(); const arrayData = useArrayData(props.dataKey, { ...props }); -const store = arrayData.store; +const { store } = arrayData; const searchText = ref(''); onMounted(() => { @@ -90,17 +90,17 @@ async function search() { if (!props.redirect) return; if (props.customRouteRedirectName) - return push({ + return router.push({ name: props.customRouteRedirectName, params: { id: searchText.value }, }); - const { matched: matches } = currentRoute.value; + const { matched: matches } = router.currentRoute.value; const { path } = matches.at(-1); const [, moduleName] = path.split('/'); if (!store.data.length || store.data.length > 1) - return push({ path: `/${moduleName}/list` }); + return router.push({ path: `/${moduleName}/list` }); const targetId = store.data[0].id; let targetUrl; @@ -108,7 +108,7 @@ async function search() { if (path.endsWith('/list')) targetUrl = path.replace('/list', `/${targetId}/summary`); else if (path.includes(':id')) targetUrl = path.replace(':id', targetId); - await push({ path: targetUrl }); + await router.push({ path: targetUrl }); } diff --git a/test/cypress/integration/vnSearchBar.spec.js b/test/cypress/integration/vnSearchBar.spec.js index d6dea0780..3db789773 100644 --- a/test/cypress/integration/vnSearchBar.spec.js +++ b/test/cypress/integration/vnSearchBar.spec.js @@ -1,19 +1,42 @@ /// describe('VnSearchBar', () => { + const employeeId = ' #1'; + const salesPersonId = ' #18'; + const idGap = '.q-item > .q-item__label'; + const cardList = '.vn-card-list'; + + let url; beforeEach(() => { cy.login('developer'); - cy.visit('/'); + cy.visit('#/customer/list'); + cy.url().then((currentUrl) => (url = currentUrl)); }); - it('should redirect to new customer', () => { - cy.visit('#/customer/1112/basic-data') - cy.openLeftMenu(); - cy.get('.q-item > .q-item__label').should('have.text',' #1112') - cy.closeLeftMenu(); - cy.clearSearchbar(); - cy.writeSearchbar('1{enter}'); - cy.openLeftMenu(); - cy.get('.q-item > .q-item__label').should('have.text',' #1') - cy.closeLeftMenu(); + it('should redirect to customer summary page', () => { + searchAndCheck('1', employeeId); + searchAndCheck('salesPerson', salesPersonId); + }); + + it('should stay on the list page if there are several results or none', () => { + cy.writeSearchbar('salesA{enter}'); + checkCardListAndUrl(2); + + cy.clearSearchbar(); + + cy.writeSearchbar('0{enter}'); + checkCardListAndUrl(0); + }); + + const searchAndCheck = (searchTerm, expectedText) => { + cy.clearSearchbar(); + cy.writeSearchbar(`${searchTerm}{enter}`); + cy.get(idGap).should('have.text', expectedText); + }; + + const checkCardListAndUrl = (expectedLength) => { + cy.get(cardList).then(($cardList) => { + expect($cardList.find('.q-card').length).to.equal(expectedLength); + cy.url().then((currentUrl) => expect(currentUrl).to.equal(url)); }); + }; }); diff --git a/test/vitest/__tests__/components/common/VnSearchBar.spec.js b/test/vitest/__tests__/components/common/VnSearchBar.spec.js index fd0a026ef..0938ae9c0 100644 --- a/test/vitest/__tests__/components/common/VnSearchBar.spec.js +++ b/test/vitest/__tests__/components/common/VnSearchBar.spec.js @@ -1,11 +1,11 @@ -import { vi, describe, expect, it, beforeAll, beforeEach, afterEach } from 'vitest'; -import { createWrapper, axios } from 'app/test/vitest/helper'; +import { vi, describe, expect, it, beforeAll, afterEach, beforeEach } from 'vitest'; +import { createWrapper } from 'app/test/vitest/helper'; import VnSearchbar from 'components/ui/VnSearchbar.vue'; - - +// Probar a importar como plugin vue-router en archivo helper describe('VnSearchBar', () => { let vm; let wrapper; + let pushSpy; beforeAll(() => { wrapper = createWrapper(VnSearchbar, { @@ -16,7 +16,7 @@ describe('VnSearchBar', () => { }, }); vm = wrapper.vm; - vm.route.matched = [ + vm.router.currentRoute.value.matched = [ { path: '/', }, @@ -30,24 +30,33 @@ describe('VnSearchBar', () => { path: '/customer/:id/basic-data', }, ]; + + pushSpy = vi.spyOn(vm.router, 'push'); + vi.spyOn(vm.arrayData, 'applyFilter'); }); - afterEach(() => { - vi.clearAllMocks(); - }); + beforeEach(() => (vm.store.data = [{ id: 1112, name: 'Trash' }])); + afterEach(() => vi.clearAllMocks()); + it('should be defined', async () => { expect(vm.searchText).toBeDefined(); expect(vm.searchText).toEqual(''); }); - it('should redirect', async () => { - vi.spyOn(vm.router,'push'); - vm.searchText = '1'; + + it('should redirect to list page if there are several results', async () => { + vm.store.data.push({ id: 1, name: 'employee' }); await vm.search(); - expect(vm.router.push).toHaveBeenCalledWith('/customer/1/basic-data'); - vm.searchText = '1112'; - expect(vm.searchText).toEqual('1112'); - vi.spyOn(vm.router,'push'); + expect(pushSpy).toHaveBeenCalledWith({ path: '/customer/list' }); + }); + + it('should redirect to list page if there is no results', async () => { + vm.store.data.pop(); await vm.search(); - expect(vm.router.push).toHaveBeenCalledWith('/customer/1112/basic-data'); - }); + expect(pushSpy).toHaveBeenCalledWith({ path: '/customer/list' }); + }); + + it('should redirect to basic-data page if there is only one result', async () => { + await vm.search(); + expect(pushSpy).toHaveBeenCalledWith({ path: '/customer/1112/basic-data' }); + }); }); From da93b9cca84110ed741be04de609d6509616be98 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 28 Mar 2024 07:20:54 +0100 Subject: [PATCH 09/11] updates --- src/composables/usePrintService.js | 4 ++-- src/pages/InvoiceOut/InvoiceOutList.vue | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/composables/usePrintService.js b/src/composables/usePrintService.js index 110e4d864..edf9598b2 100644 --- a/src/composables/usePrintService.js +++ b/src/composables/usePrintService.js @@ -4,7 +4,7 @@ import { useQuasar } from 'quasar'; export function usePrintService() { const quasar = useQuasar(); - const { getToken } = useSession(); + const { getTokenMultimedia } = useSession(); function sendEmail(path, params) { return axios.post(path, params).then(() => @@ -19,7 +19,7 @@ export function usePrintService() { function openReport(path, params) { params = Object.assign( { - access_token: getToken(), + access_token: getTokenMultimedia(), }, params ); diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue index 266dac26e..c77502af5 100644 --- a/src/pages/InvoiceOut/InvoiceOutList.vue +++ b/src/pages/InvoiceOut/InvoiceOutList.vue @@ -22,7 +22,7 @@ const { t } = useI18n(); const router = useRouter(); const stateStore = useStateStore(); const session = useSession(); -const token = session.getToken(); +const tokenMultimedia = session.getTokenMultimedia(); const { viewSummary } = useSummaryDialog(); const manualInvoiceDialogRef = ref(null); @@ -66,7 +66,7 @@ const openPdf = () => { if (selectedCards.value.size === 1) { const [invoiceOut] = selectedCardsArray; - const url = `api/InvoiceOuts/${invoiceOut.id}/download?access_token=${token}`; + const url = `api/InvoiceOuts/${invoiceOut.id}/download?access_token=${tokenMultimedia}`; window.open(url, '_blank'); } else { const invoiceOutIdsArray = selectedCardsArray.map( @@ -75,7 +75,7 @@ const openPdf = () => { const invoiceOutIds = invoiceOutIdsArray.join(','); const params = new URLSearchParams({ - access_token: token, + access_token: tokenMultimedia, ids: invoiceOutIds, }); From b2691a35e113660c66562f054dd5ffef64953dc3 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 28 Mar 2024 08:31:56 +0100 Subject: [PATCH 10/11] refactor: refs #6514 fixed tranlation --- src/components/common/VnDms.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/common/VnDms.vue b/src/components/common/VnDms.vue index 08255f8a5..bf3f4d384 100644 --- a/src/components/common/VnDms.vue +++ b/src/components/common/VnDms.vue @@ -198,9 +198,11 @@ function addDefaultData(data) { en: contentTypesInfo: Allowed file types {allowedContentTypes} EntryDmsDescription: Reference {reference} + SupplierDmsDescription: Reference {reference} es: Generate identifier for original file: Generar identificador para archivo original contentTypesInfo: Tipos de archivo permitidos {allowedContentTypes} EntryDmsDescription: Referencia {reference} + SupplierDmsDescription: Referencia {reference} From 87825daa8e2be8fcf0e1afc02a6728aaea44c2fc Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 28 Mar 2024 09:23:12 +0100 Subject: [PATCH 11/11] refs #7152 deploy: init version 24.16 --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d15ad787d..555b4f0ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2416.01] - 2024-04-18 + +### Added + ## [2414.01] - 2024-04-04 ### Added diff --git a/package.json b/package.json index a35020b66..82f21efe6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.14.0", + "version": "24.16.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura",