From c621ccb5a6e35552a25bc203575554c852d9f8d2 Mon Sep 17 00:00:00 2001 From: jcasado Date: Tue, 23 Apr 2024 13:19:21 +0200 Subject: [PATCH 01/46] refs #7113 fix test --- test/cypress/support/commands.js | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index f075d500f..13103950c 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -38,6 +38,15 @@ Cypress.Commands.add('login', (user) => { }, }).then((response) => { window.localStorage.setItem('token', response.body.token); + cy.request({ + method: 'GET', + url: '/api/VnUsers/ShareToken', + headers: { + Authorization: window.localStorage.getItem('token'), + }, + }).then(({ body }) => { + window.localStorage.setItem('tokenMultimedia', body.multimediaToken.id); + }); }); }); @@ -52,16 +61,18 @@ Cypress.Commands.add('getValue', (selector) => { } // Si es un QSelect if ($el.find('.q-select__dropdown-icon').length) { - return cy.get( - selector + - '> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input' - ).invoke('val') + return cy + .get( + selector + + '> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input' + ) + .invoke('val'); } // Si es un QSelect if ($el.find('span').length) { - return cy.get( - selector + ' span' - ).then(($span) => { return $span[0].innerText }) + return cy.get(selector + ' span').then(($span) => { + return $span[0].innerText; + }); } // Puedes añadir un log o lanzar un error si el elemento no es reconocido cy.log('Elemento no soportado'); @@ -132,13 +143,13 @@ Cypress.Commands.add('validateRow', (rowSelector, expectedValues) => { cy.get(rowSelector).within(() => { for (const [index, value] of expectedValues.entries()) { cy.log('CHECKING ', index, value); - if(value === undefined) continue + if (value === undefined) continue; if (typeof value == 'boolean') { const prefix = value ? '' : 'not.'; cy.getValue(`:nth-child(${index + 1})`).should(`${prefix}be.checked`); continue; } - cy.getValue(`:nth-child(${index + 1})`).should('equal', value) + cy.getValue(`:nth-child(${index + 1})`).should('equal', value); } }); }); From 934db329733c81741074a22cdb39ea37446350d6 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Wed, 24 Apr 2024 10:31:33 -0300 Subject: [PATCH 02/46] WIP --- src/components/CrudModel.vue | 1 + src/css/app.scss | 5 + src/pages/Item/Card/ItemTags.vue | 176 ++++++++++++++++++++++++++++++- src/router/modules/item.js | 4 +- 4 files changed, 183 insertions(+), 3 deletions(-) diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index fb3ac10c3..deec0e4fe 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -81,6 +81,7 @@ defineExpose({ hasChanges, saveChanges, getChanges, + formData, }); async function fetch(data) { diff --git a/src/css/app.scss b/src/css/app.scss index 25b484649..9037802ad 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -119,6 +119,11 @@ select:-webkit-autofill { font-variation-settings: 'FILL' 1; } +.fill-icon-on-hover:hover { + font-variation-settings: 'FILL' 1; + cursor: pointer; +} + .vn-table-separation-row { height: 16px !important; background-color: var(--vn-section-color) !important; diff --git a/src/pages/Item/Card/ItemTags.vue b/src/pages/Item/Card/ItemTags.vue index 95f4380e4..bf18c682c 100644 --- a/src/pages/Item/Card/ItemTags.vue +++ b/src/pages/Item/Card/ItemTags.vue @@ -1 +1,175 @@ - + + + + + +es: + Remove tag: Quitar etiqueta + Add tag: Añadir etiqueta + Tag: Etiqueta + Value: Valor + Relevancy: Relevancia + diff --git a/src/router/modules/item.js b/src/router/modules/item.js index 70d49c56c..1b582d8e4 100644 --- a/src/router/modules/item.js +++ b/src/router/modules/item.js @@ -12,7 +12,7 @@ export default { redirect: { name: 'ItemMain' }, menus: { main: ['ItemList', 'WasteBreakdown', 'ItemTypeList'], - card: ['ItemBasicData'], + card: ['ItemBasicData', 'ItemTags'], }, children: [ { @@ -98,7 +98,7 @@ export default { path: 'tags', name: 'ItemTags', meta: { - title: 'Tags', + title: 'tags', icon: 'vn:tags', }, component: () => import('src/pages/Item/Card/ItemTags.vue'), From 42591d078119e6a1051669a104c977f7c6b4abc2 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 25 Apr 2024 14:27:56 +0200 Subject: [PATCH 03/46] feat #7271 router --- src/router/modules/index.js | 2 + src/router/modules/zone.js | 139 +++++++++++++++++++++++++++++++ src/router/routes.js | 2 + src/stores/useNavigationStore.js | 1 + 4 files changed, 144 insertions(+) create mode 100644 src/router/modules/zone.js diff --git a/src/router/modules/index.js b/src/router/modules/index.js index 302ba7fe0..2fe40038f 100644 --- a/src/router/modules/index.js +++ b/src/router/modules/index.js @@ -15,6 +15,7 @@ import Department from './department'; import Entry from './entry'; import roadmap from './roadmap'; import Parking from './parking'; +import Zone from './zone'; export default [ Item, @@ -34,4 +35,5 @@ export default [ Entry, roadmap, Parking, + Zone, ]; diff --git a/src/router/modules/zone.js b/src/router/modules/zone.js new file mode 100644 index 000000000..be11ced11 --- /dev/null +++ b/src/router/modules/zone.js @@ -0,0 +1,139 @@ +import { RouterView } from 'vue-router'; + +export default { + path: '/zone', + name: 'Zone', + meta: { + title: 'zones', + icon: 'vn:zone', + moduleName: 'Zone', + }, + component: RouterView, + redirect: { name: 'ZoneMain' }, + menus: { + main: ['ZoneList', 'ZoneDeliveryList', 'ZoneUpcomingList'], + card: [], + }, + children: [ + { + path: '/zone', + name: 'ZoneMain', + component: () => import('src/pages/Zone/ZoneMain.vue'), + redirect: { name: 'ZoneList' }, + children: [ + { + path: 'list', + name: 'ZoneList', + meta: { + title: 'zonesList', + icon: 'vn:zone', + }, + component: () => import('src/pages/Zone/ZoneList.vue'), + }, + { + path: 'create', + name: 'ZoneCreate', + meta: { + title: 'zoneCreate', + icon: 'create', + }, + component: () => import('src/pages/Zone/ZoneCreate.vue'), + }, + { + path: ':id/edit', + name: 'ZoneEdit', + meta: { + title: 'zoneEdit', + icon: 'edit', + }, + component: () => import('src/pages/Zone/ZoneCreate.vue'), + }, + { + path: 'counter', + name: 'ZoneCounter', + meta: { + title: 'zoneCounter', + icon: 'add_circle', + }, + component: () => import('src/pages/Zone/ZoneCounter.vue'), + }, + ], + }, + { + path: '/zone/delivery', + name: 'ZoneDeliveryMain', + component: () => import('src/pages/Zone/ZoneMain.vue'), + redirect: { name: 'ZoneDeliveryList' }, + children: [ + { + path: 'list', + name: 'ZoneDeliveryList', + meta: { + title: 'deliveryList', + icon: 'today', + }, + component: () => + import('src/pages/Zone/Delivery/ZoneDeliveryList.vue'), + }, + { + path: 'create', + name: 'ZoneDeliveryCreate', + meta: { + title: 'deliveryCreate', + icon: 'create', + }, + component: () => + import('src/pages/Zone/Delivery/ZoneDeliveryCreate.vue'), + }, + { + path: ':id/edit', + name: 'ZoneDeliveryEdit', + meta: { + title: 'deliveryEdit', + icon: 'edit', + }, + component: () => + import('src/pages/Zone/Delivery/ZoneDeliveryCreate.vue'), + }, + ], + }, + { + path: '/zone/upcoming', + name: 'ZoneUpcomingMain', + component: () => import('src/pages/Zone/ZoneMain.vue'), + redirect: { name: 'ZoneUpcomingList' }, + children: [ + { + path: 'list', + name: 'ZoneUpcomingList', + meta: { + title: 'upcomingList', + icon: 'today', + }, + component: () => + import('src/pages/Zone/Upcoming/ZoneUpcomingList.vue'), + }, + { + path: 'create', + name: 'ZoneUpcomingCreate', + meta: { + title: 'upcomingCreate', + icon: 'create', + }, + component: () => + import('src/pages/Zone/Upcoming/ZoneUpcomingCreate.vue'), + }, + { + path: ':id/edit', + name: 'ZoneUpcomingEdit', + meta: { + title: 'upcomingEdit', + icon: 'edit', + }, + component: () => + import('src/pages/Zone/Upcoming/ZoneUpcomingCreate.vue'), + }, + ], + }, + ], +}; diff --git a/src/router/routes.js b/src/router/routes.js index 51e726a62..14bf6665f 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -15,6 +15,7 @@ import order from 'src/router/modules/order'; import entry from 'src/router/modules/entry'; import roadmap from 'src/router/modules/roadmap'; import parking from 'src/router/modules/parking'; +import zone from 'src/router/modules/zone'; const routes = [ { @@ -71,6 +72,7 @@ const routes = [ roadmap, entry, parking, + zone, { path: '/:catchAll(.*)*', name: 'NotFound', diff --git a/src/stores/useNavigationStore.js b/src/stores/useNavigationStore.js index f075301f6..ee1e04e9b 100644 --- a/src/stores/useNavigationStore.js +++ b/src/stores/useNavigationStore.js @@ -21,6 +21,7 @@ export const useNavigationStore = defineStore('navigationStore', () => { 'ticket', 'worker', 'wagon', + 'zone', ]; const pinnedModules = ref([]); const role = useRole(); From b4e3157887e6ace9072ba5f686b9d26046bf2360 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 25 Apr 2024 14:28:06 +0200 Subject: [PATCH 04/46] feat #7271 i18n --- src/i18n/locale/en.yml | 6 ++++++ src/i18n/locale/es.yml | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index ff57bf968..aa65ce08c 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -1165,6 +1165,12 @@ item: type: Type intrastat: Intrastat origin: Origin +zone: + pageTitles: + zones: Zone + zonesList: Zones + deliveryList: Delivery days + upcomingList: Upcoming deliveries components: topbar: {} itemsFilterPanel: diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index f9278a9b0..da421432d 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -287,7 +287,7 @@ customer: hasSepaVnl: Recibido B2B VNL entry: pageTitles: - entries: Entradas + entries: Entrasdadas list: Listado summary: Resumen basicData: Datos básicos @@ -1164,6 +1164,12 @@ item: type: Tipo intrastat: Intrastat origin: Origen +zone: + pageTitles: + zones: Zona + zonesList: Zonas + deliveryList: Días de entrega + upcomingList: Próximos repartos components: topbar: {} itemsFilterPanel: From b1871c33fd0ad1eb86f7ca6985af6ec41a770709 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 25 Apr 2024 14:30:16 +0200 Subject: [PATCH 05/46] feat #7271 Zone Components boilerplate --- src/pages/Zone/Card/ZoneCard.vue | 6 + .../Zone/Delivery/ZoneDeliveryCreate.vue | 432 ++++++++++++++++++ src/pages/Zone/Delivery/ZoneDeliveryList.vue | 81 ++++ .../Zone/Upcoming/ZoneUpcomingCreate.vue | 432 ++++++++++++++++++ src/pages/Zone/Upcoming/ZoneUpcomingList.vue | 81 ++++ src/pages/Zone/ZoneCreate.vue | 184 ++++++++ src/pages/Zone/ZoneList.vue | 97 ++++ src/pages/Zone/ZoneMain.vue | 17 + 8 files changed, 1330 insertions(+) create mode 100644 src/pages/Zone/Card/ZoneCard.vue create mode 100644 src/pages/Zone/Delivery/ZoneDeliveryCreate.vue create mode 100644 src/pages/Zone/Delivery/ZoneDeliveryList.vue create mode 100644 src/pages/Zone/Upcoming/ZoneUpcomingCreate.vue create mode 100644 src/pages/Zone/Upcoming/ZoneUpcomingList.vue create mode 100644 src/pages/Zone/ZoneCreate.vue create mode 100644 src/pages/Zone/ZoneList.vue create mode 100644 src/pages/Zone/ZoneMain.vue diff --git a/src/pages/Zone/Card/ZoneCard.vue b/src/pages/Zone/Card/ZoneCard.vue new file mode 100644 index 000000000..948636c55 --- /dev/null +++ b/src/pages/Zone/Card/ZoneCard.vue @@ -0,0 +1,6 @@ + + diff --git a/src/pages/Zone/Delivery/ZoneDeliveryCreate.vue b/src/pages/Zone/Delivery/ZoneDeliveryCreate.vue new file mode 100644 index 000000000..a48eaf278 --- /dev/null +++ b/src/pages/Zone/Delivery/ZoneDeliveryCreate.vue @@ -0,0 +1,432 @@ + + + + + diff --git a/src/pages/Zone/Delivery/ZoneDeliveryList.vue b/src/pages/Zone/Delivery/ZoneDeliveryList.vue new file mode 100644 index 000000000..c7a3cbcdb --- /dev/null +++ b/src/pages/Zone/Delivery/ZoneDeliveryList.vue @@ -0,0 +1,81 @@ + + + diff --git a/src/pages/Zone/Upcoming/ZoneUpcomingCreate.vue b/src/pages/Zone/Upcoming/ZoneUpcomingCreate.vue new file mode 100644 index 000000000..6bc04c428 --- /dev/null +++ b/src/pages/Zone/Upcoming/ZoneUpcomingCreate.vue @@ -0,0 +1,432 @@ + + + + + diff --git a/src/pages/Zone/Upcoming/ZoneUpcomingList.vue b/src/pages/Zone/Upcoming/ZoneUpcomingList.vue new file mode 100644 index 000000000..5c417df8f --- /dev/null +++ b/src/pages/Zone/Upcoming/ZoneUpcomingList.vue @@ -0,0 +1,81 @@ + + + diff --git a/src/pages/Zone/ZoneCreate.vue b/src/pages/Zone/ZoneCreate.vue new file mode 100644 index 000000000..8c0ba8c17 --- /dev/null +++ b/src/pages/Zone/ZoneCreate.vue @@ -0,0 +1,184 @@ + + + + + diff --git a/src/pages/Zone/ZoneList.vue b/src/pages/Zone/ZoneList.vue new file mode 100644 index 000000000..00502e1f7 --- /dev/null +++ b/src/pages/Zone/ZoneList.vue @@ -0,0 +1,97 @@ + + + diff --git a/src/pages/Zone/ZoneMain.vue b/src/pages/Zone/ZoneMain.vue new file mode 100644 index 000000000..66ce78f23 --- /dev/null +++ b/src/pages/Zone/ZoneMain.vue @@ -0,0 +1,17 @@ + + + From f14d6310514c949c81de6ac07083dd686e37e87b Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 25 Apr 2024 14:32:42 +0200 Subject: [PATCH 06/46] feat #7271 ZoneDescriptor --- src/pages/Zone/Card/ZoneDescriptor.vue | 127 ++++++++++++++++++ .../Zone/Card/ZoneDescriptorMenuItems.vue | 108 +++++++++++++++ src/pages/Zone/Card/ZoneDescriptorProxy.vue | 16 +++ 3 files changed, 251 insertions(+) create mode 100644 src/pages/Zone/Card/ZoneDescriptor.vue create mode 100644 src/pages/Zone/Card/ZoneDescriptorMenuItems.vue create mode 100644 src/pages/Zone/Card/ZoneDescriptorProxy.vue diff --git a/src/pages/Zone/Card/ZoneDescriptor.vue b/src/pages/Zone/Card/ZoneDescriptor.vue new file mode 100644 index 000000000..665cb6f0e --- /dev/null +++ b/src/pages/Zone/Card/ZoneDescriptor.vue @@ -0,0 +1,127 @@ + + + + + +es: + Go to module index: Ir al índice del módulo + The travel will be deleted: El envío será eliminado + Do you want to delete this travel?: ¿Quieres eliminar este envío? + All travels with current agency: Todos los envíos con la agencia actual + diff --git a/src/pages/Zone/Card/ZoneDescriptorMenuItems.vue b/src/pages/Zone/Card/ZoneDescriptorMenuItems.vue new file mode 100644 index 000000000..920d83dfe --- /dev/null +++ b/src/pages/Zone/Card/ZoneDescriptorMenuItems.vue @@ -0,0 +1,108 @@ + + + + + +es: + The travel will be deleted: El envío será eliminado + Do you want to delete this travel?: ¿Quieres eliminar este envío? + diff --git a/src/pages/Zone/Card/ZoneDescriptorProxy.vue b/src/pages/Zone/Card/ZoneDescriptorProxy.vue new file mode 100644 index 000000000..15c5fb0e5 --- /dev/null +++ b/src/pages/Zone/Card/ZoneDescriptorProxy.vue @@ -0,0 +1,16 @@ + + + From cf193b07c58649168bf8f4aeae619768b90ace5b Mon Sep 17 00:00:00 2001 From: wbuezas Date: Fri, 26 Apr 2024 08:02:17 -0300 Subject: [PATCH 07/46] Item tax --- src/components/CrudModel.vue | 8 ++- src/i18n/locale/en.yml | 3 + src/pages/Item/Card/ItemTax.vue | 103 +++++++++++++++++++++++++++++++- 3 files changed, 111 insertions(+), 3 deletions(-) diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index fb3ac10c3..24d848f3b 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -124,11 +124,15 @@ async function onSubmit() { }); } isLoading.value = true; - await saveChanges(); + await saveChanges($props.saveFn ? formData.value : null); } async function saveChanges(data) { - if ($props.saveFn) return $props.saveFn(data, getChanges); + if ($props.saveFn) { + $props.saveFn(data, getChanges); + isLoading.value = false; + return; + } const changes = data || getChanges(); try { await axios.post($props.saveUrl || $props.url + '/crud', changes); diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 04c278abe..d3b18dfe2 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -1123,6 +1123,9 @@ item: fixedPrice: Fixed prices wasteBreakdown: Waste breakdown itemCreate: New item + botanical: Botanical + barcode: Barcodes + tax: Tax descriptor: item: Item buyer: Buyer diff --git a/src/pages/Item/Card/ItemTax.vue b/src/pages/Item/Card/ItemTax.vue index 76663932c..b966eede9 100644 --- a/src/pages/Item/Card/ItemTax.vue +++ b/src/pages/Item/Card/ItemTax.vue @@ -1 +1,102 @@ - + + + + +es: + Country: País + Class: Clase + From 6ae38d26119baf867d039ee29682ed26f360072f Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 29 Apr 2024 09:49:06 +0200 Subject: [PATCH 08/46] refactor: refs #6887 pending claim changes --- src/i18n/locale/en.yml | 3 +- src/i18n/locale/es.yml | 3 +- src/pages/Claim/Card/ClaimDescriptor.vue | 14 +- src/pages/Claim/Card/ClaimSummary.vue | 45 ++++++- src/pages/Zone/Card/ZoneDescriptor.vue | 127 ++++++++++++++++++ .../Zone/Card/ZoneDescriptorMenuItems.vue | 108 +++++++++++++++ src/pages/Zone/Card/ZoneDescriptorProxy.vue | 16 +++ 7 files changed, 309 insertions(+), 7 deletions(-) create mode 100644 src/pages/Zone/Card/ZoneDescriptor.vue create mode 100644 src/pages/Zone/Card/ZoneDescriptorMenuItems.vue create mode 100644 src/pages/Zone/Card/ZoneDescriptorProxy.vue diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index ff57bf968..942018b84 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -513,7 +513,7 @@ claim: records: records card: claimId: Claim ID - assignedTo: Assigned + attendedBy: Attended by created: Created state: State ticketId: Ticket ID @@ -551,6 +551,7 @@ claim: responsible: Responsible worker: Worker redelivery: Redelivery + changeState: Change state basicData: customer: Customer assignedTo: Assigned diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index f9278a9b0..3de5af50c 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -511,7 +511,7 @@ claim: records: registros card: claimId: ID reclamación - assignedTo: Asignada a + attendedBy: Atendida por created: Creada state: Estado ticketId: ID ticket @@ -549,6 +549,7 @@ claim: responsible: Responsable worker: Trabajador redelivery: Devolución + changeState: Cambiar estado basicData: customer: Cliente assignedTo: Asignada a diff --git a/src/pages/Claim/Card/ClaimDescriptor.vue b/src/pages/Claim/Card/ClaimDescriptor.vue index 968f1e294..3b5dd82b8 100644 --- a/src/pages/Claim/Card/ClaimDescriptor.vue +++ b/src/pages/Claim/Card/ClaimDescriptor.vue @@ -11,6 +11,7 @@ import VnLv from 'src/components/ui/VnLv.vue'; import useCardDescription from 'src/composables/useCardDescription'; import VnUserLink from 'src/components/ui/VnUserLink.vue'; import { getUrl } from 'src/composables/getUrl'; +import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue'; const $props = defineProps({ id: { @@ -127,17 +128,24 @@ onMounted(async () => { - + + + import { onMounted, ref, computed } from 'vue'; -import { useRoute } from 'vue-router'; +import { useRoute, useRouter } from 'vue-router'; import { useI18n } from 'vue-i18n'; import { toDate, toCurrency } from 'src/filters'; import CardSummary from 'components/ui/CardSummary.vue'; @@ -13,8 +13,10 @@ import VnUserLink from 'src/components/ui/VnUserLink.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import VnTitle from 'src/components/common/VnTitle.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; +import axios from 'axios'; const route = useRoute(); +const router = useRouter(); const { t } = useI18n(); const { getTokenMultimedia } = useSession(); const token = getTokenMultimedia(); @@ -27,7 +29,7 @@ const $props = defineProps({ }); const entityId = computed(() => $props.id || route.params.id); - +const ClaimStates = ref([]); const claimUrl = ref(); const salixUrl = ref(); const claimDmsRef = ref(); @@ -162,6 +164,10 @@ function openDialog(dmsId) { multimediaSlide.value = dmsId; multimediaDialog.value = true; } +async function changeState(value) { + await axios.patch(`Claims/updateClaim/${entityId.value}`, { claimStateFk: value }); + router.go(route.fullPath); +} +