From 684215fc4613eb9e24f98775bc713eef916529d5 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 9 Sep 2024 09:59:22 +0200 Subject: [PATCH 01/68] feat(AccountBasicData): add twoFactorFk --- src/pages/Account/Card/AccountBasicData.vue | 9 ++++++++- src/pages/Account/locale/en.yml | 1 + src/pages/Account/locale/es.yml | 1 + test/cypress/integration/outLogin/twoFactor.spec.js | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/pages/Account/Card/AccountBasicData.vue b/src/pages/Account/Card/AccountBasicData.vue index f38299f9e..b223c4bc0 100644 --- a/src/pages/Account/Card/AccountBasicData.vue +++ b/src/pages/Account/Card/AccountBasicData.vue @@ -24,7 +24,7 @@ watch( diff --git a/src/pages/Account/locale/en.yml b/src/pages/Account/locale/en.yml index 3cf861fb2..fe8707eb8 100644 --- a/src/pages/Account/locale/en.yml +++ b/src/pages/Account/locale/en.yml @@ -35,6 +35,7 @@ account: willDeactivated: User will be deactivated activated: User activated! deactivated: User deactivated! + twoFactor: Two factor actions: setPassword: Set password disableAccount: diff --git a/src/pages/Account/locale/es.yml b/src/pages/Account/locale/es.yml index b53a0153c..112ffe9cc 100644 --- a/src/pages/Account/locale/es.yml +++ b/src/pages/Account/locale/es.yml @@ -32,6 +32,7 @@ account: activated: ¡Usuario activado! deactivated: ¡Usuario desactivado! newUser: Nuevo usuario + twoFactor: Doble factor privileges: delegate: Puede delegar privilegios actions: diff --git a/test/cypress/integration/outLogin/twoFactor.spec.js b/test/cypress/integration/outLogin/twoFactor.spec.js index 4d8561f0f..259ddfc0f 100755 --- a/test/cypress/integration/outLogin/twoFactor.spec.js +++ b/test/cypress/integration/outLogin/twoFactor.spec.js @@ -12,7 +12,7 @@ describe('Two Factor', () => { cy.request( 'PATCH', `http://localhost:3000/api/VnUsers/${userId}/update-user?access_token=DEFAULT_TOKEN`, - { twoFactor: 'email' } + { twoFactorFk: 'email' } ); }); From 8be1833f9e7bbf6b9d6bc8163b84eb090ecbb1b8 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 13 Sep 2024 08:49:36 +0200 Subject: [PATCH 02/68] refs #7155 scopeDays --- src/pages/Travel/TravelList.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/pages/Travel/TravelList.vue b/src/pages/Travel/TravelList.vue index c7ad908f9..0fba3a8d3 100644 --- a/src/pages/Travel/TravelList.vue +++ b/src/pages/Travel/TravelList.vue @@ -11,6 +11,7 @@ import TravelSummary from './Card/TravelSummary.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue'; import { toDate } from 'src/filters'; import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js'; +import { dateRange } from 'src/filters'; const { viewSummary } = useSummaryDialog(); const router = useRouter(); const { t } = useI18n(); @@ -29,6 +30,18 @@ const cloneTravel = (travelData) => { redirectToCreateView(stringifiedTravelData); }; +const handleScopeDays = (params, days, callback) => { + const [from, to] = dateRange(Date.vnNew()); + if (!days) { + Object.assign(params, { from, to, scopeDays: 1 }); + } else { + params.from = from; + to.setDate(to.getDate() + days); + params.to = to; + } + if (callback) callback(); +}; + const redirectToCreateView = (queryParams) => { router.push({ name: 'TravelCreate', query: { travelData: queryParams } }); }; From a5ea940dd887b8f540e283c70db99aa0a4a42538 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 13 Sep 2024 09:23:15 +0200 Subject: [PATCH 03/68] fix: Customer module find salesPersons out of first get --- src/pages/Customer/Card/CustomerBasicData.vue | 1 - src/pages/Customer/CustomerList.vue | 1 - 2 files changed, 2 deletions(-) diff --git a/src/pages/Customer/Card/CustomerBasicData.vue b/src/pages/Customer/Card/CustomerBasicData.vue index 91d9edc05..adbd476b0 100644 --- a/src/pages/Customer/Card/CustomerBasicData.vue +++ b/src/pages/Customer/Card/CustomerBasicData.vue @@ -99,7 +99,6 @@ const title = ref(); :fields="['id', 'nickname']" sort-by="nickname ASC" :rules="validate('client.salesPersonFk')" - :use-like="false" emit-value auto-load > diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue index f6758bf4e..270acdb89 100644 --- a/src/pages/Customer/CustomerList.vue +++ b/src/pages/Customer/CustomerList.vue @@ -425,7 +425,6 @@ function handleLocation(data, location) { }" :fields="['id', 'nickname']" sort-by="nickname ASC" - :use-like="false" emit-value auto-load > From 842fb9de5fb1773738cca1d4f236a29171320287 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 13 Sep 2024 12:52:25 +0200 Subject: [PATCH 04/68] refs #7155 scopeDays fix --- src/components/VnTable/VnTable.vue | 1 + src/pages/Travel/TravelList.vue | 43 +++++++++++++++++++----------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 0ed3de261..798213c08 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -301,6 +301,7 @@ defineExpose({ redirect: redirectFn, selected, CrudModelRef, + params, }); function handleOnDataSaved(_) { diff --git a/src/pages/Travel/TravelList.vue b/src/pages/Travel/TravelList.vue index 0fba3a8d3..a0976e92c 100644 --- a/src/pages/Travel/TravelList.vue +++ b/src/pages/Travel/TravelList.vue @@ -12,6 +12,8 @@ import VnSearchbar from 'components/ui/VnSearchbar.vue'; import { toDate } from 'src/filters'; import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js'; import { dateRange } from 'src/filters'; +import VnInputNumber from 'src/components/common/VnInputNumber.vue'; + const { viewSummary } = useSummaryDialog(); const router = useRouter(); const { t } = useI18n(); @@ -25,22 +27,26 @@ const $props = defineProps({ }, }); const entityId = computed(() => $props.id || route.params.id); + +onMounted(async () => { + stateStore.rightDrawer = true; + handleScopeDays(); +}); + const cloneTravel = (travelData) => { const stringifiedTravelData = JSON.stringify(travelData); redirectToCreateView(stringifiedTravelData); }; -const handleScopeDays = (params, days, callback) => { - const [from, to] = dateRange(Date.vnNew()); - if (!days) { - Object.assign(params, { from, to, scopeDays: 1 }); - } else { - params.from = from; - to.setDate(to.getDate() + days); - params.to = to; - } - if (callback) callback(); -}; +function handleScopeDays(days = 7) { + days = +days; + tableRef.value.params.scopeDays = days; + const [landedFrom, landedTo] = dateRange(Date.vnNew()); + landedTo.setDate(landedTo.getDate() + days); + + tableRef.value.params.landedFrom = landedFrom; + tableRef.value.params.landedTo = landedTo; +} const redirectToCreateView = (queryParams) => { router.push({ name: 'TravelCreate', query: { travelData: queryParams } }); @@ -50,10 +56,6 @@ const redirectCreateEntryView = (travelData) => { router.push({ name: 'EntryCreate', query: { travelFk: travelData.id } }); }; -onMounted(async () => { - stateStore.rightDrawer = true; -}); - const columns = computed(() => [ { align: 'left', @@ -254,6 +256,17 @@ const columns = computed(() => [ :class="{ 'is-active': row.isReceived }" /> + From d384894bf0faed5627933188f2bb9270bcfefecc Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 16 Sep 2024 10:29:36 +0000 Subject: [PATCH 05/68] fix: rule --- src/pages/Customer/Card/CustomerBasicData.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Customer/Card/CustomerBasicData.vue b/src/pages/Customer/Card/CustomerBasicData.vue index adbd476b0..bf2bf4b19 100644 --- a/src/pages/Customer/Card/CustomerBasicData.vue +++ b/src/pages/Customer/Card/CustomerBasicData.vue @@ -34,7 +34,7 @@ const title = ref(); Date: Mon, 16 Sep 2024 10:30:04 +0000 Subject: [PATCH 06/68] fix: remove promise execution --- src/pages/Customer/components/CustomerChangePassword.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/Customer/components/CustomerChangePassword.vue b/src/pages/Customer/components/CustomerChangePassword.vue index 1bfc5e103..d92a10c5c 100644 --- a/src/pages/Customer/components/CustomerChangePassword.vue +++ b/src/pages/Customer/components/CustomerChangePassword.vue @@ -46,7 +46,6 @@ const onSubmit = async () => { }; try { await axios.patch(`Clients/${$props.id}/setPassword`, payload); - await $props.promise(); } catch (error) { notify('errors.create', 'negative'); } finally { From 6ffd985575ad24c3b2c3fcacbfe78f618725a0a6 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 16 Sep 2024 13:33:07 +0200 Subject: [PATCH 07/68] perf: CustomerBasicData.salesPersonFk --- src/pages/Customer/Card/CustomerBasicData.vue | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/pages/Customer/Card/CustomerBasicData.vue b/src/pages/Customer/Card/CustomerBasicData.vue index bf2bf4b19..cdd9e68b2 100644 --- a/src/pages/Customer/Card/CustomerBasicData.vue +++ b/src/pages/Customer/Card/CustomerBasicData.vue @@ -16,6 +16,21 @@ const { t } = useI18n(); const businessTypes = ref([]); const contactChannels = ref([]); const title = ref(); +const handleSalesModelValue = (val) => { + if (salesPersonFilter.value.and.length == 0) salesPersonFilter.value.and.push = []; + + salesPersonFilter.value.and[1] = { + or: [ + { name: val }, + { nickname: { like: '%' + val + '%' } }, + { code: { like: `${val}%` } }, + ], + }; +}; + +const salesPersonFilter = ref({ + and: [{ active: { neq: false } }], +}); From 9db12a8deee76b83076b09cff24965f611753383 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 18 Sep 2024 13:46:37 +0200 Subject: [PATCH 19/68] fix: wagon reload --- src/pages/Wagon/Type/WagonTypeList.vue | 2 +- src/pages/Wagon/WagonList.vue | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/Wagon/Type/WagonTypeList.vue b/src/pages/Wagon/Type/WagonTypeList.vue index 2f0d55fbe..c0943c58e 100644 --- a/src/pages/Wagon/Type/WagonTypeList.vue +++ b/src/pages/Wagon/Type/WagonTypeList.vue @@ -103,7 +103,7 @@ async function remove(row) { url-create="WagonTypes" model="WagonType" :form-initial-data="initialData" - @on-data-saved="window.location.reload()" + @on-data-saved="tableRef.reload()" auto-load > diff --git a/src/pages/Order/Card/OrderCatalogFilter.vue b/src/pages/Order/Card/OrderCatalogFilter.vue index 938cc4fe2..354c44747 100644 --- a/src/pages/Order/Card/OrderCatalogFilter.vue +++ b/src/pages/Order/Card/OrderCatalogFilter.vue @@ -374,8 +374,10 @@ function addOrder(value, field, params) { /> - diff --git a/src/pages/Ticket/Card/TicketNotes.vue b/src/pages/Ticket/Card/TicketNotes.vue index cfc0c2431..1b9d98a8b 100644 --- a/src/pages/Ticket/Card/TicketNotes.vue +++ b/src/pages/Ticket/Card/TicketNotes.vue @@ -87,17 +87,18 @@ watch( - {{ t('ticketNotes.addNote') }} - + diff --git a/src/pages/Ticket/Card/TicketPackage.vue b/src/pages/Ticket/Card/TicketPackage.vue index a76fce2b6..c071d4f7f 100644 --- a/src/pages/Ticket/Card/TicketPackage.vue +++ b/src/pages/Ticket/Card/TicketPackage.vue @@ -114,17 +114,20 @@ watch( - - - {{ t('package.addPackage') }} - - + + + + {{ t('package.addPackage') }} + + + diff --git a/src/pages/Worker/Card/WorkerTimeControl.vue b/src/pages/Worker/Card/WorkerTimeControl.vue index 9ae91f8ce..fbfd4b28d 100644 --- a/src/pages/Worker/Card/WorkerTimeControl.vue +++ b/src/pages/Worker/Card/WorkerTimeControl.vue @@ -561,15 +561,16 @@ onMounted(async () => { {{ secondsToHoursMinutes(day.dayData?.workedHours) }} - {{ t('Add time') }} - + From 1550d79160421e7faeb177a9897be7a98a506cb6 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 19 Sep 2024 00:10:28 +0200 Subject: [PATCH 25/68] feat: add shortcut more buttons --- src/components/common/VnDmsList.vue | 9 ++++++++- src/pages/Account/Role/Card/SubRoles.vue | 8 +++++++- src/pages/Claim/Card/ClaimLines.vue | 2 +- src/pages/Claim/Card/ClaimPhoto.vue | 8 +++++++- src/pages/Customer/Card/CustomerFileManagement.vue | 1 + src/pages/Customer/Card/CustomerSamples.vue | 8 +++++++- src/pages/Entry/Card/EntryNotes.vue | 8 +++++++- src/pages/InvoiceIn/Card/InvoiceInBasicData.vue | 1 + src/pages/InvoiceIn/Card/InvoiceInDueDay.vue | 2 +- src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue | 1 + src/pages/InvoiceIn/Card/InvoiceInVat.vue | 1 + src/pages/Item/ItemRequestFilter.vue | 1 + src/pages/Route/Agency/Card/AgencyWorkcenter.vue | 2 +- src/pages/Route/RouteTickets.vue | 2 +- src/pages/Ticket/Card/TicketSale.vue | 3 ++- src/pages/Ticket/Card/TicketService.vue | 8 +++++++- src/pages/Travel/ExtraCommunityFilter.vue | 1 + src/pages/Zone/Delivery/ZoneDeliveryList.vue | 2 +- src/pages/Zone/Upcoming/ZoneUpcomingList.vue | 2 +- 19 files changed, 57 insertions(+), 13 deletions(-) diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue index 16e3c641f..52dd6ef79 100644 --- a/src/components/common/VnDmsList.vue +++ b/src/components/common/VnDmsList.vue @@ -400,7 +400,14 @@ defineExpose({ /> - + {{ t('Upload file') }} diff --git a/src/pages/Account/Role/Card/SubRoles.vue b/src/pages/Account/Role/Card/SubRoles.vue index 7a0088bac..d17f96dd8 100644 --- a/src/pages/Account/Role/Card/SubRoles.vue +++ b/src/pages/Account/Role/Card/SubRoles.vue @@ -142,7 +142,13 @@ const redirectToRoleSummary = (id) => - + {{ t('warehouses.add') }} diff --git a/src/pages/Claim/Card/ClaimLines.vue b/src/pages/Claim/Card/ClaimLines.vue index 77c7dacf1..60c470d22 100644 --- a/src/pages/Claim/Card/ClaimLines.vue +++ b/src/pages/Claim/Card/ClaimLines.vue @@ -317,7 +317,7 @@ async function saveWhenHasChanges() { - + diff --git a/src/pages/Claim/Card/ClaimPhoto.vue b/src/pages/Claim/Card/ClaimPhoto.vue index 21f1be6ed..ec619cc7d 100644 --- a/src/pages/Claim/Card/ClaimPhoto.vue +++ b/src/pages/Claim/Card/ClaimPhoto.vue @@ -246,7 +246,13 @@ function onDrag() {