From 353dcd2567d48ba1f2c5ceffd15185cf50543699 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 5 May 2025 14:36:37 +0200 Subject: [PATCH 01/18] fix(VnUserLink): improve worker existence check and refactor template logic --- src/components/ui/VnUserLink.vue | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/src/components/ui/VnUserLink.vue b/src/components/ui/VnUserLink.vue index 00c50ee34..ec3811505 100644 --- a/src/components/ui/VnUserLink.vue +++ b/src/components/ui/VnUserLink.vue @@ -1,18 +1,41 @@ From ebfc9daacd6f138a3fc610bd13661fec7867f48c Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 6 May 2025 10:17:04 +0200 Subject: [PATCH 02/18] fix(VnUserLink): initialize isWorker to false and simplify error handling --- src/components/ui/VnUserLink.vue | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/ui/VnUserLink.vue b/src/components/ui/VnUserLink.vue index ec3811505..9a25852b3 100644 --- a/src/components/ui/VnUserLink.vue +++ b/src/components/ui/VnUserLink.vue @@ -9,7 +9,7 @@ const $props = defineProps({ workerId: { type: Number, default: null }, defaultName: { type: Boolean, default: false }, }); -const isWorker = ref(); +const isWorker = ref(false); onMounted(async () => { try { @@ -18,10 +18,7 @@ onMounted(async () => { } = await axios(`/Workers/${$props.workerId}/exists`); isWorker.value = exists; } catch (error) { - if (error.status === 403) { - isWorker.value = false; - return; - } + if (error.status === 403) return; throw error; } }); From 9aa1b104c841df5fc017795b4340d766f53b7dde Mon Sep 17 00:00:00 2001 From: jon Date: Tue, 6 May 2025 10:28:11 +0200 Subject: [PATCH 03/18] fix: allow negative amount --- src/pages/Customer/components/CustomerNewPayment.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Customer/components/CustomerNewPayment.vue b/src/pages/Customer/components/CustomerNewPayment.vue index fb3804d55..b41b1ce8c 100644 --- a/src/pages/Customer/components/CustomerNewPayment.vue +++ b/src/pages/Customer/components/CustomerNewPayment.vue @@ -222,6 +222,7 @@ async function getAmountPaid() { clearable v-model.number="data.amountPaid" data-cy="paymentAmount" + :positive="false" /> From 88b460ee998601a800c864bacaf59b8cd2c90f73 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 6 May 2025 11:27:50 +0200 Subject: [PATCH 04/18] test: add VnUserLink stub to VnDmsList and VnLog tests --- src/components/common/__tests__/VnDmsList.spec.js | 3 +++ src/components/common/__tests__/VnLog.spec.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/common/__tests__/VnDmsList.spec.js b/src/components/common/__tests__/VnDmsList.spec.js index ee62f6971..7c469b7db 100644 --- a/src/components/common/__tests__/VnDmsList.spec.js +++ b/src/components/common/__tests__/VnDmsList.spec.js @@ -25,6 +25,9 @@ describe('VnDmsList', () => { deleteModel: 'WorkerDms', downloadModel: 'WorkerDms', }, + global: { + stubs: ['VnUserLink'], + }, }).vm; }); diff --git a/src/components/common/__tests__/VnLog.spec.js b/src/components/common/__tests__/VnLog.spec.js index fcb516cc5..ad2b49294 100644 --- a/src/components/common/__tests__/VnLog.spec.js +++ b/src/components/common/__tests__/VnLog.spec.js @@ -90,7 +90,7 @@ describe('VnLog', () => { vm = createWrapper(VnLog, { global: { - stubs: [], + stubs: ['VnUserLink'], mocks: {}, }, propsData: { From 5a54debbc03a987141efa22ae069c7f07afea9b7 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 6 May 2025 12:35:45 +0200 Subject: [PATCH 05/18] fix: #347390 ticketWeekly --- src/pages/Ticket/TicketWeekly.vue | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/pages/Ticket/TicketWeekly.vue b/src/pages/Ticket/TicketWeekly.vue index d6493550b..3620f729a 100644 --- a/src/pages/Ticket/TicketWeekly.vue +++ b/src/pages/Ticket/TicketWeekly.vue @@ -13,12 +13,14 @@ import { useArrayData } from 'composables/useArrayData'; import useNotify from 'src/composables/useNotify.js'; import axios from 'axios'; import VnTable from 'src/components/VnTable/VnTable.vue'; +import FetchData from 'src/components/FetchData.vue'; const stateStore = useStateStore(); const { t } = useI18n(); const { notify } = useNotify(); const { openConfirmationModal } = useVnConfirm(); const allColumnNames = ref([]); +const agencies = ref([]); const arrayData = useArrayData('WeeklyTickets'); const { store } = arrayData; @@ -51,11 +53,16 @@ const columns = computed(() => [ isTitle: true, cardVisible: true, component: 'select', - attrs: { - url: 'Clients', - optionLabel: 'name', - optionValue: 'id', - isWhere: true, + columnFilter: { + name: 'id', + component: 'select', + alias: 'c', + attrs: { + url: 'Clients', + optionLabel: 'name', + optionValue: 'id', + inWhere: true, + }, }, columnField: { component: null, @@ -167,6 +174,11 @@ onMounted(async () => { - diff --git a/src/components/ui/VnAvatar.vue b/src/components/ui/VnAvatar.vue index 0fe943ee2..7381e46ae 100644 --- a/src/components/ui/VnAvatar.vue +++ b/src/components/ui/VnAvatar.vue @@ -17,7 +17,7 @@ const token = getTokenMultimedia(); const { t } = useI18n(); const src = computed( - () => `/api/Images/user/160x160/${$props.workerId}/download?access_token=${token}` + () => `/api/Images/user/160x160/${$props.workerId}/download?access_token=${token}`, ); const title = computed(() => $props.title?.toUpperCase() || t('globals.system')); const showLetter = ref(false); diff --git a/src/components/ui/VnLogo.vue b/src/components/ui/VnLogo.vue index 3b955289d..3f9d0c915 100644 --- a/src/components/ui/VnLogo.vue +++ b/src/components/ui/VnLogo.vue @@ -13,7 +13,7 @@ const src = computed({ get() { return new URL( `../../assets/${$props.logo}${Dark.isActive ? '_dark' : ''}.svg`, - import.meta.url + import.meta.url, ).href; }, }); diff --git a/src/components/ui/VnNotes.vue b/src/components/ui/VnNotes.vue index 1f17fb9fd..f7c176286 100644 --- a/src/components/ui/VnNotes.vue +++ b/src/components/ui/VnNotes.vue @@ -1,7 +1,7 @@