diff --git a/cypress.config.js b/cypress.config.js index d9cdbe728..7458c0b05 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -44,6 +44,7 @@ export default defineConfig({ supportFile: 'test/cypress/support/index.js', videosFolder: 'test/cypress/videos', downloadsFolder: 'test/cypress/downloads', + tmpUploadFolder: 'test/cypress/storage/tmp/dms', video: false, specPattern: 'test/cypress/integration/**/*.spec.js', experimentalRunAllSpecs: true, diff --git a/package.json b/package.json index ccff022cf..b7b04287d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "25.16.0", + "version": "25.18.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", @@ -18,6 +18,8 @@ "test:e2e:summary": "bash ./test/cypress/summary.sh", "test": "echo \"See package.json => scripts for available tests.\" && exit 0", "test:front": "vitest", + "test:ui": "vitest --ui", + "test:coverage": "vitest run --coverage", "test:front:ci": "vitest run", "commitlint": "commitlint --edit", "prepare": "npx husky install", @@ -27,6 +29,8 @@ "docs:preview": "vitepress preview docs" }, "dependencies": { + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "^9.20.0", "@quasar/cli": "^2.4.1", "@quasar/extras": "^1.16.16", "axios": "^1.4.0", @@ -40,8 +44,6 @@ "validator": "^13.9.0", "vue": "^3.5.13", "vue-i18n": "^9.4.0", - "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "^9.20.0", "vue-router": "^4.2.5" }, "devDependencies": { @@ -54,6 +56,7 @@ "@quasar/app-vite": "^2.0.8", "@quasar/quasar-app-extension-qcalendar": "^4.0.2", "@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0", + "@vitest/ui": "3.1.1", "@vue/compiler-sfc": "^3.5.13", "@vue/test-utils": "^2.4.4", "autoprefixer": "^10.4.14", @@ -86,4 +89,4 @@ "vite": "^6.0.11", "vitest": "^0.31.1" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 35b1a9ea8..02d82f325 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -75,7 +75,10 @@ devDependencies: version: 4.1.2 '@quasar/quasar-app-extension-testing-unit-vitest': specifier: ^0.4.0 - version: 0.4.0(@vue/test-utils@2.4.6)(quasar@2.18.1)(typescript@5.8.3)(vite@6.2.5)(vitest@3.1.1)(vue@3.5.13) + version: 0.4.0(@vitest/ui@3.1.1)(@vue/test-utils@2.4.6)(quasar@2.18.1)(typescript@5.8.3)(vite@6.2.5)(vitest@3.1.1)(vue@3.5.13) + '@vitest/ui': + specifier: 3.1.1 + version: 3.1.1(vitest@3.1.1) '@vue/compiler-sfc': specifier: ^3.5.13 version: 3.5.13 @@ -132,7 +135,7 @@ devDependencies: version: 1.86.3 vitest: specifier: ^3.0.3 - version: 3.1.1(@types/node@22.14.0)(sass@1.86.3) + version: 3.1.1(@types/node@22.14.0)(@vitest/ui@3.1.1)(sass@1.86.3) xunit-viewer: specifier: ^10.6.1 version: 10.6.1(@babel/runtime@7.27.0)(@codemirror/autocomplete@6.18.6)(@codemirror/language@6.11.0)(@codemirror/lint@6.8.5)(@codemirror/search@6.5.10)(@codemirror/state@6.5.2)(@codemirror/theme-one-dark@6.1.2)(@codemirror/view@6.36.5)(codemirror@6.0.1)(react-dom@19.1.0)(react@19.1.0) @@ -1139,6 +1142,10 @@ packages: config-chain: 1.1.13 dev: false + /@polka/url@1.0.0-next.28: + resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==} + dev: true + /@quasar/app-vite@2.2.0(@types/node@22.14.0)(eslint@9.24.0)(pinia@2.3.1)(quasar@2.18.1)(sass@1.86.3)(typescript@5.8.3)(vue-router@4.5.0)(vue@3.5.13): resolution: {integrity: sha512-MvCfJrCbxUYvoGaK5jPq0h0hjO8mbxYOWngf+dIKrxhwb+1h5ERh6aVYEUuCtMIwTMEVfPkCez4DIfZIoReuDw==} engines: {node: ^30 || ^28 || ^26 || ^24 || ^22 || ^20 || ^18, npm: '>= 6.14.12', yarn: '>= 1.17.3'} @@ -1262,7 +1269,7 @@ packages: '@quasar/quasar-ui-qcalendar': 4.1.2 dev: true - /@quasar/quasar-app-extension-testing-unit-vitest@0.4.0(@vue/test-utils@2.4.6)(quasar@2.18.1)(typescript@5.8.3)(vite@6.2.5)(vitest@3.1.1)(vue@3.5.13): + /@quasar/quasar-app-extension-testing-unit-vitest@0.4.0(@vitest/ui@3.1.1)(@vue/test-utils@2.4.6)(quasar@2.18.1)(typescript@5.8.3)(vite@6.2.5)(vitest@3.1.1)(vue@3.5.13): resolution: {integrity: sha512-eyzdUdmZiCueNS+5nedjMmzdbpCetSrtdGIwW6KplW1dTzRbLiNvYUjpBOxQGmJCgEhWy9zuswJ7MZ/bTql24Q==} engines: {node: '>= 12.22.1', npm: '>= 6.14.12', yarn: '>= 1.17.3'} peerDependencies: @@ -1275,13 +1282,14 @@ packages: '@vitest/ui': optional: true dependencies: + '@vitest/ui': 3.1.1(vitest@3.1.1) '@vue/test-utils': 2.4.6 happy-dom: 11.2.0 lodash-es: 4.17.21 quasar: 2.18.1 vite-jsconfig-paths: 2.0.1(vite@6.2.5) vite-tsconfig-paths: 4.3.2(typescript@5.8.3)(vite@6.2.5) - vitest: 3.1.1(@types/node@22.14.0)(sass@1.86.3) + vitest: 3.1.1(@types/node@22.14.0)(@vitest/ui@3.1.1)(sass@1.86.3) vue: 3.5.13(typescript@5.8.3) transitivePeerDependencies: - supports-color @@ -1813,6 +1821,21 @@ packages: tinyspy: 3.0.2 dev: true + /@vitest/ui@3.1.1(vitest@3.1.1): + resolution: {integrity: sha512-2HpiRIYg3dlvAJBV9RtsVswFgUSJK4Sv7QhpxoP0eBGkYwzGIKP34PjaV00AULQi9Ovl6LGyZfsetxDWY5BQdQ==} + peerDependencies: + vitest: 3.1.1 + dependencies: + '@vitest/utils': 3.1.1 + fflate: 0.8.2 + flatted: 3.3.3 + pathe: 2.0.3 + sirv: 3.0.1 + tinyglobby: 0.2.12 + tinyrainbow: 2.0.0 + vitest: 3.1.1(@types/node@22.14.0)(@vitest/ui@3.1.1)(sass@1.86.3) + dev: true + /@vitest/utils@3.1.1: resolution: {integrity: sha512-1XIjflyaU2k3HMArJ50bwSh3wKWPD6Q47wz/NUSmRV0zNywPc4w79ARjg/i/aNINHwA+mIALhUVqD9/aUvZNgg==} dependencies: @@ -4021,6 +4044,10 @@ packages: picomatch: 4.0.2 dev: true + /fflate@0.8.2: + resolution: {integrity: sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==} + dev: true + /figures@3.2.0: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} engines: {node: '>=8'} @@ -5588,6 +5615,11 @@ packages: resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==} dev: false + /mrmime@2.0.1: + resolution: {integrity: sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==} + engines: {node: '>=10'} + dev: true + /ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} @@ -6964,6 +6996,15 @@ packages: engines: {node: '>=14'} dev: true + /sirv@3.0.1: + resolution: {integrity: sha512-FoqMu0NCGBLCcAkS1qA+XJIQTR6/JHfQXl+uGteNCQ76T91DMUjPa9xfmeqMY3z80nLSg9yQmNjK0Px6RWsH/A==} + engines: {node: '>=18'} + dependencies: + '@polka/url': 1.0.0-next.28 + mrmime: 2.0.1 + totalist: 3.0.1 + dev: true + /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} @@ -7364,6 +7405,11 @@ packages: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} + /totalist@3.0.1: + resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} + engines: {node: '>=6'} + dev: true + /tough-cookie@5.1.2: resolution: {integrity: sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==} engines: {node: '>=16'} @@ -7772,7 +7818,7 @@ packages: fsevents: 2.3.3 dev: true - /vitest@3.1.1(@types/node@22.14.0)(sass@1.86.3): + /vitest@3.1.1(@types/node@22.14.0)(@vitest/ui@3.1.1)(sass@1.86.3): resolution: {integrity: sha512-kiZc/IYmKICeBAZr9DQ5rT7/6bD9G7uqQEki4fxazi1jdVl2mWGzedtBs5s6llz59yQhVb7FFY2MbHzHCnT79Q==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true @@ -7807,6 +7853,7 @@ packages: '@vitest/runner': 3.1.1 '@vitest/snapshot': 3.1.1 '@vitest/spy': 3.1.1 + '@vitest/ui': 3.1.1(vitest@3.1.1) '@vitest/utils': 3.1.1 chai: 5.2.0 debug: 4.4.0(supports-color@8.1.1) diff --git a/src/App.vue b/src/App.vue index 27cc34c38..0217c45c2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,6 +2,7 @@ import { onMounted } from 'vue'; import { useQuasar, Dark } from 'quasar'; import { useI18n } from 'vue-i18n'; +import VnScroll from './components/common/VnScroll.vue'; const quasar = useQuasar(); const { availableLocales, locale, fallbackLocale } = useI18n(); @@ -38,6 +39,7 @@ quasar.iconMapFn = (iconName) => { -en: +en: contentTypesInfo: Allowed file types {allowedContentTypes} EntryDmsDescription: Reference {reference} WorkersDescription: Working of employee id {reference} diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue index aafa9f4ba..345870aa4 100644 --- a/src/components/common/VnDmsList.vue +++ b/src/components/common/VnDmsList.vue @@ -13,10 +13,12 @@ import VnDms from 'src/components/common/VnDms.vue'; import VnConfirm from 'components/ui/VnConfirm.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; import { useSession } from 'src/composables/useSession'; +import useNotify from 'src/composables/useNotify.js'; const route = useRoute(); const quasar = useQuasar(); const { t } = useI18n(); +const { notify } = useNotify(); const rows = ref([]); const dmsRef = ref(); const formDialog = ref({}); @@ -88,7 +90,6 @@ const dmsFilter = { ], }, }, - where: { [$props.filter]: route.params.id }, }; const columns = computed(() => [ @@ -258,9 +259,16 @@ function deleteDms(dmsFk) { }, }) .onOk(async () => { - await axios.post(`${$props.deleteModel ?? $props.model}/${dmsFk}/removeFile`); - const index = rows.value.findIndex((row) => row.id == dmsFk); - rows.value.splice(index, 1); + try { + await axios.post( + `${$props.deleteModel ?? $props.model}/${dmsFk}/removeFile`, + ); + const index = rows.value.findIndex((row) => row.id == dmsFk); + rows.value.splice(index, 1); + notify(t('globals.dataDeleted'), 'positive'); + } catch (e) { + throw e; + } }); } @@ -298,7 +306,9 @@ defineExpose({ :data-key="$props.model" :url="$props.model" :user-filter="dmsFilter" + search-url="dmsFilter" :order="['dmsFk DESC']" + :filter="{ where: { [$props.filter]: route.params.id } }" auto-load @on-fetch="setData" > diff --git a/src/components/common/VnInputBic.vue b/src/components/common/VnInputBic.vue new file mode 100644 index 000000000..b29644912 --- /dev/null +++ b/src/components/common/VnInputBic.vue @@ -0,0 +1,44 @@ + + diff --git a/src/components/common/VnInputDate.vue b/src/components/common/VnInputDate.vue index 343130f1d..0507fddfb 100644 --- a/src/components/common/VnInputDate.vue +++ b/src/components/common/VnInputDate.vue @@ -1,6 +1,6 @@