From 3f1c0b95faf7d8ff00b10fa93acdbed4047d6b9a Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 10 Jul 2024 15:03:25 +0200 Subject: [PATCH 01/31] fix: proposal to avoid notify error --- src/pages/Customer/Card/CustomerUnpaid.vue | 2 +- src/pages/Customer/Card/CustomerWebAccess.vue | 2 +- src/pages/Customer/components/CustomerChangePassword.vue | 2 +- src/pages/Customer/components/CustomerSamplesCreate.vue | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/Customer/Card/CustomerUnpaid.vue b/src/pages/Customer/Card/CustomerUnpaid.vue index a9d4a3d66..6c61b92a1 100644 --- a/src/pages/Customer/Card/CustomerUnpaid.vue +++ b/src/pages/Customer/Card/CustomerUnpaid.vue @@ -92,7 +92,7 @@ const onSubmit = async () => { notify('globals.dataSaved', 'positive'); unpaidClient.value = true; } catch (error) { - notify('errors.create', 'negative'); + notify('errors.writeRequest', 'negative'); } finally { isLoading.value = false; } diff --git a/src/pages/Customer/Card/CustomerWebAccess.vue b/src/pages/Customer/Card/CustomerWebAccess.vue index 33659dd77..4468c52f0 100644 --- a/src/pages/Customer/Card/CustomerWebAccess.vue +++ b/src/pages/Customer/Card/CustomerWebAccess.vue @@ -70,7 +70,7 @@ const onSubmit = async () => { notify('globals.dataSaved', 'positive'); if (usersPreviewRef.value) usersPreviewRef.value.fetch(); } catch (error) { - notify('errors.create', 'negative'); + notify('errors.writeRequest', 'negative'); } finally { isLoading.value = false; } diff --git a/src/pages/Customer/components/CustomerChangePassword.vue b/src/pages/Customer/components/CustomerChangePassword.vue index 1bfc5e103..632b11dc9 100644 --- a/src/pages/Customer/components/CustomerChangePassword.vue +++ b/src/pages/Customer/components/CustomerChangePassword.vue @@ -48,7 +48,7 @@ const onSubmit = async () => { await axios.patch(`Clients/${$props.id}/setPassword`, payload); await $props.promise(); } catch (error) { - notify('errors.create', 'negative'); + notify('errors.writeRequest', 'negative'); } finally { isLoading.value = false; if (closeButton.value) closeButton.value.click(); diff --git a/src/pages/Customer/components/CustomerSamplesCreate.vue b/src/pages/Customer/components/CustomerSamplesCreate.vue index be614aa0b..283b8fa97 100644 --- a/src/pages/Customer/components/CustomerSamplesCreate.vue +++ b/src/pages/Customer/components/CustomerSamplesCreate.vue @@ -150,7 +150,7 @@ const onSubmit = async () => { notify('globals.dataSaved', 'positive'); onDataSaved(data); } catch (error) { - notify('errors.create', 'negative'); + notify('errors.writeRequest', 'negative'); } finally { isLoading.value = false; } From e90b78c4c5867f2afd48b9029c9b443d5291c385 Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 13 Sep 2024 12:27:37 +0200 Subject: [PATCH 02/31] fix: refs #7702 rollback --- src/pages/Customer/Card/CustomerWebAccess.vue | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/pages/Customer/Card/CustomerWebAccess.vue b/src/pages/Customer/Card/CustomerWebAccess.vue index 3dc025d9c..f990e720c 100644 --- a/src/pages/Customer/Card/CustomerWebAccess.vue +++ b/src/pages/Customer/Card/CustomerWebAccess.vue @@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import axios from 'axios'; import { useQuasar } from 'quasar'; -import useNotify from 'src/composables/useNotify'; import VnInput from 'src/components/common/VnInput.vue'; import CustomerChangePassword from 'src/pages/Customer/components/CustomerChangePassword.vue'; import FormModel from 'components/FormModel.vue'; @@ -13,7 +12,6 @@ const { t } = useI18n(); const quasar = useQuasar(); const route = useRoute(); const canChangePassword = ref(0); -const { notify } = useNotify(); const filter = computed(() => { return { @@ -32,13 +30,8 @@ const showChangePasswordDialog = () => { }; async function hasCustomerRole() { - try { - canChangePassword.value = ( - await axios(`Clients/${route.params.id}/hasCustomerRole`) - ).data; - } catch (e) { - notify('errors.writeRequest', 'negative'); - } + const { data } = await axios(`Clients/${route.params.id}/hasCustomerRole`); + canChangePassword.value = data; } From 4bf8e1224d1d8cd0082174fe7830baeeddc45b0c Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 13 Sep 2024 12:28:07 +0200 Subject: [PATCH 03/31] chore: refs #7702 rollback --- src/pages/Customer/Card/CustomerWebAccess.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Customer/Card/CustomerWebAccess.vue b/src/pages/Customer/Card/CustomerWebAccess.vue index f990e720c..8d025a365 100644 --- a/src/pages/Customer/Card/CustomerWebAccess.vue +++ b/src/pages/Customer/Card/CustomerWebAccess.vue @@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import axios from 'axios'; import { useQuasar } from 'quasar'; + import VnInput from 'src/components/common/VnInput.vue'; import CustomerChangePassword from 'src/pages/Customer/components/CustomerChangePassword.vue'; import FormModel from 'components/FormModel.vue'; From 98cdeabe9f91791faa4a623ed9e67237180b0666 Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 13 Sep 2024 18:15:28 +0200 Subject: [PATCH 04/31] feat: refs #7702 vnChangePassword --- src/components/common/VnChangePassword.vue | 112 ++++++++++++++++++ src/pages/Customer/Card/CustomerWebAccess.vue | 28 ++--- 2 files changed, 124 insertions(+), 16 deletions(-) create mode 100644 src/components/common/VnChangePassword.vue diff --git a/src/components/common/VnChangePassword.vue b/src/components/common/VnChangePassword.vue new file mode 100644 index 000000000..d7c9ad02f --- /dev/null +++ b/src/components/common/VnChangePassword.vue @@ -0,0 +1,112 @@ + + + + +es: + Change password: Cambiar contraseña + New password: Nueva contraseña + Repeat password: Repetir contraseña + You must enter a new password: Debes introducir la nueva contraseña + Passwords don't match: Las contraseñas no coinciden + diff --git a/src/pages/Customer/Card/CustomerWebAccess.vue b/src/pages/Customer/Card/CustomerWebAccess.vue index 8d025a365..ba906a144 100644 --- a/src/pages/Customer/Card/CustomerWebAccess.vue +++ b/src/pages/Customer/Card/CustomerWebAccess.vue @@ -3,14 +3,11 @@ import { computed, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import axios from 'axios'; -import { useQuasar } from 'quasar'; - import VnInput from 'src/components/common/VnInput.vue'; -import CustomerChangePassword from 'src/pages/Customer/components/CustomerChangePassword.vue'; import FormModel from 'components/FormModel.vue'; +import VnChangePassword from 'src/components/common/VnChangePassword.vue'; const { t } = useI18n(); -const quasar = useQuasar(); const route = useRoute(); const canChangePassword = ref(0); @@ -21,21 +18,11 @@ const filter = computed(() => { }; }); -const showChangePasswordDialog = () => { - quasar.dialog({ - component: CustomerChangePassword, - componentProps: { - id: route.params.id, - }, - }); -}; - async function hasCustomerRole() { const { data } = await axios(`Clients/${route.params.id}/hasCustomerRole`); canChangePassword.value = data; } - + - es: Enable web access: Habilitar acceso web From 9ec2fb4c77edede9e5b80a34a80263a33ac80a1c Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 16 Sep 2024 10:36:56 +0200 Subject: [PATCH 05/31] feat: refs #7702 fine tunning --- src/components/common/VnChangePassword.vue | 14 +++++++- src/pages/Worker/Card/WorkerDescriptor.vue | 40 ++++++++++------------ 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/components/common/VnChangePassword.vue b/src/components/common/VnChangePassword.vue index d7c9ad02f..a36c6bcff 100644 --- a/src/components/common/VnChangePassword.vue +++ b/src/components/common/VnChangePassword.vue @@ -7,7 +7,7 @@ import FetchData from '../FetchData.vue'; import useNotify from 'src/composables/useNotify'; const props = defineProps({ submitFn: { type: Function, default: () => {} } }); - +const emit = defineEmits(['onSubmit']); const { t } = useI18n(); const { notify } = useNotify(); @@ -15,19 +15,27 @@ const form = ref(); const changePassDialog = ref(); const passwords = ref({ newPassword: null, repeatPassword: null }); const requirements = ref([]); +const isLoading = ref(false); const validate = async () => { const { newPassword, repeatPassword } = passwords.value; + if (!newPassword) { + notify(t('You must enter a new password'), 'negative'); + return; + } if (newPassword !== repeatPassword) { notify(t("Passwords don't match"), 'negative'); return; } try { + isLoading.value = true; await props.submitFn(newPassword); + emit('onSubmit'); } catch (e) { notify('errors.writeRequest', 'negative'); } finally { changePassDialog.value.hide(); + isLoading.value = false; } }; @@ -84,6 +92,8 @@ defineExpose({ show: () => changePassDialog.value.show() }); changePassDialog.value.show() }); v-close-popup /> { showEditPhotoForm.value = !showEditPhotoForm.value; }; - const entityId = computed(() => { return $props.id || route.params.id; }); - -const worker = ref(); const workerExcluded = ref(false); const getIsExcluded = async () => { @@ -61,10 +56,10 @@ const handleExcluded = async () => { workerExcluded.value = !workerExcluded.value; }; + const handlePhotoUpdated = (evt = false) => { image.value.reload(evt); }; -const refetch = async () => await cardDescriptorRef.value.getData(); @@ -197,6 +184,15 @@ const refetch = async () => await cardDescriptorRef.value.getData(); + es: Create training course: Crear curso de formación diff --git a/src/pages/Worker/Card/WorkerMedical.vue b/src/pages/Worker/Card/WorkerMedical.vue index 6bca4ae85..fab1416c9 100644 --- a/src/pages/Worker/Card/WorkerMedical.vue +++ b/src/pages/Worker/Card/WorkerMedical.vue @@ -65,6 +65,18 @@ const columns = [ create: true, component: 'input', }, + { + align: 'right', + name: 'tableActions', + actions: [ + { + title: t('delete'), + icon: 'delete', + action: async (row) => await tableRef.value.CrudModelRef.remove([row]), + isPrimary: true, + }, + ], + }, ]; From f809e0fb317de0c4762cb684bc3bb58f870d8958 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 23 Sep 2024 12:55:39 +0200 Subject: [PATCH 13/31] fix: refs #7323 show prev month week color --- src/pages/Worker/Card/WorkerTimeControl.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/pages/Worker/Card/WorkerTimeControl.vue b/src/pages/Worker/Card/WorkerTimeControl.vue index fbfd4b28d..c6ca9d74a 100644 --- a/src/pages/Worker/Card/WorkerTimeControl.vue +++ b/src/pages/Worker/Card/WorkerTimeControl.vue @@ -326,16 +326,21 @@ const updateData = async () => { }; const getMailStates = async (date) => { + const url = `WorkerTimeControls/${route.params.id}/getMailStates`; + const month = date.getMonth() + 1; + const prevMonth = month == 1 ? 12 : month - 1; + let prevMonthStates = []; + const params = { - month: date.getMonth() + 1, + month, year: date.getFullYear(), }; - const { data } = await axios.get( - `WorkerTimeControls/${route.params.id}/getMailStates`, - { params } - ); - workerTimeControlMails.value = data; + const curMonthStates = (await axios.get(url, { params })).data; + prevMonthStates = (await axios.get(url, { params: { ...params, month: prevMonth } })) + .data; + + workerTimeControlMails.value = curMonthStates.concat(prevMonthStates); }; const showWorkerTimeForm = (propValue, formType) => { From e827d3aabfb3b03b39e01593bb2af12b4f443016 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 26 Sep 2024 09:47:54 +0200 Subject: [PATCH 14/31] fix: refs #7323 rollback --- src/pages/Worker/WorkerFilter.vue | 5 ----- src/pages/Worker/WorkerList.vue | 20 +------------------- src/pages/Worker/locale/en.yml | 2 +- src/pages/Worker/locale/es.yml | 2 +- 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/src/pages/Worker/WorkerFilter.vue b/src/pages/Worker/WorkerFilter.vue index 61120f448..dfb5659fe 100644 --- a/src/pages/Worker/WorkerFilter.vue +++ b/src/pages/Worker/WorkerFilter.vue @@ -84,11 +84,6 @@ const getLocale = (label) => { /> - - - - - diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue index a5281b651..3ca0d0c24 100644 --- a/src/pages/Worker/WorkerList.vue +++ b/src/pages/Worker/WorkerList.vue @@ -40,7 +40,7 @@ const columns = computed(() => [ { align: 'left', name: 'firstName', - label: t('tableColumns.name'), + label: t('tableColumns.firstName'), isTitle: true, columnFilter: { name: 'firstName', @@ -78,24 +78,6 @@ const columns = computed(() => [ }, format: (row, dashIfEmpty) => dashIfEmpty(row.department), }, - { - align: 'left', - name: 'fi', - label: t('tableColumns.fi'), - isTitle: true, - columnFilter: { - name: 'fi', - }, - }, - { - align: 'left', - name: 'SSN', - label: t('tableColumns.SSN'), - isTitle: true, - columnFilter: { - name: 'SSN', - }, - }, { align: 'left', name: 'email', diff --git a/src/pages/Worker/locale/en.yml b/src/pages/Worker/locale/en.yml index 7081e8fd0..865e86e7e 100644 --- a/src/pages/Worker/locale/en.yml +++ b/src/pages/Worker/locale/en.yml @@ -1,7 +1,7 @@ passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n' tableColumns: id: ID - name: Name + firstName: First name lastName: Last Name userName: User Name department: Department diff --git a/src/pages/Worker/locale/es.yml b/src/pages/Worker/locale/es.yml index 61694dc83..b3c093ec5 100644 --- a/src/pages/Worker/locale/es.yml +++ b/src/pages/Worker/locale/es.yml @@ -6,7 +6,7 @@ External: Externo passwordRequirements: 'La contraseña debe tener al menos { length } caracteres de longitud, {nAlpha} caracteres alfabéticos, {nUpper} letras mayúsculas, {nDigits} dígitos y {nPunct} símbolos (Ej: $%&.)' tableColumns: id: ID - name: Nombre + firstName: Nombre lastName: Apellidos userName: Nombre de usuario department: Departamento From c2b52473a12da9e856a3baa1889ba6702286c8fe Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 26 Sep 2024 10:04:16 +0200 Subject: [PATCH 15/31] fix: refs #7323 align tables --- src/pages/Monitor/MonitorOrders.vue | 56 +++++++++++++++-------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/src/pages/Monitor/MonitorOrders.vue b/src/pages/Monitor/MonitorOrders.vue index 52d442d0a..853a6edc9 100644 --- a/src/pages/Monitor/MonitorOrders.vue +++ b/src/pages/Monitor/MonitorOrders.vue @@ -139,33 +139,35 @@ const openTab = (id) => :disable-option="{ card: true }" > diff --git a/src/pages/Account/Card/AccountCard.vue b/src/pages/Account/Card/AccountCard.vue index 67fa15898..119a7fd07 100644 --- a/src/pages/Account/Card/AccountCard.vue +++ b/src/pages/Account/Card/AccountCard.vue @@ -10,7 +10,7 @@ const { t } = useI18n(); Date: Fri, 4 Oct 2024 11:45:10 +0200 Subject: [PATCH 23/31] feat: refs #7702 ask old pass --- src/components/common/VnChangePassword.vue | 26 ++++++++++------- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + .../Account/Card/AccountDescriptorMenu.vue | 28 ++++++++++++++++++- src/pages/Customer/Card/CustomerWebAccess.vue | 3 +- src/pages/Worker/Card/WorkerDescriptor.vue | 3 +- 6 files changed, 47 insertions(+), 15 deletions(-) diff --git a/src/components/common/VnChangePassword.vue b/src/components/common/VnChangePassword.vue index 18f538fc3..79784f3c5 100644 --- a/src/components/common/VnChangePassword.vue +++ b/src/components/common/VnChangePassword.vue @@ -6,7 +6,10 @@ import VnInput from './VnInput.vue'; import FetchData from '../FetchData.vue'; import useNotify from 'src/composables/useNotify'; -const props = defineProps({ submitFn: { type: Function, default: () => {} } }); +const props = defineProps({ + submitFn: { type: Function, default: () => {} }, + askOldPass: { type: Boolean, default: false }, +}); const emit = defineEmits(['onSubmit']); const { t } = useI18n(); const { notify } = useNotify(); @@ -18,8 +21,7 @@ const requirements = ref([]); const isLoading = ref(false); const validate = async () => { - const { newPassword, repeatPassword } = passwords.value; - console.log('Validating passwords:', newPassword, repeatPassword); + const { newPassword, repeatPassword, oldPassword } = passwords.value; if (!newPassword) { notify(t('You must enter a new password'), 'negative'); @@ -29,17 +31,14 @@ const validate = async () => { notify(t("Passwords don't match"), 'negative'); return; } + try { isLoading.value = true; - console.log('Calling submitFn with:', newPassword); - - await props.submitFn(newPassword); + await props.submitFn(newPassword, oldPassword); emit('onSubmit'); } catch (e) { - console.error('submitFn failed:', e); notify('errors.writeRequest', 'negative'); } finally { - console.log('Entering finally block'); changePassDialog.value.hide(); isLoading.value = false; } @@ -58,7 +57,7 @@ defineExpose({ show: () => changePassDialog.value.show() }); - + changePassDialog.value.show() }); + changePassDialog.value.show() }); es: - Change password: Cambiar contraseña New password: Nueva contraseña Repeat password: Repetir contraseña You must enter a new password: Debes introducir la nueva contraseña diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 4c559dfdf..b76c147cd 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -300,6 +300,7 @@ globals: from: From To: To stateFk: State + changePass: Change password errors: statusUnauthorized: Access denied statusInternalServerError: An internal server error has ocurred diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 7cb17aad3..d0d5bdc0d 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -304,6 +304,7 @@ globals: from: Desde To: Hasta stateFk: Estado + changePass: Cambiar contraseña errors: statusUnauthorized: Acceso denegado statusInternalServerError: Ha ocurrido un error interno del servidor diff --git a/src/pages/Account/Card/AccountDescriptorMenu.vue b/src/pages/Account/Card/AccountDescriptorMenu.vue index 0e35d25f3..6f1d2ca1f 100644 --- a/src/pages/Account/Card/AccountDescriptorMenu.vue +++ b/src/pages/Account/Card/AccountDescriptorMenu.vue @@ -4,9 +4,12 @@ import { computed, ref, toRefs } from 'vue'; import { useI18n } from 'vue-i18n'; import { useVnConfirm } from 'composables/useVnConfirm'; import { useRoute } from 'vue-router'; +import { useAcl } from 'src/composables/useAcl'; import { useArrayData } from 'src/composables/useArrayData'; import VnConfirm from 'src/components/ui/VnConfirm.vue'; +import VnChangePassword from 'src/components/common/VnChangePassword.vue'; import useNotify from 'src/composables/useNotify.js'; + const $props = defineProps({ hasAccount: { type: Boolean, @@ -62,6 +65,19 @@ async function sync() { } + + {{ t('globals.changePass') }} + {{ t('account.card.actions.sync.name') }} - diff --git a/src/pages/Customer/Card/CustomerWebAccess.vue b/src/pages/Customer/Card/CustomerWebAccess.vue index ba906a144..1db32c752 100644 --- a/src/pages/Customer/Card/CustomerWebAccess.vue +++ b/src/pages/Customer/Card/CustomerWebAccess.vue @@ -56,7 +56,7 @@ async function hasCustomerRole() { @@ -209,5 +209,4 @@ const handlePhotoUpdated = (evt = false) => { es: Click to allow the user to be disabled: Marcar para deshabilitar Click to exclude the user from getting disabled: Marcar para no deshabilitar - Change password: Cambiar contraseña From ae8e4ba4b975b1c6381fabec08de18cbc190f978 Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 4 Oct 2024 11:54:40 +0200 Subject: [PATCH 24/31] chore: refs #7702 fix tests --- .../common/VnChangePassword.spec.js | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/test/vitest/__tests__/components/common/VnChangePassword.spec.js b/test/vitest/__tests__/components/common/VnChangePassword.spec.js index e7a3bdcf7..f5a967bb5 100644 --- a/test/vitest/__tests__/components/common/VnChangePassword.spec.js +++ b/test/vitest/__tests__/components/common/VnChangePassword.spec.js @@ -50,10 +50,21 @@ describe('VnSmsDialog', () => { ); }); - it('should call submitFn and emit onSubmit when passwords match', async () => { - vm.passwords.newPassword = 'password'; - vm.passwords.repeatPassword = 'password'; - await vm.validate(); - expect(vm.props.submitFn).toHaveBeenCalledWith('password'); + describe('if passwords match', () => { + it('should call submitFn and emit password', async () => { + vm.passwords.newPassword = 'password'; + vm.passwords.repeatPassword = 'password'; + await vm.validate(); + expect(vm.props.submitFn).toHaveBeenCalledWith('password', undefined); + }); + + it('should call submitFn and emit password and old password', async () => { + vm.passwords.newPassword = 'password'; + vm.passwords.repeatPassword = 'password'; + vm.passwords.oldPassword = 'oldPassword'; + + await vm.validate(); + expect(vm.props.submitFn).toHaveBeenCalledWith('password', 'oldPassword'); + }); }); }); From 195747b5a0e938f3fe89779a4775ddeb79e22f72 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 4 Oct 2024 12:34:37 +0200 Subject: [PATCH 25/31] feat: added click and transfer tickets and deleted useless code --- src/pages/Ticket/Card/TicketTransfer.vue | 38 ++++++-------------- src/pages/Ticket/Card/TicketTransferForm.vue | 7 ++-- 2 files changed, 14 insertions(+), 31 deletions(-) diff --git a/src/pages/Ticket/Card/TicketTransfer.vue b/src/pages/Ticket/Card/TicketTransfer.vue index 1944b80f4..e1a011a84 100644 --- a/src/pages/Ticket/Card/TicketTransfer.vue +++ b/src/pages/Ticket/Card/TicketTransfer.vue @@ -1,13 +1,11 @@ From 3a21f6aadb5d3aa50fdff0d85d1c2e81532f5f87 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 4 Oct 2024 14:22:00 +0200 Subject: [PATCH 28/31] fix: order catalog --- src/pages/Order/Card/OrderCatalog.vue | 1 + .../Order/Card/OrderCatalogItemDialog.vue | 21 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/pages/Order/Card/OrderCatalog.vue b/src/pages/Order/Card/OrderCatalog.vue index 68bf9511f..b13e8661d 100644 --- a/src/pages/Order/Card/OrderCatalog.vue +++ b/src/pages/Order/Card/OrderCatalog.vue @@ -130,4 +130,5 @@ function extractValueTags(items) { es: You can search items by name or id: Puedes buscar items por nombre o id + Search items: Buscar items diff --git a/src/pages/Order/Card/OrderCatalogItemDialog.vue b/src/pages/Order/Card/OrderCatalogItemDialog.vue index 46a50c021..09a25fcb8 100644 --- a/src/pages/Order/Card/OrderCatalogItemDialog.vue +++ b/src/pages/Order/Card/OrderCatalogItemDialog.vue @@ -20,8 +20,10 @@ const props = defineProps({ const fields = ref((props.prices || []).map((item) => ({ ...item, quantity: 0 }))); const descriptorData = useArrayData('orderData'); - +const isLoading = ref(false); const addToOrder = async () => { + if (isLoading.value) return; + isLoading.value = true; const items = (fields.value || []).filter((item) => Number(item.quantity) > 0); await axios.post('/OrderRows/addToOrder', { items, @@ -30,6 +32,10 @@ const addToOrder = async () => { notify(t('globals.dataSaved'), 'positive'); emit('added'); descriptorData.fetch({}); + isLoading.value = false; +}; +const canAddToOrder = () => { + return (fields.value || []).some((item) => Number(item.quantity) > 0); }; @@ -68,7 +74,11 @@ const addToOrder = async () => {
- + {{ t('globals.add') }}
@@ -81,3 +91,10 @@ const addToOrder = async () => { width: 200px; } + + +es: + noAmount: La cantidad no puede ser 0 +en: + noAmount: Amount can not be 0 + From aee23c75e86dae184798c64f8642e84e59993c32 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 4 Oct 2024 14:31:39 +0200 Subject: [PATCH 29/31] fix: order module --- src/pages/Order/Card/OrderCatalog.vue | 1 + src/pages/Order/Card/OrderCatalogFilter.vue | 1 + .../Order/Card/OrderCatalogItemDialog.vue | 21 +++++++++++++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/pages/Order/Card/OrderCatalog.vue b/src/pages/Order/Card/OrderCatalog.vue index 68bf9511f..b13e8661d 100644 --- a/src/pages/Order/Card/OrderCatalog.vue +++ b/src/pages/Order/Card/OrderCatalog.vue @@ -130,4 +130,5 @@ function extractValueTags(items) { es: You can search items by name or id: Puedes buscar items por nombre o id + Search items: Buscar items diff --git a/src/pages/Order/Card/OrderCatalogFilter.vue b/src/pages/Order/Card/OrderCatalogFilter.vue index 354c44747..6de43e86a 100644 --- a/src/pages/Order/Card/OrderCatalogFilter.vue +++ b/src/pages/Order/Card/OrderCatalogFilter.vue @@ -247,6 +247,7 @@ function addOrder(value, field, params) { rounded emit-value use-input + sort-by="name ASC" :disable="!selectedCategoryFk" @update:model-value=" (value) => { diff --git a/src/pages/Order/Card/OrderCatalogItemDialog.vue b/src/pages/Order/Card/OrderCatalogItemDialog.vue index 46a50c021..09a25fcb8 100644 --- a/src/pages/Order/Card/OrderCatalogItemDialog.vue +++ b/src/pages/Order/Card/OrderCatalogItemDialog.vue @@ -20,8 +20,10 @@ const props = defineProps({ const fields = ref((props.prices || []).map((item) => ({ ...item, quantity: 0 }))); const descriptorData = useArrayData('orderData'); - +const isLoading = ref(false); const addToOrder = async () => { + if (isLoading.value) return; + isLoading.value = true; const items = (fields.value || []).filter((item) => Number(item.quantity) > 0); await axios.post('/OrderRows/addToOrder', { items, @@ -30,6 +32,10 @@ const addToOrder = async () => { notify(t('globals.dataSaved'), 'positive'); emit('added'); descriptorData.fetch({}); + isLoading.value = false; +}; +const canAddToOrder = () => { + return (fields.value || []).some((item) => Number(item.quantity) > 0); }; @@ -68,7 +74,11 @@ const addToOrder = async () => {
- + {{ t('globals.add') }}
@@ -81,3 +91,10 @@ const addToOrder = async () => { width: 200px; } + + +es: + noAmount: La cantidad no puede ser 0 +en: + noAmount: Amount can not be 0 + From c3c252834280561e6814cfb2e392516736fd95a0 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Sat, 5 Oct 2024 00:31:32 +0200 Subject: [PATCH 30/31] feat: #7356 improve NotesSummary --- src/pages/Ticket/Card/TicketSummary.vue | 37 +++++++++++++++---------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue index 2e85be000..8f359f649 100644 --- a/src/pages/Ticket/Card/TicketSummary.vue +++ b/src/pages/Ticket/Card/TicketSummary.vue @@ -17,6 +17,7 @@ import VnUserLink from 'src/components/ui/VnUserLink.vue'; import VnTitle from 'src/components/common/VnTitle.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import VnSelect from 'src/components/common/VnSelect.vue'; +import { QVirtualScroll } from 'quasar'; const route = useRoute(); const { notify } = useNotify(); @@ -229,22 +230,28 @@ async function changeState(value) { :url="ticketUrl + 'observation'" :text="t('ticket.pageTitles.notes')" /> - + + + {{ item.observationType.description }}: + + {{ item.description }} + - - From 04b2a4d9cec12c2d5e7a572e01a699114501b119 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Sat, 5 Oct 2024 00:31:41 +0200 Subject: [PATCH 31/31] perf: clean warnings --- src/components/VnTable/VnTable.vue | 2 +- src/components/common/VnSelectDialog.vue | 2 +- src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue | 3 --- src/pages/Order/Card/OrderCreateDialog.vue | 4 +--- src/pages/Ticket/Card/TicketSummary.vue | 1 - 5 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 3ed741ac4..f18892a31 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -310,7 +310,7 @@ defineExpose({ params, }); -function handleOnDataSaved(_, res) { +function handleOnDataSaved(_) { if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value }); else $props.create.onDataSaved(_); } diff --git a/src/components/common/VnSelectDialog.vue b/src/components/common/VnSelectDialog.vue index 17f893255..350aa9272 100644 --- a/src/components/common/VnSelectDialog.vue +++ b/src/components/common/VnSelectDialog.vue @@ -1,5 +1,5 @@