diff --git a/.husky/addReferenceTag.js b/.husky/addReferenceTag.js index 857d15739..a88baf2e1 100644 --- a/.husky/addReferenceTag.js +++ b/.husky/addReferenceTag.js @@ -26,7 +26,7 @@ if (branchName) { const splitedMsg = msg.split(':'); if (splitedMsg.length > 1) { - const finalMsg = splitedMsg[0] + ': ' + referenceTag + splitedMsg.slice(1).join(':'); + const finalMsg = `${splitedMsg[0]}: ${referenceTag}${splitedMsg.slice(1).join(':')}`; writeFileSync(msgPath, finalMsg); } } diff --git a/cypress.config.js b/cypress.config.js index 7458c0b05..55eefb97e 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -1,6 +1,9 @@ import { defineConfig } from 'cypress'; -let urlHost, reporter, reporterOptions, timeouts; +let urlHost; +let reporter; +let reporterOptions; +let timeouts; if (process.env.CI) { urlHost = 'front'; diff --git a/index.html b/index.html index c1bd4681b..63b2f2f51 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - + <%= productName %> @@ -12,7 +12,12 @@ content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>" /> - + diff --git a/package.json b/package.json index b7b04287d..f903a5ab6 100644 --- a/package.json +++ b/package.json @@ -89,4 +89,4 @@ "vite": "^6.0.11", "vitest": "^0.31.1" } -} \ No newline at end of file +} diff --git a/postcss.config.js b/postcss.config.js index 9ec43d0cb..164f207d4 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,4 +1,3 @@ -/* eslint-disable */ // https://github.com/michael-ciniawsky/postcss-load-config import autoprefixer from 'autoprefixer'; diff --git a/quasar.config.js b/quasar.config.js index 2bc0be37f..227f5840c 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -13,7 +13,7 @@ import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'; import path from 'path'; const target = `http://${process.env.CI ? 'back' : 'localhost'}:3000`; -export default configure(function (/* ctx */) { +export default configure((/* ctx */) => { return { eslint: { // fix: true, diff --git a/quasar.extensions.json b/quasar.extensions.json index 050f605cc..867769090 100644 --- a/quasar.extensions.json +++ b/quasar.extensions.json @@ -1,8 +1,6 @@ { "@quasar/testing-unit-vitest": { - "options": [ - "scripts" - ] + "options": ["scripts"] }, "@quasar/qcalendar": {} } diff --git a/quasar.testing.json b/quasar.testing.json index a59d9af89..6957efe67 100644 --- a/quasar.testing.json +++ b/quasar.testing.json @@ -1,5 +1,5 @@ { - "unit-vitest": { - "runnerCommand": "vitest run" - } -} \ No newline at end of file + "unit-vitest": { + "runnerCommand": "vitest run" + } +} diff --git a/src/App.vue b/src/App.vue index 0217c45c2..bec50ae9d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -39,7 +39,7 @@ quasar.iconMapFn = (iconName) => { \ No newline at end of file + diff --git a/src/components/EntityCalendarGrid.vue b/src/components/EntityCalendarGrid.vue index 09ccaad07..19fb5a061 100644 --- a/src/components/EntityCalendarGrid.vue +++ b/src/components/EntityCalendarGrid.vue @@ -5,18 +5,18 @@ import { useWeekdayStore } from 'src/stores/useWeekdayStore'; import { useArrayData } from 'src/composables/useArrayData'; const props = defineProps({ - dataKey: { - type: String, - required: true, - }, - calendarComponent: { - type: Object, - required: true, - }, - additionalProps: { - type: Object, - default: () => ({}), - } + dataKey: { + type: String, + required: true, + }, + calendarComponent: { + type: Object, + required: true, + }, + additionalProps: { + type: Object, + default: () => ({}), + }, }); const stateStore = useStateStore(); @@ -28,99 +28,99 @@ const lastDay = ref(Date.vnNew()); const months = ref([]); const arrayData = useArrayData(props.dataKey); onMounted(async () => { - const initialDate = Date.vnNew(); - initialDate.setDate(1); - initialDate.setHours(0, 0, 0, 0); - date.value = initialDate; - await nextTick(); - stateStore.rightDrawer = true; + const initialDate = Date.vnNew(); + initialDate.setDate(1); + initialDate.setHours(0, 0, 0, 0); + date.value = initialDate; + await nextTick(); + stateStore.rightDrawer = true; }); onUnmounted(() => arrayData.destroy()); const emit = defineEmits([ - 'update:firstDay', - 'update:lastDay', - 'update:events', - 'onDateSelected', + 'update:firstDay', + 'update:lastDay', + 'update:events', + 'onDateSelected', ]); const date = computed({ - get: () => _date.value, - set: (value) => { - if (!(value instanceof Date)) return; - _date.value = value; - const stamp = value.getTime(); + get: () => _date.value, + set: (value) => { + if (!(value instanceof Date)) return; + _date.value = value; + const stamp = value.getTime(); - firstDay.value = new Date(stamp); - firstDay.value.setDate(1); + firstDay.value = new Date(stamp); + firstDay.value.setDate(1); - lastDay.value = new Date(stamp); - lastDay.value.setMonth(lastDay.value.getMonth() + nMonths.value); - lastDay.value.setDate(0); + lastDay.value = new Date(stamp); + lastDay.value.setMonth(lastDay.value.getMonth() + nMonths.value); + lastDay.value.setDate(0); - months.value = []; - for (let i = 0; i < nMonths.value; i++) { - const monthDate = new Date(stamp); - monthDate.setMonth(value.getMonth() + i); - months.value.push(monthDate); - } + months.value = []; + for (let i = 0; i < nMonths.value; i++) { + const monthDate = new Date(stamp); + monthDate.setMonth(value.getMonth() + i); + months.value.push(monthDate); + } - emit('update:firstDay', firstDay.value); - emit('update:lastDay', lastDay.value); - emit('refresh-events'); - }, + emit('update:firstDay', firstDay.value); + emit('update:lastDay', lastDay.value); + emit('refresh-events'); + }, }); const headerTitle = computed(() => { - if (!months.value?.length) return ''; - const getMonthName = date => - `${weekdayStore.getLocaleMonths[date.getMonth()].locale} ${date.getFullYear()}`; - return `${getMonthName(months.value[0])} - ${getMonthName(months.value[months.value.length - 1])}`; + if (!months.value?.length) return ''; + const getMonthName = (date) => + `${weekdayStore.getLocaleMonths[date.getMonth()].locale} ${date.getFullYear()}`; + return `${getMonthName(months.value[0])} - ${getMonthName(months.value[months.value.length - 1])}`; }); const step = (direction) => { - const newDate = new Date(date.value); - newDate.setMonth(newDate.getMonth() + nMonths.value * direction); - date.value = newDate; + const newDate = new Date(date.value); + newDate.setMonth(newDate.getMonth() + nMonths.value * direction); + date.value = newDate; }; defineExpose({ firstDay, - lastDay + lastDay, }); \ No newline at end of file + +
+ + {{ headerTitle }} + +
+
+ +
+
+ diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 7216eabb7..43a0d63f0 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -380,8 +380,16 @@ defineExpose({ data-cy="saveAndContinueDefaultBtn" v-if="$props.goTo" @click="saveAndGo" - :label="tMobile('globals.saveAndContinue') + ' ' + t('globals.' + $props.goTo.split('/').pop())" - :title="t('globals.saveAndContinue') + ' ' + t('globals.' + $props.goTo.split('/').pop())" + :label=" + tMobile('globals.saveAndContinue') + + ' ' + + t('globals.' + $props.goTo.split('/').pop()) + " + :title=" + t('globals.saveAndContinue') + + ' ' + + t('globals.' + $props.goTo.split('/').pop()) + " :disable="!hasChanges" color="primary" icon="save" diff --git a/src/components/PinnedModules.vue b/src/components/PinnedModules.vue index 5f291b580..095662baa 100644 --- a/src/components/PinnedModules.vue +++ b/src/components/PinnedModules.vue @@ -26,7 +26,7 @@ async function redirect() { if (route?.params?.id) return (window.location.href = await getUrl( - `${section}/${route.params.id}/summary` + `${section}/${route.params.id}/summary`, )); return (window.location.href = await getUrl(section + '/index')); } diff --git a/src/components/RefundInvoiceForm.vue b/src/components/RefundInvoiceForm.vue index 6dcb8b390..cea028d2f 100644 --- a/src/components/RefundInvoiceForm.vue +++ b/src/components/RefundInvoiceForm.vue @@ -55,7 +55,7 @@ const refund = async () => { (data) => ( (rectificativeTypeOptions = data), (invoiceParams.cplusRectificationTypeFk = data.filter( - (type) => type.description == 'I – Por diferencias' + (type) => type.description == 'I – Por diferencias', )[0].id) ) " @@ -68,7 +68,7 @@ const refund = async () => { (data) => ( (siiTypeInvoiceOutsOptions = data), (invoiceParams.siiTypeInvoiceOutFk = data.filter( - (type) => type.code == 'R4' + (type) => type.code == 'R4', )[0].id) ) " diff --git a/src/components/VnSelectProvince.vue b/src/components/VnSelectProvince.vue index d73ee964e..dfd386fc5 100644 --- a/src/components/VnSelectProvince.vue +++ b/src/components/VnSelectProvince.vue @@ -52,7 +52,7 @@ watch( } else filter.value.where = {}; await provincesFetchDataRef.value.fetch({}); emit('onProvinceFetched', provincesOptions.value); - } + }, ); diff --git a/src/components/VnTable/filters/tableFooter.js b/src/components/VnTable/filters/tableFooter.js index 9c7d080f6..610bf2ac0 100644 --- a/src/components/VnTable/filters/tableFooter.js +++ b/src/components/VnTable/filters/tableFooter.js @@ -6,7 +6,7 @@ export default function (initialFooter, data) { }); return acc; }, - { ...initialFooter } + { ...initialFooter }, ); return footer; } diff --git a/src/components/__tests__/CrudModel.spec.js b/src/components/__tests__/CrudModel.spec.js index 475f56aec..2ac820fac 100644 --- a/src/components/__tests__/CrudModel.spec.js +++ b/src/components/__tests__/CrudModel.spec.js @@ -241,7 +241,7 @@ describe('CrudModel', () => { await vm.saveChanges(data); - expect(postMock).toHaveBeenCalledWith(vm.url + '/crud', data); + expect(postMock).toHaveBeenCalledWith(`${vm.url}/crud`, data); expect(vm.isLoading).toBe(false); expect(vm.hasChanges).toBe(false); expect(vm.originalData).toEqual(JSON.parse(JSON.stringify(vm.formData))); diff --git a/src/components/__tests__/Leftmenu.spec.js b/src/components/__tests__/Leftmenu.spec.js index 5bddc104c..0aff101e0 100644 --- a/src/components/__tests__/Leftmenu.spec.js +++ b/src/components/__tests__/Leftmenu.spec.js @@ -142,14 +142,14 @@ describe('getRoutes', () => { const fn = (props) => getRoutes(props, getMethodA, getMethodB); it('should call getMethodB when source is card', () => { - let props = { source: 'methodB' }; + const props = { source: 'methodB' }; fn(props); expect(getMethodB).toHaveBeenCalled(); expect(getMethodA).not.toHaveBeenCalled(); }); it('should call getMethodA when source is main', () => { - let props = { source: 'methodA' }; + const props = { source: 'methodA' }; fn(props); expect(getMethodA).toHaveBeenCalled(); @@ -157,7 +157,7 @@ describe('getRoutes', () => { }); it('should call getMethodA when source is not exists or undefined', () => { - let props = { source: 'methodC' }; + const props = { source: 'methodC' }; expect(() => fn(props)).toThrowError('Method not defined'); expect(getMethodA).not.toHaveBeenCalled(); diff --git a/src/components/common/VnBreadcrumbs.vue b/src/components/common/VnBreadcrumbs.vue index 334ab4d21..f883731ad 100644 --- a/src/components/common/VnBreadcrumbs.vue +++ b/src/components/common/VnBreadcrumbs.vue @@ -15,7 +15,7 @@ let root = ref(null); watchEffect(() => { matched.value = currentRoute.value.matched.filter( - (matched) => !!matched?.meta?.title || !!matched?.meta?.icon + (matched) => !!matched?.meta?.title || !!matched?.meta?.icon, ); breadcrumbs.value.length = 0; if (!matched.value[0]) return; diff --git a/src/components/common/VnLocation.vue b/src/components/common/VnLocation.vue index 5028e876d..fbff1d222 100644 --- a/src/components/common/VnLocation.vue +++ b/src/components/common/VnLocation.vue @@ -21,7 +21,7 @@ watch( (newValue) => { if (!modelValue.value) return; modelValue.value = formatLocation(newValue) ?? null; - } + }, ); const mixinRules = [requiredFieldRule]; @@ -45,7 +45,7 @@ const formatLocation = (obj, properties = locationProperties) => { }); const filteredParts = parts.filter( - (part) => part !== null && part !== undefined && part !== '' + (part) => part !== null && part !== undefined && part !== '', ); return filteredParts.join(', '); diff --git a/src/components/common/VnScroll.vue b/src/components/common/VnScroll.vue index 481371604..4d4aa7bbb 100644 --- a/src/components/common/VnScroll.vue +++ b/src/components/common/VnScroll.vue @@ -2,7 +2,7 @@ import { ref, onMounted, onUnmounted, watch, nextTick } from 'vue'; const props = defineProps({ - scrollTarget: { type: [String, Object], default: 'window' } + scrollTarget: { type: [String, Object], default: 'window' }, }); const scrollPosition = ref(0); @@ -11,9 +11,9 @@ let scrollContainer = null; const onScroll = () => { if (!scrollContainer) return; - scrollPosition.value = - typeof props.scrollTarget === 'object' - ? scrollContainer.scrollTop + scrollPosition.value = + typeof props.scrollTarget === 'object' + ? scrollContainer.scrollTop : window.scrollY; }; @@ -28,18 +28,18 @@ const scrollToTop = () => { }; const updateScrollContainer = (container) => { - if (container) { - if (scrollContainer) { - scrollContainer.removeEventListener('scroll', onScroll); + if (container) { + if (scrollContainer) { + scrollContainer.removeEventListener('scroll', onScroll); + } + scrollContainer = container; + scrollContainer.addEventListener('scroll', onScroll); + onScroll(); } - scrollContainer = container; - scrollContainer.addEventListener('scroll', onScroll); - onScroll(); - } }; defineExpose({ - updateScrollContainer + updateScrollContainer, }); const initScrollContainer = async () => { @@ -51,11 +51,10 @@ const initScrollContainer = async () => { scrollContainer = window; } - if (!scrollContainer) return - scrollContainer.addEventListener('scroll', onScroll); + if (!scrollContainer) return; + scrollContainer.addEventListener('scroll', onScroll); }; - onMounted(() => { initScrollContainer(); }); @@ -82,19 +81,18 @@ onUnmounted(() => { - diff --git a/src/components/common/__tests__/VnChangePassword.spec.js b/src/components/common/__tests__/VnChangePassword.spec.js index b610ce44d..8a727cb75 100644 --- a/src/components/common/__tests__/VnChangePassword.spec.js +++ b/src/components/common/__tests__/VnChangePassword.spec.js @@ -35,7 +35,7 @@ describe('VnSmsDialog', () => { expect.objectContaining({ message: 'You must enter a new password', type: 'negative', - }) + }), ); }); @@ -47,7 +47,7 @@ describe('VnSmsDialog', () => { expect.objectContaining({ message: `Passwords don't match`, type: 'negative', - }) + }), ); }); diff --git a/src/components/common/__tests__/VnInputTime.spec.js b/src/components/common/__tests__/VnInputTime.spec.js index 2692ac71b..e1b4f8a7b 100644 --- a/src/components/common/__tests__/VnInputTime.spec.js +++ b/src/components/common/__tests__/VnInputTime.spec.js @@ -60,4 +60,4 @@ describe('VnInputTime', () => { expect(vm.model).toBe(previousModel); }); }); -}); \ No newline at end of file +}); diff --git a/src/components/common/__tests__/VnLocation.spec.js b/src/components/common/__tests__/VnLocation.spec.js index 65fdae960..ff68d5860 100644 --- a/src/components/common/__tests__/VnLocation.spec.js +++ b/src/components/common/__tests__/VnLocation.spec.js @@ -6,8 +6,8 @@ function buildComponent(data) { return createWrapper(VnLocation, { global: { props: { - location: data - } + location: data, + }, }, }).vm; } @@ -24,7 +24,7 @@ describe('formatLocation', () => { postcode: '46680', city: 'Algemesi', province: { name: 'Valencia' }, - country: { name: 'Spain' } + country: { name: 'Spain' }, }; }); @@ -47,7 +47,12 @@ describe('formatLocation', () => { }); it('should return the country', () => { - const location = { ...locationBase, postcode: undefined, city: undefined, province: undefined }; + const location = { + ...locationBase, + postcode: undefined, + city: undefined, + province: undefined, + }; const vm = buildComponent(location); expect(vm.formatLocation(location)).toEqual('Spain'); }); @@ -61,7 +66,7 @@ describe('showLabel', () => { code: '46680', town: 'Algemesi', province: 'Valencia', - country: 'Spain' + country: 'Spain', }; }); @@ -84,8 +89,13 @@ describe('showLabel', () => { }); it('should show the label with country', () => { - const location = { ...locationBase, code: undefined, town: undefined, province: undefined }; + const location = { + ...locationBase, + code: undefined, + town: undefined, + province: undefined, + }; const vm = buildComponent(location); expect(vm.showLabel(location)).toEqual('Spain'); }); -}); \ No newline at end of file +}); diff --git a/src/components/common/__tests__/VnSmsDialog.spec.js b/src/components/common/__tests__/VnSmsDialog.spec.js index 0b3473982..3619962cc 100644 --- a/src/components/common/__tests__/VnSmsDialog.spec.js +++ b/src/components/common/__tests__/VnSmsDialog.spec.js @@ -2,13 +2,14 @@ import { createWrapper } from 'app/test/vitest/helper'; import VnSmsDialog from 'components/common/VnSmsDialog.vue'; import { vi, afterEach, beforeAll, describe, expect, it } from 'vitest'; - describe('VnSmsDialog', () => { let vm; const orderId = 1; const shipped = new Date(); const phone = '012345678'; - const promise = (response) => {return response;}; + const promise = (response) => { + return response; + }; const template = 'minAmount'; const locale = 'en'; @@ -17,13 +18,13 @@ describe('VnSmsDialog', () => { propsData: { data: { orderId, - shipped + shipped, }, template, locale, phone, - promise - } + promise, + }, }).vm; }); @@ -35,7 +36,9 @@ describe('VnSmsDialog', () => { it('should update the message value with the correct template and parameters', () => { vm.updateMessage(); - expect(vm.message).toEqual(`A minimum amount of 50€ (VAT excluded) is required for your order ${orderId} of ${shipped} to receive it without additional shipping costs.`); + expect(vm.message).toEqual( + `A minimum amount of 50€ (VAT excluded) is required for your order ${orderId} of ${shipped} to receive it without additional shipping costs.`, + ); }); }); @@ -47,7 +50,7 @@ describe('VnSmsDialog', () => { orderId, shipped, destination: phone, - message: vm.message + message: vm.message, }; await vm.send(); diff --git a/src/components/ui/SkeletonForm.vue b/src/components/ui/SkeletonForm.vue index 8d3a4b5bf..961c469df 100644 --- a/src/components/ui/SkeletonForm.vue +++ b/src/components/ui/SkeletonForm.vue @@ -1,14 +1,14 @@ \ No newline at end of file + 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 @@