Merge branch 'test' into warmifx_customer_filters
gitea/salix-front/pipeline/pr-test This commit looks good
Details
gitea/salix-front/pipeline/pr-test This commit looks good
Details
This commit is contained in:
commit
8cbb97af29
243
CHANGELOG.md
243
CHANGELOG.md
|
@ -1,3 +1,246 @@
|
||||||
|
# Version 25.00 - 2025-01-14
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- chore: refs #7056 move test by:jorgep
|
||||||
|
- feat: refs #7050 7050 add object check by:Jtubau
|
||||||
|
- feat: refs #7050 7050 add test to isEmpty() by:Jtubau
|
||||||
|
- feat: refs #7056 add tests in FormModel by:jorgep
|
||||||
|
- feat: refs #7056 update route meta information and add FormModel tests by:jorgep
|
||||||
|
- feat: refs #7074 tests for fns setData(), parseDms() and showFormDialog() (7074-makeFrontTestToVnDmsList) by:Jtubau
|
||||||
|
- feat: refs #7079 created VnLocation front test by:provira
|
||||||
|
- feat: refs #7189 add Accept-Language header to axios requests by:jorgep
|
||||||
|
- feat: refs #7924 add custom inspection checkbox and localization support by:jgallego
|
||||||
|
- feat: refs #7924 update custom inspection label for clarity in English and Spanish locales by:jgallego
|
||||||
|
- feat: refs #8004 enhance FetchedTags component with column support and styling updates by:pablone
|
||||||
|
- feat: refs #8004 hide rightFilter by:pablone
|
||||||
|
- feat: refs #8246 added new field in list by:Jon
|
||||||
|
- feat: refs #8266 added descriptor to item name by:jtubau
|
||||||
|
- feat: refs #8293 add zone filter by:Jtubau
|
||||||
|
- feat: refs #8293 include zone data in each record by:Jtubau
|
||||||
|
- fix: refs #8004 more list style issues by:pablone
|
||||||
|
- fix: refs #8004 some style issues on all list by:pablone
|
||||||
|
- style: refs #8004 update layout and styling in FetchedTags and ItemList components by:pablone
|
||||||
|
- style: update CustomerBalance.vue to set label color by:jgallego
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- perf: order by:alexm
|
||||||
|
- perf: redirect transition list to card by:alexm
|
||||||
|
- perf: refs #8201 onDataSaved fetch by:Jon
|
||||||
|
- perf: revert processData by:alexm
|
||||||
|
- perf: simplify if by:alexm
|
||||||
|
- perf: simplify if (perf_redirectTransition) by:alexm
|
||||||
|
- refactor: item fixedPrice by:Jon
|
||||||
|
- refactor: refs #7050 refactorize by:jtubau
|
||||||
|
- refactor: refs #7050 removed blank spaces by:jtubau
|
||||||
|
- refactor: refs #7052 move EditTableCellValueForm tests to a new location and enhance test coverage by:jgallego
|
||||||
|
- refactor: refs #7052 remove unnecessary console logs from EditTableCellValueForm tests by:jgallego
|
||||||
|
- refactor: refs #7074 move dms constant to global scope by:Jtubau
|
||||||
|
- refactor: refs #7079 removed useless code by:provira
|
||||||
|
- refactor: refs #7924 simplify custom inspection icon rendering in ExtraCommunity.vue by:jgallego
|
||||||
|
- refactor: refs #8004 remove console log from CardSummary component on mount by:pablone
|
||||||
|
- refactor: refs #8004 remove consoleLogs by:pablone
|
||||||
|
- refactor: refs #8004 remove unused stateStore import in InvoiceInList.vue by:pablone
|
||||||
|
- refactor: refs #8004 remove unused travelFilterRef and chip definition in TravelList.vue by:pablone
|
||||||
|
- refactor: refs #8004 replace VnSelect with VnSelectWorker in CustomerList component by:pablone
|
||||||
|
- refactor: refs #8201 added onMounted to stablish the value to show icons by:Jon
|
||||||
|
- refactor: refs #8201 deleted condition by:Jon
|
||||||
|
- refactor: refs #8201 deleted log by:Jon
|
||||||
|
- refactor: refs #8201 deleted logs by:Jon
|
||||||
|
- refactor: refs #8266 8266 change expedition item name by:Jtubau
|
||||||
|
- refactor: refs #8266 change expedition label by:Jtubau
|
||||||
|
- refactor: refs #8293 remove redundant attributes by:Jtubau
|
||||||
|
- refactor: refs #8320 changed folder names from "specs" to "**tests**" by:provira
|
||||||
|
- refactor: refs #8320 moved front tests to their respective sections by:provira
|
||||||
|
- refactor: refs #8813 removed unused class property by:provira
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- fix: discount class by:PAU ROVIRA ROSALENY
|
||||||
|
- fix: duplicate transalation after test to dev by:alexm
|
||||||
|
- fix: fix translations by:carlossa
|
||||||
|
- fix: redirect to sales when confirming lines by:Jon
|
||||||
|
- fix: refs #7050 delete import added by mistake by:Jtubau
|
||||||
|
- fix: refs #7133 handleSalesModelValue function to handle empty input by:jorgep
|
||||||
|
- fix: refs #7189 update user language on sessionStorage by:jorgep
|
||||||
|
- fix: refs #7935 remove unused 'companyFk' column from InvoiceInList component by:jorgep
|
||||||
|
- fix: refs #8004 more list style issues by:pablone
|
||||||
|
- fix: refs #8004 some style issues on all list by:pablone
|
||||||
|
- fix: refs #8004 update label for daysOnward in TravelFilter component and add translations by:pablone
|
||||||
|
- fix: refs #8004 vnTable card with and add permanent labels by:pablone
|
||||||
|
- fix: refs #8201 added onDataSaved emi to refetch when cahnges are made by:Jon
|
||||||
|
- fix: refs #8201 use arrayData to fix the error by:Jon
|
||||||
|
- fix: refs #8314 space between label and value by:jtubau
|
||||||
|
- fix: refs #8813 fixed ClaimLines format by:provira
|
||||||
|
- fix: update button sizes in ExtraCommunity.vue for better visibility by:jgallego
|
||||||
|
- perf: revert processData by:alexm
|
||||||
|
- refactor: item fixedPrice by:Jon
|
||||||
|
|
||||||
|
# Version 24.52 - 2024-01-07
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- chore: refs #8197 remove console log by:alexm
|
||||||
|
- chore: refs #8197 replace name by:alexm
|
||||||
|
- chore: refs #8197 unnecessary file by:alexm
|
||||||
|
- feat: #8110 apply mixin in quasar components by:Javier Segarra
|
||||||
|
- feat(Account & AccountRole): refs #8197 add VnCardMain by:alexm
|
||||||
|
- feat: addDptoLink by:Jtubau
|
||||||
|
- feat: added restore ticket function in ticket descriptor menu by:Jon
|
||||||
|
- feat: add support service wip by:jorgep
|
||||||
|
- feat: focus menu searchbar by:jorgep
|
||||||
|
- feat: make additional data object by:jorgep
|
||||||
|
- feat: message to grant access by:jorgep
|
||||||
|
- feat: refs #6583 add default param by:jorgep
|
||||||
|
- feat: refs #6583 add destination opt filter by:jorgep
|
||||||
|
- feat: refs #6583 add icon by:jorgep
|
||||||
|
- feat: refs #6583 add locale by:jorgep
|
||||||
|
- feat: refs #7072 added test to computed fn total by:Jtubau
|
||||||
|
- feat: refs #7235 update invoice out global form to fetch config based on serial type by:jgallego
|
||||||
|
- feat: refs #7301 add exclude inventory supplier from list by:pablone
|
||||||
|
- feat: refs #7301 enhance VnDateBadge styling and improve ItemLastEntries component by:pablone
|
||||||
|
- feat: refs #7882 Added distribution point by:guillermo
|
||||||
|
- feat: refs #7882 Added longitude & latitude by:guillermo
|
||||||
|
- feat: refs #7936 add autocomplete on tab fn by:jorgep
|
||||||
|
- feat: refs #7936 add company filter by:jorgep
|
||||||
|
- feat: refs #7936 add currency check before fetching by:jorgep
|
||||||
|
- feat: refs #7936 add dueDated field by:jorgep
|
||||||
|
- feat: refs #7936 add number validation to VnInputNumber & new daysAgo filter in InvoiceInFilter by:jorgep
|
||||||
|
- feat: refs #7936 add optionCaption by:jorgep
|
||||||
|
- feat: refs #7936 add row click navigation to InvoiceInSerial by:jorgep
|
||||||
|
- feat: refs #7936 add unit tests by:jorgep
|
||||||
|
- feat: refs #7936 add useAccountShortToStandard composable by:jorgep
|
||||||
|
- feat: refs #7936 calculate exchange & update taxable base by:jorgep
|
||||||
|
- feat: refs #7936 enhance downloadFile function to support opening in a new tab by:jorgep
|
||||||
|
- feat: refs #7936 enhance getTotal fn & add unit tests by:jorgep
|
||||||
|
- feat: refs #7936 enhance vn-select by:jorgep
|
||||||
|
- feat: refs #7936 improve optionLabel logic in InvoiceInVat component for better handling of numeric values by:jorgep
|
||||||
|
- feat: refs #7936 limit decimal places by:jorgep
|
||||||
|
- feat: refs #7936 make fields required by:jorgep
|
||||||
|
- feat: refs #7936 show country code & isVies fields by:jorgep
|
||||||
|
- feat: refs #7936 show id & value by:jorgep
|
||||||
|
- feat: refs #7936 simplify optionLabel wip by:jorgep
|
||||||
|
- feat: refs #7936 update 'isVies' label to use global translation key by:jorgep
|
||||||
|
- feat: refs #7936 update option labels in InvoiceIn components for better clarity by:jorgep
|
||||||
|
- feat: refs #7936 use default invoice data by:jorgep
|
||||||
|
- feat: refs #8001 change request by:robert
|
||||||
|
- feat: refs #8001 ticketExpeditionGrafana by:robert
|
||||||
|
- feat: refs #8194 created VnSelectWorker component and use it in Lilium by:Jon
|
||||||
|
- feat: refs #8197 better leftMenu and VnCardMain improvements by:alexm
|
||||||
|
- feat: refs #8197 default leftMenu by:alexm
|
||||||
|
- feat: refs #8197 default sectionName by:alexm
|
||||||
|
- feat: refs #8197 keepData in VnSection by:alexm
|
||||||
|
- feat: refs #8197 vnTableFilter by:alexm
|
||||||
|
- feat: refs #8197 working rightMenu by:alexm
|
||||||
|
- feat: remove re-fetch when add element by:Javier Segarra
|
||||||
|
- feat: remove search after category by:Javier Segarra
|
||||||
|
- feat: requested changes in item module by:Jon
|
||||||
|
- feat: update quantity by:Javier Segarra
|
||||||
|
- feat(VnPaginate): refs #8197 hold data when change to Card by:alexm
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- perf: #6896 REMOVE COMMENTS by:Javier Segarra
|
||||||
|
- perf: qFormMixin by:Javier Segarra
|
||||||
|
- perf: qFormMixin improvement by:Javier Segarra
|
||||||
|
- perf: refs #8194 select worker component by:Jon
|
||||||
|
- perf: refs #8197 perf by:alexm
|
||||||
|
- perf: remove comments by:Javier Segarra
|
||||||
|
- perf: remove unused variables (origin/warmfix_noUsedVars) by:Javier Segarra
|
||||||
|
- refactor: added again search emit by:Jon
|
||||||
|
- refactor: add useCau composable by:jorgep
|
||||||
|
- refactor: deleted log by:Jon
|
||||||
|
- refactor: deleted onUnmounted code by:Jon
|
||||||
|
- refactor: deleted useless hidden tag by:Jon
|
||||||
|
- refactor: deleted warnings and corrected itemTag by:Jon
|
||||||
|
- refactor: drop logic by:jorgep
|
||||||
|
- refactor: ignore params when searching by id on searchbar (origin/VnSearchbar-SearchRemoveParams) by:Jon
|
||||||
|
- refactor: log error by:Jon
|
||||||
|
- refactor: refs #7936 locale by:jorgep
|
||||||
|
- refactor: refs #7936 simplify getTotal fn by:jorgep
|
||||||
|
- refactor: refs #7936 update label capitalization and replace invoice type options by:jorgep
|
||||||
|
- refactor: refs #8194 deleted unnecessary label by:Jon
|
||||||
|
- refactor: refs #8194 modified select worker template by:Jon
|
||||||
|
- refactor: refs #8194 modified select worker to allow no one filter from monitor ticket by:Jon
|
||||||
|
- refactor: refs #8194 moved translation to the correct place by:Jon
|
||||||
|
- refactor: refs #8194 requested changes by:Jon
|
||||||
|
- refactor: refs #8194 structure changes in component and related files by:Jon
|
||||||
|
- refactor: refs #8197 adapt AccountAcls to VnCardMain by:alexm
|
||||||
|
- refactor: refs #8197 adapt AccountAlias by:alexm
|
||||||
|
- refactor: refs #8197 adapt Ticket to VnCardMain by:alexm
|
||||||
|
- refactor: refs #8197 backward compatible (8197-VnCardMain_backwardCompatibility) by:alexm
|
||||||
|
- refactor: refs #8197 rename VnSectionMain to VnModule and VnCardMain to VnSection by:alexm
|
||||||
|
- refactor: refs #8288 changed invoice out spanish translation by:provira
|
||||||
|
- refactor: use locale keys by:jorgep
|
||||||
|
- refactor: use teleport to avoid qdrawer overlapping by:Jon
|
||||||
|
- refactor: use VnSelectWorker by:Jon
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- fix: account by:carlossa
|
||||||
|
- fix: account create by:carlossa
|
||||||
|
- fix: accountList create by:carlossa
|
||||||
|
- fix(AccountList): use $refs by:alexm
|
||||||
|
- fix: add data-key by:alexm
|
||||||
|
- fix: addLocales by:Jtubau
|
||||||
|
- fix: dated field by:Jon
|
||||||
|
- fix: e2e by:jorgep
|
||||||
|
- fix: fix department filter by:carlossa
|
||||||
|
- fix: fixed translations by:Javier Segarra
|
||||||
|
- fix: fixed translations by:provira
|
||||||
|
- fix: get total from api by:Javier Segarra
|
||||||
|
- fix: handle non-object options by:jorgep
|
||||||
|
- fix: monitorPayMethodFilter by:carlossa
|
||||||
|
- fix: orderBy priority by:Javier Segarra
|
||||||
|
- fix: prevent null by:jorgep
|
||||||
|
- fix: redirection vnTable VnTableFilter by:alexm
|
||||||
|
- fix: refs #6389 fix filter trad by:carlossa
|
||||||
|
- fix: refs #6389 fix front, filters, itp by:carlossa
|
||||||
|
- fix: refs #6389 front add packing filter by:carlossa
|
||||||
|
- fix: refs #6389 front by:carlossa
|
||||||
|
- fix: refs #6389 front filters by:carlossa
|
||||||
|
- fix: refs #6389 ipt by:carlossa
|
||||||
|
- fix: refs #6389 packing by:carlossa
|
||||||
|
- fix: refs #6583 update checkbox for filtering by destination in TicketAdvanceFilter by:jorgep
|
||||||
|
- fix: refs #7031 add test e2e by:carlossa
|
||||||
|
- fix: refs #7031 fix zoneTest by:carlossa
|
||||||
|
- fix: refs #7301 unnecessary console logs from ItemLastEntries.vue by:pablone
|
||||||
|
- fix: refs #7936 changes by:jorgep
|
||||||
|
- fix: refs #7936 decimal places & locale by:jorgep
|
||||||
|
- fix: refs #7936 descriptor & dueday by:jorgep
|
||||||
|
- fix: refs #7936 exclude disabled els on tab by:jorgep
|
||||||
|
- fix: refs #7936 format tax calculation to two decimal places by:jorgep
|
||||||
|
- fix: refs #7936 improve error handling by:jorgep
|
||||||
|
- fix: refs #7936 redirection by:jorgep
|
||||||
|
- fix: refs #7936 rollback by:jorgep
|
||||||
|
- fix: refs #7936 serial by:jorgep
|
||||||
|
- fix: refs #7936 tabulation wip by:jorgep
|
||||||
|
- fix: refs #7936 test by:jorgep
|
||||||
|
- fix: refs #8114 clean by:carlossa
|
||||||
|
- fix: refs #8114 fix agencyList by:carlossa
|
||||||
|
- fix: refs #8114 fix lifeCycle hooks by:carlossa
|
||||||
|
- fix: refs #8114 fix pr by:carlossa
|
||||||
|
- fix: refs #8114 fix removeAddress by:carlossa
|
||||||
|
- fix: refs #8114 orderList by:carlossa
|
||||||
|
- fix: refs #8114 remove logs by:carlossa
|
||||||
|
- fix: refs #8197 mapKey (origin/8197-perf_vnTableInside, 8197-perf_vnTableInside) by:alexm
|
||||||
|
- fix: refs #8197 redirection (8197-perf_redirection) by:alexm
|
||||||
|
- fix: refs #8197 staticParams and redirect by:alexm
|
||||||
|
- fix: refs #8197 vnPaginate onFetch emit by:alexm
|
||||||
|
- fix: refs #8197 vnPaginate when change :id by:alexm
|
||||||
|
- fix: refs #8197 vnTableFilter in vnTable by:alexm
|
||||||
|
- fix: refs #8315 ticketBoxing test by:alexm
|
||||||
|
- fix: remove url by:carlossa
|
||||||
|
- fix: rollback by:jorgep
|
||||||
|
- fix: test by:jorgep
|
||||||
|
- fix(VnDmsList): refs #8197 add mapKey by:alexm
|
||||||
|
- revert: refs #8197 arrayData changes by:alexm
|
||||||
|
- test: refs #8197 fix e2e by:alexm
|
||||||
|
- test: refs #8315 fix claimDevelopment fixtures by:alexm
|
||||||
|
- test: refs #8315 fix clientList by:alexm
|
||||||
|
- test: refs #8315 fix VnSelect in e2e by:alexm
|
||||||
|
|
||||||
# Version 24.50 - 2024-12-10
|
# Version 24.50 - 2024-12-10
|
||||||
|
|
||||||
### Added 🆕
|
### Added 🆕
|
||||||
|
|
|
@ -11,6 +11,7 @@ module.exports = defineConfig({
|
||||||
screenshotsFolder: 'test/cypress/screenshots',
|
screenshotsFolder: 'test/cypress/screenshots',
|
||||||
supportFile: 'test/cypress/support/index.js',
|
supportFile: 'test/cypress/support/index.js',
|
||||||
videosFolder: 'test/cypress/videos',
|
videosFolder: 'test/cypress/videos',
|
||||||
|
downloadsFolder: 'test/cypress/downloads',
|
||||||
video: false,
|
video: false,
|
||||||
specPattern: 'test/cypress/integration/**/*.spec.js',
|
specPattern: 'test/cypress/integration/**/*.spec.js',
|
||||||
experimentalRunAllSpecs: true,
|
experimentalRunAllSpecs: true,
|
||||||
|
@ -33,5 +34,7 @@ module.exports = defineConfig({
|
||||||
require('cypress-mochawesome-reporter/plugin')(on);
|
require('cypress-mochawesome-reporter/plugin')(on);
|
||||||
// implement node event listeners here
|
// implement node event listeners here
|
||||||
},
|
},
|
||||||
|
viewportWidth: 1280,
|
||||||
|
viewportHeight: 720,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salix-front",
|
"name": "salix-front",
|
||||||
"version": "24.52.0",
|
"version": "25.04.0",
|
||||||
"description": "Salix frontend",
|
"description": "Salix frontend",
|
||||||
"productName": "Salix",
|
"productName": "Salix",
|
||||||
"author": "Verdnatura",
|
"author": "Verdnatura",
|
||||||
|
@ -25,6 +25,7 @@
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"chromium": "^3.0.3",
|
"chromium": "^3.0.3",
|
||||||
"croppie": "^2.6.5",
|
"croppie": "^2.6.5",
|
||||||
|
"moment": "^2.30.1",
|
||||||
"pinia": "^2.1.3",
|
"pinia": "^2.1.3",
|
||||||
"quasar": "^2.14.5",
|
"quasar": "^2.14.5",
|
||||||
"validator": "^13.9.0",
|
"validator": "^13.9.0",
|
||||||
|
|
|
@ -20,6 +20,9 @@ dependencies:
|
||||||
croppie:
|
croppie:
|
||||||
specifier: ^2.6.5
|
specifier: ^2.6.5
|
||||||
version: 2.6.5
|
version: 2.6.5
|
||||||
|
moment:
|
||||||
|
specifier: ^2.30.1
|
||||||
|
version: 2.30.1
|
||||||
pinia:
|
pinia:
|
||||||
specifier: ^2.1.3
|
specifier: ^2.1.3
|
||||||
version: 2.1.7(typescript@5.5.4)(vue@3.4.19)
|
version: 2.1.7(typescript@5.5.4)(vue@3.4.19)
|
||||||
|
@ -832,8 +835,8 @@ packages:
|
||||||
vue-i18n:
|
vue-i18n:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@intlify/message-compiler': 10.0.0
|
'@intlify/message-compiler': 11.0.0-rc.1
|
||||||
'@intlify/shared': 10.0.0
|
'@intlify/shared': 11.0.0-rc.1
|
||||||
jsonc-eslint-parser: 1.4.1
|
jsonc-eslint-parser: 1.4.1
|
||||||
source-map: 0.6.1
|
source-map: 0.6.1
|
||||||
vue-i18n: 9.9.1(vue@3.4.19)
|
vue-i18n: 9.9.1(vue@3.4.19)
|
||||||
|
@ -847,11 +850,11 @@ packages:
|
||||||
'@intlify/message-compiler': 9.9.1
|
'@intlify/message-compiler': 9.9.1
|
||||||
'@intlify/shared': 9.9.1
|
'@intlify/shared': 9.9.1
|
||||||
|
|
||||||
/@intlify/message-compiler@10.0.0:
|
/@intlify/message-compiler@11.0.0-rc.1:
|
||||||
resolution: {integrity: sha512-OcaWc63NC/9p1cMdgoNKBj4d61BH8sUW1Hfs6YijTd9656ZR4rNqXAlRnBrfS5ABq0vjQjpa8VnyvH9hK49yBw==}
|
resolution: {integrity: sha512-TGw2uBfuTFTegZf/BHtUQBEKxl7Q/dVGLoqRIdw8lFsp9g/53sYn5iD+0HxIzdYjbWL6BTJMXCPUHp9PxDTRPw==}
|
||||||
engines: {node: '>= 16'}
|
engines: {node: '>= 16'}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@intlify/shared': 10.0.0
|
'@intlify/shared': 11.0.0-rc.1
|
||||||
source-map-js: 1.0.2
|
source-map-js: 1.0.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
@ -862,8 +865,8 @@ packages:
|
||||||
'@intlify/shared': 9.9.1
|
'@intlify/shared': 9.9.1
|
||||||
source-map-js: 1.0.2
|
source-map-js: 1.0.2
|
||||||
|
|
||||||
/@intlify/shared@10.0.0:
|
/@intlify/shared@11.0.0-rc.1:
|
||||||
resolution: {integrity: sha512-6ngLfI7DOTew2dcF9WMJx+NnMWghMBhIiHbGg+wRvngpzD5KZJZiJVuzMsUQE1a5YebEmtpTEfUrDp/NqVGdiw==}
|
resolution: {integrity: sha512-8tR1xe7ZEbkabTuE/tNhzpolygUn9OaYp9yuYAF4MgDNZg06C3Qny80bes2/e9/Wm3aVkPUlCw6WgU7mQd0yEg==}
|
||||||
engines: {node: '>= 16'}
|
engines: {node: '>= 16'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
@ -887,7 +890,7 @@ packages:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@intlify/bundle-utils': 4.0.0(vue-i18n@9.9.1)
|
'@intlify/bundle-utils': 4.0.0(vue-i18n@9.9.1)
|
||||||
'@intlify/shared': 10.0.0
|
'@intlify/shared': 11.0.0-rc.1
|
||||||
'@rollup/pluginutils': 4.2.1
|
'@rollup/pluginutils': 4.2.1
|
||||||
'@vue/compiler-sfc': 3.4.19
|
'@vue/compiler-sfc': 3.4.19
|
||||||
debug: 4.3.4(supports-color@8.1.1)
|
debug: 4.3.4(supports-color@8.1.1)
|
||||||
|
@ -4960,6 +4963,10 @@ packages:
|
||||||
uuid: 8.3.2
|
uuid: 8.3.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/moment@2.30.1:
|
||||||
|
resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/ms@2.0.0:
|
/ms@2.0.0:
|
||||||
resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}
|
resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import { Notify } from 'quasar';
|
|
||||||
import { onRequest, onResponseError } from 'src/boot/axios';
|
import { onRequest, onResponseError } from 'src/boot/axios';
|
||||||
import { describe, expect, it, vi } from 'vitest';
|
import { describe, expect, it, vi } from 'vitest';
|
||||||
|
|
||||||
|
@ -27,6 +26,7 @@ describe('Axios boot', () => {
|
||||||
expect(resultConfig).toEqual(
|
expect(resultConfig).toEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
headers: {
|
headers: {
|
||||||
|
'Accept-Language': 'en-US',
|
||||||
Authorization: 'DEFAULT_TOKEN',
|
Authorization: 'DEFAULT_TOKEN',
|
||||||
},
|
},
|
||||||
})
|
})
|
|
@ -3,12 +3,12 @@ import { useSession } from 'src/composables/useSession';
|
||||||
import { Router } from 'src/router';
|
import { Router } from 'src/router';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import { useStateQueryStore } from 'src/stores/useStateQueryStore';
|
import { useStateQueryStore } from 'src/stores/useStateQueryStore';
|
||||||
|
import { i18n } from 'src/boot/i18n';
|
||||||
|
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const stateQuery = useStateQueryStore();
|
const stateQuery = useStateQueryStore();
|
||||||
const baseUrl = '/api/';
|
const baseUrl = '/api/';
|
||||||
|
|
||||||
axios.defaults.baseURL = baseUrl;
|
axios.defaults.baseURL = baseUrl;
|
||||||
const axiosNoError = axios.create({ baseURL: baseUrl });
|
const axiosNoError = axios.create({ baseURL: baseUrl });
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ const onRequest = (config) => {
|
||||||
const token = session.getToken();
|
const token = session.getToken();
|
||||||
if (token.length && !config.headers.Authorization) {
|
if (token.length && !config.headers.Authorization) {
|
||||||
config.headers.Authorization = token;
|
config.headers.Authorization = token;
|
||||||
|
config.headers['Accept-Language'] = i18n.global.locale.value;
|
||||||
}
|
}
|
||||||
stateQuery.add(config);
|
stateQuery.add(config);
|
||||||
return config;
|
return config;
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
import { boot } from 'quasar/wrappers';
|
import { boot } from 'quasar/wrappers';
|
||||||
import { createI18n } from 'vue-i18n';
|
import { createI18n } from 'vue-i18n';
|
||||||
import messages from 'src/i18n';
|
import messages from 'src/i18n';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
|
const user = useState().getUser();
|
||||||
|
|
||||||
const i18n = createI18n({
|
const i18n = createI18n({
|
||||||
locale: navigator.language || navigator.userLanguage,
|
locale: user.value.lang || navigator.language || navigator.userLanguage,
|
||||||
fallbackLocale: 'en',
|
fallbackLocale: 'en',
|
||||||
globalInjection: true,
|
globalInjection: true,
|
||||||
messages,
|
messages,
|
||||||
|
|
|
@ -31,7 +31,7 @@ export default {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
form.addEventListener('keyup', function (evt) {
|
form.addEventListener('keyup', function (evt) {
|
||||||
if (evt.key === 'Enter') {
|
if (evt.key === 'Enter' && !that.$attrs['prevent-submit']) {
|
||||||
const input = evt.target;
|
const input = evt.target;
|
||||||
if (input.type == 'textarea' && evt.shiftKey) {
|
if (input.type == 'textarea' && evt.shiftKey) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
|
|
@ -55,13 +55,6 @@ async function setCountry(countryFk, data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Province
|
// Province
|
||||||
|
|
||||||
async function handleProvinces(data) {
|
|
||||||
provincesOptions.value = data;
|
|
||||||
if (postcodeFormData.countryFk) {
|
|
||||||
await fetchTowns();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
async function setProvince(id, data) {
|
async function setProvince(id, data) {
|
||||||
if (data.provinceFk === id) return;
|
if (data.provinceFk === id) return;
|
||||||
const newProvince = provincesOptions.value.find((province) => province.id == id);
|
const newProvince = provincesOptions.value.find((province) => province.id == id);
|
||||||
|
@ -69,6 +62,7 @@ async function setProvince(id, data) {
|
||||||
postcodeFormData.provinceFk = id;
|
postcodeFormData.provinceFk = id;
|
||||||
await fetchTowns();
|
await fetchTowns();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onProvinceCreated(data) {
|
async function onProvinceCreated(data) {
|
||||||
postcodeFormData.provinceFk = data.id;
|
postcodeFormData.provinceFk = data.id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ function resetData(data) {
|
||||||
originalData.value = JSON.parse(JSON.stringify(data));
|
originalData.value = JSON.parse(JSON.stringify(data));
|
||||||
formData.value = JSON.parse(JSON.stringify(data));
|
formData.value = JSON.parse(JSON.stringify(data));
|
||||||
|
|
||||||
if (watchChanges.value) watchChanges.value(); //destoy watcher
|
if (watchChanges.value) watchChanges.value(); //destroy watcher
|
||||||
watchChanges.value = watch(formData, () => (hasChanges.value = true), { deep: true });
|
watchChanges.value = watch(formData, () => (hasChanges.value = true), { deep: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,10 +270,8 @@ function getChanges() {
|
||||||
|
|
||||||
function isEmpty(obj) {
|
function isEmpty(obj) {
|
||||||
if (obj == null) return true;
|
if (obj == null) return true;
|
||||||
if (obj === undefined) return true;
|
if (Array.isArray(obj)) return !obj.length;
|
||||||
if (Object.keys(obj).length === 0) return true;
|
return !Object.keys(obj).length;
|
||||||
|
|
||||||
if (obj.length > 0) return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function reload(params) {
|
async function reload(params) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { onMounted, onUnmounted, computed, ref, watch, nextTick } from 'vue';
|
import { onMounted, onUnmounted, computed, ref, watch, nextTick } from 'vue';
|
||||||
import { onBeforeRouteLeave, useRouter } from 'vue-router';
|
import { onBeforeRouteLeave, useRouter, useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
|
@ -12,7 +12,6 @@ import SkeletonForm from 'components/ui/SkeletonForm.vue';
|
||||||
import VnConfirm from './ui/VnConfirm.vue';
|
import VnConfirm from './ui/VnConfirm.vue';
|
||||||
import { tMobile } from 'src/composables/tMobile';
|
import { tMobile } from 'src/composables/tMobile';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
|
|
||||||
const { push } = useRouter();
|
const { push } = useRouter();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
@ -199,6 +198,7 @@ async function fetch() {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
state.set(modelValue, {});
|
state.set(modelValue, {});
|
||||||
originalData.value = {};
|
originalData.value = {};
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,10 @@ const stateQuery = useStateQueryStore();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const appName = 'Lilium';
|
const appName = 'Lilium';
|
||||||
|
const pinnedModulesRef = ref();
|
||||||
|
|
||||||
onMounted(() => stateStore.setMounted());
|
onMounted(() => stateStore.setMounted());
|
||||||
|
|
||||||
const pinnedModulesRef = ref();
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QHeader color="white" elevated>
|
<QHeader color="white" elevated>
|
||||||
<QToolbar class="q-py-sm q-px-md">
|
<QToolbar class="q-py-sm q-px-md">
|
||||||
|
@ -66,16 +64,6 @@ const pinnedModulesRef = ref();
|
||||||
<QSpace />
|
<QSpace />
|
||||||
<div class="q-pl-sm q-gutter-sm row items-center no-wrap">
|
<div class="q-pl-sm q-gutter-sm row items-center no-wrap">
|
||||||
<div id="actions-prepend"></div>
|
<div id="actions-prepend"></div>
|
||||||
<QBtn
|
|
||||||
flat
|
|
||||||
v-if="!quasar.platform.is.mobile"
|
|
||||||
@click="pinnedModulesRef.redirect($route.params.id)"
|
|
||||||
icon="more_up"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('Go to Salix') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
<QBtn
|
<QBtn
|
||||||
:class="{ 'q-pa-none': quasar.platform.is.mobile }"
|
:class="{ 'q-pa-none': quasar.platform.is.mobile }"
|
||||||
id="pinnedModules"
|
id="pinnedModules"
|
||||||
|
@ -107,7 +95,6 @@ const pinnedModulesRef = ref();
|
||||||
<VnBreadcrumbs v-if="$q.screen.lt.md" class="q-ml-md" />
|
<VnBreadcrumbs v-if="$q.screen.lt.md" class="q-ml-md" />
|
||||||
</QHeader>
|
</QHeader>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.searchbar {
|
.searchbar {
|
||||||
width: max-content;
|
width: max-content;
|
||||||
|
@ -116,9 +103,3 @@ const pinnedModulesRef = ref();
|
||||||
background-color: var(--vn-section-color);
|
background-color: var(--vn-section-color);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<i18n>
|
|
||||||
en:
|
|
||||||
Go to Salix: Go to Salix
|
|
||||||
es:
|
|
||||||
Go to Salix: Ir a Salix
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ const onDataSaved = (data) => {
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
url-create="Items/regularize"
|
url-create="Items/regularize"
|
||||||
model="Items"
|
model="Items"
|
||||||
:title="t('Regularize stock')"
|
:title="t('item.regularizeStock')"
|
||||||
:form-initial-data="regularizeFormData"
|
:form-initial-data="regularizeFormData"
|
||||||
@on-data-saved="onDataSaved($event)"
|
@on-data-saved="onDataSaved($event)"
|
||||||
>
|
>
|
||||||
|
@ -55,6 +55,7 @@ const onDataSaved = (data) => {
|
||||||
v-model.number="data.quantity"
|
v-model.number="data.quantity"
|
||||||
type="number"
|
type="number"
|
||||||
autofocus
|
autofocus
|
||||||
|
data-cy="regularizeStockInput"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
|
|
@ -87,10 +87,10 @@ async function saveDarkMode(value) {
|
||||||
async function saveLanguage(value) {
|
async function saveLanguage(value) {
|
||||||
const query = `/VnUsers/${user.value.id}`;
|
const query = `/VnUsers/${user.value.id}`;
|
||||||
try {
|
try {
|
||||||
await axios.patch(query, {
|
await axios.patch(query, { lang: value });
|
||||||
lang: value,
|
|
||||||
});
|
|
||||||
user.value.lang = value;
|
user.value.lang = value;
|
||||||
|
useState().setUser(user.value);
|
||||||
onDataSaved();
|
onDataSaved();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
onDataError();
|
onDataError();
|
||||||
|
|
|
@ -59,8 +59,8 @@ const $props = defineProps({
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
bottom: {
|
bottom: {
|
||||||
type: Object,
|
type: Boolean,
|
||||||
default: null,
|
default: false,
|
||||||
},
|
},
|
||||||
cardClass: {
|
cardClass: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -150,6 +150,7 @@ const tableModes = [
|
||||||
disable: $props.disableOption?.card,
|
disable: $props.disableOption?.card,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
const urlParams = route.query[$props.searchUrl];
|
const urlParams = route.query[$props.searchUrl];
|
||||||
hasParams.value = urlParams && Object.keys(urlParams).length !== 0;
|
hasParams.value = urlParams && Object.keys(urlParams).length !== 0;
|
||||||
|
@ -313,7 +314,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
show-if-above
|
show-if-above
|
||||||
>
|
>
|
||||||
<QScrollArea class="fit">
|
<QScrollArea class="fit">
|
||||||
<VnTableFilter :data-key="$attrs['data-key']" :columns="columns" />
|
<VnTableFilter :data-key="$attrs['data-key']" :columns="columns" :redirect="redirect" />
|
||||||
</QScrollArea>
|
</QScrollArea>
|
||||||
</QDrawer>
|
</QDrawer>
|
||||||
<CrudModel
|
<CrudModel
|
||||||
|
@ -383,7 +384,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
:class="col.headerClass"
|
:class="col.headerClass"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="column self-start q-ml-xs ellipsis"
|
class="column ellipsis"
|
||||||
:class="`text-${col?.align ?? 'left'}`"
|
:class="`text-${col?.align ?? 'left'}`"
|
||||||
:style="$props.columnSearch ? 'height: 75px' : ''"
|
:style="$props.columnSearch ? 'height: 75px' : ''"
|
||||||
>
|
>
|
||||||
|
@ -425,7 +426,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
<!-- Columns -->
|
<!-- Columns -->
|
||||||
<QTd
|
<QTd
|
||||||
auto-width
|
auto-width
|
||||||
class="no-margin q-px-xs"
|
class="no-margin"
|
||||||
:class="[getColAlign(col), col.columnClass]"
|
:class="[getColAlign(col), col.columnClass]"
|
||||||
:style="col.style"
|
:style="col.style"
|
||||||
v-if="col.visible ?? true"
|
v-if="col.visible ?? true"
|
||||||
|
@ -477,29 +478,6 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
/>
|
/>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #bottom v-if="bottom">
|
|
||||||
<slot name="bottom-table">
|
|
||||||
<QBtn
|
|
||||||
@click="
|
|
||||||
() =>
|
|
||||||
createAsDialog
|
|
||||||
? (showForm = !showForm)
|
|
||||||
: handleOnDataSaved(create)
|
|
||||||
"
|
|
||||||
class="cursor-pointer fill-icon"
|
|
||||||
color="primary"
|
|
||||||
icon="add_circle"
|
|
||||||
size="md"
|
|
||||||
round
|
|
||||||
flat
|
|
||||||
shortcut="+"
|
|
||||||
:disabled="!disabledAttr"
|
|
||||||
/>
|
|
||||||
<QTooltip>
|
|
||||||
{{ createForm.title }}
|
|
||||||
</QTooltip>
|
|
||||||
</slot>
|
|
||||||
</template>
|
|
||||||
<template #item="{ row, colsMap }">
|
<template #item="{ row, colsMap }">
|
||||||
<component
|
<component
|
||||||
:is="$props.redirect ? 'router-link' : 'span'"
|
:is="$props.redirect ? 'router-link' : 'span'"
|
||||||
|
@ -560,13 +538,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
:key="col.name"
|
:key="col.name"
|
||||||
class="fields"
|
class="fields"
|
||||||
>
|
>
|
||||||
<VnLv
|
<VnLv :label="col.label + ':'">
|
||||||
:label="
|
|
||||||
!col.component && col.label
|
|
||||||
? `${col.label}:`
|
|
||||||
: ''
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<template #value>
|
<template #value>
|
||||||
<span
|
<span
|
||||||
@click="stopEventPropagation($event)"
|
@click="stopEventPropagation($event)"
|
||||||
|
@ -630,6 +602,27 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
|
<div class="full-width bottomButton" v-if="bottom">
|
||||||
|
<QBtn
|
||||||
|
@click="
|
||||||
|
() =>
|
||||||
|
createAsDialog
|
||||||
|
? (showForm = !showForm)
|
||||||
|
: handleOnDataSaved(create)
|
||||||
|
"
|
||||||
|
class="cursor-pointer fill-icon"
|
||||||
|
color="primary"
|
||||||
|
icon="add_circle"
|
||||||
|
size="md"
|
||||||
|
round
|
||||||
|
flat
|
||||||
|
shortcut="+"
|
||||||
|
:disabled="!disabledAttr"
|
||||||
|
/>
|
||||||
|
<QTooltip>
|
||||||
|
{{ createForm.title }}
|
||||||
|
</QTooltip>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</CrudModel>
|
</CrudModel>
|
||||||
<QPageSticky v-if="$props.create" :offset="[20, 20]" style="z-index: 2">
|
<QPageSticky v-if="$props.create" :offset="[20, 20]" style="z-index: 2">
|
||||||
|
@ -707,7 +700,7 @@ es:
|
||||||
|
|
||||||
.grid-three {
|
.grid-three {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(400px, max-content));
|
grid-template-columns: repeat(auto-fit, minmax(350px, max-content));
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
grid-gap: 20px;
|
grid-gap: 20px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
@ -756,21 +749,6 @@ es:
|
||||||
top: 0;
|
top: 0;
|
||||||
padding: 12px 0;
|
padding: 12px 0;
|
||||||
}
|
}
|
||||||
tbody {
|
|
||||||
.q-checkbox {
|
|
||||||
display: flex;
|
|
||||||
margin-bottom: 9px;
|
|
||||||
& .q-checkbox__label {
|
|
||||||
margin-left: 31px;
|
|
||||||
color: var(--vn-text-color);
|
|
||||||
}
|
|
||||||
& .q-checkbox__inner {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
color: var(--vn-label-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.sticky {
|
.sticky {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
|
|
||||||
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
||||||
import VnFilter from 'components/VnTable/VnFilter.vue';
|
import VnFilter from 'components/VnTable/VnFilter.vue';
|
||||||
|
@ -11,16 +10,11 @@ defineProps({
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
chipLocale: {
|
|
||||||
type: String,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
searchUrl: {
|
searchUrl: {
|
||||||
type: [String, Boolean],
|
type: [String, Boolean],
|
||||||
default: 'table',
|
default: 'table',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const { t } = useI18n();
|
|
||||||
|
|
||||||
const tableFilterRef = ref([]);
|
const tableFilterRef = ref([]);
|
||||||
|
|
||||||
|
@ -62,9 +56,9 @@ function columnName(col) {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #tags="{ tag, formatFn }" v-if="chipLocale">
|
<template #tags="{ tag, formatFn, getLocale }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`${chipLocale}.${tag.label}`) }}: </strong>
|
<strong>{{ getLocale(`${tag.label}`) }}: </strong>
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -0,0 +1,248 @@
|
||||||
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
|
import CrudModel from 'components/CrudModel.vue';
|
||||||
|
import { vi, afterEach, beforeEach, beforeAll, describe, expect, it } from 'vitest';
|
||||||
|
|
||||||
|
describe('CrudModel', () => {
|
||||||
|
let wrapper;
|
||||||
|
let vm;
|
||||||
|
let data;
|
||||||
|
beforeAll(() => {
|
||||||
|
wrapper = createWrapper(CrudModel, {
|
||||||
|
global: {
|
||||||
|
stubs: [
|
||||||
|
'vnPaginate',
|
||||||
|
'useState',
|
||||||
|
'arrayData',
|
||||||
|
'useStateStore',
|
||||||
|
'vue-i18n',
|
||||||
|
],
|
||||||
|
mocks: {
|
||||||
|
validate: vi.fn(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
propsData: {
|
||||||
|
dataRequired: {
|
||||||
|
fk: 1,
|
||||||
|
},
|
||||||
|
dataKey: 'crudModelKey',
|
||||||
|
model: 'crudModel',
|
||||||
|
url: 'crudModelUrl',
|
||||||
|
saveFn: '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
wrapper=wrapper.wrapper;
|
||||||
|
vm=wrapper.vm;
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
vm.fetch([]);
|
||||||
|
vm.watchChanges = null;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('insert()', () => {
|
||||||
|
it('should new element in list with index 0 if formData not has data', () => {
|
||||||
|
vm.insert();
|
||||||
|
|
||||||
|
expect(vm.formData.length).toEqual(1);
|
||||||
|
expect(vm.formData[0].fk).toEqual(1);
|
||||||
|
expect(vm.formData[0].$index).toEqual(0);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('getChanges()', () => {
|
||||||
|
it('should return correct updates and creates', async () => {
|
||||||
|
vm.fetch([
|
||||||
|
{ id: 1, name: 'New name one' },
|
||||||
|
{ id: 2, name: 'New name two' },
|
||||||
|
{ id: 3, name: 'Bruce Wayne' },
|
||||||
|
]);
|
||||||
|
|
||||||
|
vm.originalData = [
|
||||||
|
{ id: 1, name: 'Tony Starks' },
|
||||||
|
{ id: 2, name: 'Jessica Jones' },
|
||||||
|
{ id: 3, name: 'Bruce Wayne' },
|
||||||
|
];
|
||||||
|
|
||||||
|
vm.insert();
|
||||||
|
const result = vm.getChanges();
|
||||||
|
|
||||||
|
const expected = {
|
||||||
|
creates: [
|
||||||
|
{
|
||||||
|
$index: 3,
|
||||||
|
fk: 1,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
updates: [
|
||||||
|
{
|
||||||
|
data: {
|
||||||
|
name: 'New name one',
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
id: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: {
|
||||||
|
name: 'New name two',
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
id: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
expect(result).toEqual(expected);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('getDifferences()', () => {
|
||||||
|
it('should return the differences between two objects', async () => {
|
||||||
|
const obj1 = {
|
||||||
|
a: 1,
|
||||||
|
b: 2,
|
||||||
|
c: 3,
|
||||||
|
};
|
||||||
|
const obj2 = {
|
||||||
|
a: null,
|
||||||
|
b: 4,
|
||||||
|
d: 5,
|
||||||
|
};
|
||||||
|
|
||||||
|
const result = vm.getDifferences(obj1, obj2);
|
||||||
|
|
||||||
|
expect(result).toEqual({
|
||||||
|
a: null,
|
||||||
|
b: 4,
|
||||||
|
d: 5,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('isEmpty()', () => {
|
||||||
|
let dummyObj;
|
||||||
|
let dummyArray;
|
||||||
|
let result;
|
||||||
|
it('should return true if object si null', async () => {
|
||||||
|
dummyObj = null;
|
||||||
|
result = vm.isEmpty(dummyObj);
|
||||||
|
|
||||||
|
expect(result).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return true if object si undefined', async () => {
|
||||||
|
dummyObj = undefined;
|
||||||
|
result = vm.isEmpty(dummyObj);
|
||||||
|
|
||||||
|
expect(result).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return true if object is empty', async () => {
|
||||||
|
dummyObj ={};
|
||||||
|
result = vm.isEmpty(dummyObj);
|
||||||
|
|
||||||
|
expect(result).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return false if object is not empty', async () => {
|
||||||
|
dummyObj = {a:1, b:2, c:3};
|
||||||
|
result = vm.isEmpty(dummyObj);
|
||||||
|
|
||||||
|
expect(result).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return true if array is empty', async () => {
|
||||||
|
dummyArray = [];
|
||||||
|
result = vm.isEmpty(dummyArray);
|
||||||
|
|
||||||
|
expect(result).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return false if array is not empty', async () => {
|
||||||
|
dummyArray = [1,2,3];
|
||||||
|
result = vm.isEmpty(dummyArray);
|
||||||
|
|
||||||
|
expect(result).toBe(false);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('resetData()', () => {
|
||||||
|
it('should add $index to elements in data[] and sets originalData and formData with data', async () => {
|
||||||
|
data = [{
|
||||||
|
name: 'Tony',
|
||||||
|
lastName: 'Stark',
|
||||||
|
age: 42,
|
||||||
|
}];
|
||||||
|
|
||||||
|
vm.resetData(data);
|
||||||
|
|
||||||
|
expect(vm.originalData).toEqual(data);
|
||||||
|
expect(vm.originalData[0].$index).toEqual(0);
|
||||||
|
expect(vm.formData).toEqual(data);
|
||||||
|
expect(vm.formData[0].$index).toEqual(0);
|
||||||
|
expect(vm.watchChanges).not.toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should dont do nothing if data is null', async () => {
|
||||||
|
vm.resetData(null);
|
||||||
|
|
||||||
|
expect(vm.watchChanges).toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set originalData and formatData with data and generate watchChanges', async () => {
|
||||||
|
data = {
|
||||||
|
name: 'Tony',
|
||||||
|
lastName: 'Stark',
|
||||||
|
age: 42,
|
||||||
|
};
|
||||||
|
|
||||||
|
vm.resetData(data);
|
||||||
|
|
||||||
|
expect(vm.originalData).toEqual(data);
|
||||||
|
expect(vm.formData).toEqual(data);
|
||||||
|
expect(vm.watchChanges).not.toBeNull();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('saveChanges()', () => {
|
||||||
|
data = [{
|
||||||
|
name: 'Tony',
|
||||||
|
lastName: 'Stark',
|
||||||
|
age: 42,
|
||||||
|
}];
|
||||||
|
|
||||||
|
it('should call saveFn if exists', async () => {
|
||||||
|
await wrapper.setProps({ saveFn: vi.fn() });
|
||||||
|
|
||||||
|
vm.saveChanges(data);
|
||||||
|
|
||||||
|
expect(vm.saveFn).toHaveBeenCalledOnce();
|
||||||
|
expect(vm.isLoading).toBe(false);
|
||||||
|
expect(vm.hasChanges).toBe(false);
|
||||||
|
|
||||||
|
await wrapper.setProps({ saveFn: '' });
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should use default url if there's not saveFn", async () => {
|
||||||
|
const postMock =vi.spyOn(axios, 'post');
|
||||||
|
|
||||||
|
vm.formData = [{
|
||||||
|
name: 'Bruce',
|
||||||
|
lastName: 'Wayne',
|
||||||
|
age: 45,
|
||||||
|
}]
|
||||||
|
|
||||||
|
await vm.saveChanges(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)));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,56 @@
|
||||||
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
|
import EditForm from 'components/EditTableCellValueForm.vue';
|
||||||
|
import { vi, afterEach, beforeAll, describe, expect, it } from 'vitest';
|
||||||
|
|
||||||
|
const fieldA = 'fieldA';
|
||||||
|
const fieldB = 'fieldB';
|
||||||
|
|
||||||
|
describe('EditForm', () => {
|
||||||
|
let vm;
|
||||||
|
const mockRows = [
|
||||||
|
{ id: 1, itemFk: 101 },
|
||||||
|
{ id: 2, itemFk: 102 },
|
||||||
|
];
|
||||||
|
const mockFieldsOptions = [
|
||||||
|
{ label: 'Field A', field: fieldA, component: 'input', attrs: {} },
|
||||||
|
{ label: 'Field B', field: fieldB, component: 'date', attrs: {} },
|
||||||
|
];
|
||||||
|
const editUrl = '/api/edit';
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
vi.spyOn(axios, 'post').mockResolvedValue({ status: 200 });
|
||||||
|
vm = createWrapper(EditForm, {
|
||||||
|
props: {
|
||||||
|
rows: mockRows,
|
||||||
|
fieldsOptions: mockFieldsOptions,
|
||||||
|
editUrl,
|
||||||
|
},
|
||||||
|
}).vm;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('onSubmit()', () => {
|
||||||
|
it('should call axios.post with the correct parameters in the payload', async () => {
|
||||||
|
const selectedField = { field: fieldA, component: 'input', attrs: {} };
|
||||||
|
const newValue = 'Test Value';
|
||||||
|
|
||||||
|
vm.selectedField = selectedField;
|
||||||
|
vm.newValue = newValue;
|
||||||
|
|
||||||
|
await vm.onSubmit();
|
||||||
|
|
||||||
|
const payload = axios.post.mock.calls[0][1];
|
||||||
|
|
||||||
|
expect(axios.post).toHaveBeenCalledWith(editUrl, expect.any(Object));
|
||||||
|
expect(payload.field).toEqual(fieldA);
|
||||||
|
expect(payload.newValue).toEqual(newValue);
|
||||||
|
|
||||||
|
expect(payload.lines).toEqual(expect.arrayContaining(mockRows));
|
||||||
|
|
||||||
|
expect(vm.isLoading).toEqual(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,82 @@
|
||||||
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
|
import FilterItemForm from 'src/components/FilterItemForm.vue';
|
||||||
|
import { vi, beforeAll, describe, expect, it } from 'vitest';
|
||||||
|
|
||||||
|
describe('FilterItemForm', () => {
|
||||||
|
let vm;
|
||||||
|
let wrapper;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
wrapper = createWrapper(FilterItemForm, {
|
||||||
|
props: {
|
||||||
|
url: 'Items/withName',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
vm = wrapper.vm;
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
|
||||||
|
vi.spyOn(axios, 'get').mockResolvedValue({
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
id: 999996,
|
||||||
|
name: 'bolas de madera',
|
||||||
|
size: 2,
|
||||||
|
inkFk: null,
|
||||||
|
producerFk: null,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should filter data and populate tableRows for table display', async () => {
|
||||||
|
vm.itemFilterParams.name = 'bolas de madera';
|
||||||
|
|
||||||
|
await vm.onSubmit();
|
||||||
|
|
||||||
|
const expectedFilter = {
|
||||||
|
include: [
|
||||||
|
{ relation: 'producer', scope: { fields: ['name'] } },
|
||||||
|
{ relation: 'ink', scope: { fields: ['name'] } },
|
||||||
|
],
|
||||||
|
where: {"name":{"like":"%bolas de madera%"}},
|
||||||
|
};
|
||||||
|
|
||||||
|
expect(axios.get).toHaveBeenCalledWith('Items/withName', {
|
||||||
|
params: { filter: JSON.stringify(expectedFilter) },
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(vm.tableRows).toEqual([
|
||||||
|
{
|
||||||
|
id: 999996,
|
||||||
|
name: 'bolas de madera',
|
||||||
|
size: 2,
|
||||||
|
inkFk: null,
|
||||||
|
producerFk: null,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle an empty itemFilterParams correctly', async () => {
|
||||||
|
vm.itemFilterParams.name = null;
|
||||||
|
vm.itemFilterParams = {};
|
||||||
|
|
||||||
|
await vm.onSubmit();
|
||||||
|
|
||||||
|
const expectedFilter = {
|
||||||
|
include: [
|
||||||
|
{ relation: 'producer', scope: { fields: ['name'] } },
|
||||||
|
{ relation: 'ink', scope: { fields: ['name'] } },
|
||||||
|
],
|
||||||
|
where: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
expect(axios.get).toHaveBeenCalledWith('Items/withName', {
|
||||||
|
params: { filter: JSON.stringify(expectedFilter) },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should emit "itemSelected" with the correct id and close the form', () => {
|
||||||
|
vm.selectItem({ id: 12345 });
|
||||||
|
expect(wrapper.emitted('itemSelected')[0]).toEqual([12345]);
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,149 @@
|
||||||
|
import { describe, expect, it, beforeAll, vi, afterAll } from 'vitest';
|
||||||
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
|
import FormModel from 'src/components/FormModel.vue';
|
||||||
|
|
||||||
|
describe('FormModel', () => {
|
||||||
|
const model = 'mockModel';
|
||||||
|
const url = 'mockUrl';
|
||||||
|
const formInitialData = { mockKey: 'mockVal' };
|
||||||
|
|
||||||
|
describe('modelValue', () => {
|
||||||
|
it('should use the provided model', () => {
|
||||||
|
const { vm } = mount({ propsData: { model } });
|
||||||
|
expect(vm.modelValue).toBe(model);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should use the route meta title when model is not provided', () => {
|
||||||
|
const { vm } = mount({});
|
||||||
|
expect(vm.modelValue).toBe('formModel_mockTitle');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('onMounted()', () => {
|
||||||
|
let mockGet;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
mockGet = vi.spyOn(axios, 'get').mockResolvedValue({ data: {} });
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(() => {
|
||||||
|
mockGet.mockRestore();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not fetch when has formInitialData', () => {
|
||||||
|
mount({ propsData: { url, model, autoLoad: true, formInitialData } });
|
||||||
|
expect(mockGet).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should fetch when there is url and auto-load', () => {
|
||||||
|
mount({ propsData: { url, model, autoLoad: true } });
|
||||||
|
expect(mockGet).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not observe changes', () => {
|
||||||
|
const { vm } = mount({
|
||||||
|
propsData: { url, model, observeFormChanges: false, formInitialData },
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(vm.hasChanges).toBe(true);
|
||||||
|
vm.reset();
|
||||||
|
expect(vm.hasChanges).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should observe changes', async () => {
|
||||||
|
const { vm } = mount({
|
||||||
|
propsData: { url, model, formInitialData },
|
||||||
|
});
|
||||||
|
vm.state.set(model, formInitialData);
|
||||||
|
expect(vm.hasChanges).toBe(false);
|
||||||
|
|
||||||
|
vm.formData.mockKey = 'newVal';
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(vm.hasChanges).toBe(true);
|
||||||
|
vm.formData.mockKey = 'mockVal';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('trimData()', () => {
|
||||||
|
let vm;
|
||||||
|
beforeAll(() => {
|
||||||
|
vm = mount({}).vm;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should trim whitespace from string values', () => {
|
||||||
|
const data = { key1: ' value1 ', key2: ' value2 ' };
|
||||||
|
const trimmedData = vm.trimData(data);
|
||||||
|
expect(trimmedData).toEqual({ key1: 'value1', key2: 'value2' });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not modify non-string values', () => {
|
||||||
|
const data = { key1: 123, key2: true, key3: null, key4: undefined };
|
||||||
|
const trimmedData = vm.trimData(data);
|
||||||
|
expect(trimmedData).toEqual(data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('save()', async () => {
|
||||||
|
it('should not call if there are not changes', async () => {
|
||||||
|
const { vm } = mount({ propsData: { url, model } });
|
||||||
|
|
||||||
|
await vm.save();
|
||||||
|
expect(vm.hasChanges).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should call axios.patch with the right data', async () => {
|
||||||
|
const spy = vi.spyOn(axios, 'patch').mockResolvedValue({ data: {} });
|
||||||
|
const { vm } = mount({ propsData: { url, model, formInitialData } });
|
||||||
|
vm.formData.mockKey = 'newVal';
|
||||||
|
await vm.$nextTick();
|
||||||
|
await vm.save();
|
||||||
|
expect(spy).toHaveBeenCalled();
|
||||||
|
vm.formData.mockKey = 'mockVal';
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should call axios.post with the right data', async () => {
|
||||||
|
const spy = vi.spyOn(axios, 'post').mockResolvedValue({ data: {} });
|
||||||
|
const { vm } = mount({
|
||||||
|
propsData: { url, model, formInitialData, urlCreate: 'mockUrlCreate' },
|
||||||
|
});
|
||||||
|
vm.formData.mockKey = 'newVal';
|
||||||
|
await vm.$nextTick();
|
||||||
|
await vm.save();
|
||||||
|
expect(spy).toHaveBeenCalled();
|
||||||
|
vm.formData.mockKey = 'mockVal';
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should use the saveFn', async () => {
|
||||||
|
const { vm } = mount({
|
||||||
|
propsData: { url, model, formInitialData, saveFn: () => {} },
|
||||||
|
});
|
||||||
|
const spyPatch = vi.spyOn(axios, 'patch').mockResolvedValue({ data: {} });
|
||||||
|
const spySaveFn = vi.spyOn(vm.$props, 'saveFn');
|
||||||
|
|
||||||
|
vm.formData.mockKey = 'newVal';
|
||||||
|
await vm.$nextTick();
|
||||||
|
await vm.save();
|
||||||
|
expect(spyPatch).not.toHaveBeenCalled();
|
||||||
|
expect(spySaveFn).toHaveBeenCalled();
|
||||||
|
vm.formData.mockKey = 'mockVal';
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should reload the data after save', async () => {
|
||||||
|
const { vm } = mount({
|
||||||
|
propsData: { url, model, formInitialData, reload: true },
|
||||||
|
});
|
||||||
|
vi.spyOn(axios, 'patch').mockResolvedValue({ data: {} });
|
||||||
|
|
||||||
|
vm.formData.mockKey = 'newVal';
|
||||||
|
await vm.$nextTick();
|
||||||
|
await vm.save();
|
||||||
|
vm.formData.mockKey = 'mockVal';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function mount({ propsData = {} }) {
|
||||||
|
return createWrapper(FormModel, {
|
||||||
|
propsData,
|
||||||
|
});
|
||||||
|
}
|
|
@ -1,32 +1,20 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, useSlots } from 'vue';
|
import { onMounted, useSlots } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
import { useQuasar } from 'quasar';
|
||||||
const slots = useSlots();
|
import { useHasContent } from 'src/composables/useHasContent';
|
||||||
const hasContent = ref(false);
|
|
||||||
const rightPanel = ref(null);
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
rightPanel.value = document.querySelector('#right-panel');
|
|
||||||
if (!rightPanel.value) return;
|
|
||||||
|
|
||||||
// Check if there's content to display
|
|
||||||
const observer = new MutationObserver(() => {
|
|
||||||
hasContent.value = rightPanel.value.childNodes.length;
|
|
||||||
});
|
|
||||||
|
|
||||||
observer.observe(rightPanel.value, {
|
|
||||||
subtree: true,
|
|
||||||
childList: true,
|
|
||||||
attributes: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!slots['right-panel'] && !hasContent.value) stateStore.rightDrawer = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const quasar = useQuasar();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
const slots = useSlots();
|
||||||
|
const hasContent = useHasContent('#right-panel');
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if ((!slots['right-panel'] && !hasContent.value) || quasar.platform.is.mobile)
|
||||||
|
stateStore.rightDrawer = false;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Teleport to="#actions-append" v-if="stateStore.isHeaderMounted()">
|
<Teleport to="#actions-append" v-if="stateStore.isHeaderMounted()">
|
||||||
|
@ -45,7 +33,7 @@ const stateStore = useStateStore();
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</div>
|
</div>
|
||||||
</Teleport>
|
</Teleport>
|
||||||
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256">
|
||||||
<QScrollArea class="fit">
|
<QScrollArea class="fit">
|
||||||
<div id="right-panel"></div>
|
<div id="right-panel"></div>
|
||||||
<slot v-if="!hasContent" name="right-panel" />
|
<slot v-if="!hasContent" name="right-panel" />
|
||||||
|
|
|
@ -14,6 +14,7 @@ defineProps({
|
||||||
hide-dropdown-icon
|
hide-dropdown-icon
|
||||||
focus-on-mount
|
focus-on-mount
|
||||||
@update:model-value="promise"
|
@update:model-value="promise"
|
||||||
|
data-cy="vnBtnSelect_select"
|
||||||
/>
|
/>
|
||||||
</QBtnDropdown>
|
</QBtnDropdown>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -12,6 +12,7 @@ const props = defineProps({
|
||||||
baseUrl: { type: String, default: undefined },
|
baseUrl: { type: String, default: undefined },
|
||||||
customUrl: { type: String, default: undefined },
|
customUrl: { type: String, default: undefined },
|
||||||
filter: { type: Object, default: () => {} },
|
filter: { type: Object, default: () => {} },
|
||||||
|
userFilter: { type: Object, default: () => {} },
|
||||||
descriptor: { type: Object, required: true },
|
descriptor: { type: Object, required: true },
|
||||||
filterPanel: { type: Object, default: undefined },
|
filterPanel: { type: Object, default: undefined },
|
||||||
searchDataKey: { type: String, default: undefined },
|
searchDataKey: { type: String, default: undefined },
|
||||||
|
@ -32,6 +33,7 @@ const url = computed(() => {
|
||||||
const arrayData = useArrayData(props.dataKey, {
|
const arrayData = useArrayData(props.dataKey, {
|
||||||
url: url.value,
|
url: url.value,
|
||||||
filter: props.filter,
|
filter: props.filter,
|
||||||
|
userFilter: props.userFilter,
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import VnRow from '../ui/VnRow.vue';
|
import VnRow from '../ui/VnRow.vue';
|
||||||
import VnInput from './VnInput.vue';
|
|
||||||
import FetchData from '../FetchData.vue';
|
import FetchData from '../FetchData.vue';
|
||||||
import useNotify from 'src/composables/useNotify';
|
import useNotify from 'src/composables/useNotify';
|
||||||
|
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
submitFn: { type: Function, default: () => {} },
|
submitFn: { type: Function, default: () => {} },
|
||||||
|
@ -70,19 +70,19 @@ defineExpose({ show: () => changePassDialog.value.show() });
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QForm ref="form">
|
<QForm ref="form">
|
||||||
<QCardSection>
|
<QCardSection>
|
||||||
<VnInput
|
<VnInputPassword
|
||||||
v-if="props.askOldPass"
|
v-if="props.askOldPass"
|
||||||
:label="t('Old password')"
|
:label="t('Old password')"
|
||||||
v-model="passwords.oldPassword"
|
v-model="passwords.oldPassword"
|
||||||
type="password"
|
|
||||||
:required="true"
|
:required="true"
|
||||||
|
:toggle-visibility="true"
|
||||||
autofocus
|
autofocus
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInputPassword
|
||||||
:label="t('New password')"
|
:label="t('New password')"
|
||||||
v-model="passwords.newPassword"
|
v-model="passwords.newPassword"
|
||||||
type="password"
|
|
||||||
:required="true"
|
:required="true"
|
||||||
|
:toggle-visibility="true"
|
||||||
:info="
|
:info="
|
||||||
t('passwordRequirements', {
|
t('passwordRequirements', {
|
||||||
length: requirements.length,
|
length: requirements.length,
|
||||||
|
@ -95,10 +95,10 @@ defineExpose({ show: () => changePassDialog.value.show() });
|
||||||
autofocus
|
autofocus
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<VnInput
|
<VnInputPassword
|
||||||
:label="t('Repeat password')"
|
:label="t('Repeat password')"
|
||||||
v-model="passwords.repeatPassword"
|
v-model="passwords.repeatPassword"
|
||||||
type="password"
|
:toggle-visibility="true"
|
||||||
/>
|
/>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QForm>
|
</QForm>
|
||||||
|
|
|
@ -11,9 +11,9 @@ function getBadgeAttrs(date) {
|
||||||
|
|
||||||
let timeDiff = today - timeTicket;
|
let timeDiff = today - timeTicket;
|
||||||
|
|
||||||
if (timeDiff == 0) return { color: 'warning', 'text-color': 'black' };
|
if (timeDiff == 0) return { color: 'warning', class: 'black-text-color' };
|
||||||
if (timeDiff < 0) return { color: 'success', 'text-color': 'black' };
|
if (timeDiff < 0) return { color: 'success', class: 'black-text-color' };
|
||||||
return { color: 'transparent', 'text-color': 'white' };
|
return { color: 'transparent', class: 'normal-text-color' };
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatShippedDate(date) {
|
function formatShippedDate(date) {
|
||||||
|
@ -29,3 +29,11 @@ function formatShippedDate(date) {
|
||||||
{{ formatShippedDate(date) }}
|
{{ formatShippedDate(date) }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
</template>
|
</template>
|
||||||
|
<style lang="scss">
|
||||||
|
.black-text-color {
|
||||||
|
color: var(--vn-black-text-color);
|
||||||
|
}
|
||||||
|
.normal-text-color {
|
||||||
|
color: var(--vn-text-color);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -297,7 +297,7 @@ defineExpose({
|
||||||
ref="dmsRef"
|
ref="dmsRef"
|
||||||
:data-key="$props.model"
|
:data-key="$props.model"
|
||||||
:url="$props.model"
|
:url="$props.model"
|
||||||
:filter="dmsFilter"
|
:user-filter="dmsFilter"
|
||||||
:order="['dmsFk DESC']"
|
:order="['dmsFk DESC']"
|
||||||
:auto-load="true"
|
:auto-load="true"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
|
|
|
@ -42,6 +42,10 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
uppercase: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const vnInputRef = ref(null);
|
const vnInputRef = ref(null);
|
||||||
|
@ -116,6 +120,10 @@ const handleInsertMode = (e) => {
|
||||||
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleUppercase = () => {
|
||||||
|
value.value = value.value?.toUpperCase() || '';
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -134,20 +142,23 @@ const handleInsertMode = (e) => {
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_input'"
|
:data-cy="$attrs.dataCy ?? $attrs.label + '_input'"
|
||||||
>
|
>
|
||||||
<template v-if="$slots.prepend" #prepend>
|
<template #prepend>
|
||||||
<slot name="prepend" />
|
<slot name="prepend" />
|
||||||
</template>
|
</template>
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon
|
<QIcon
|
||||||
name="close"
|
name="close"
|
||||||
size="xs"
|
size="xs"
|
||||||
v-if="
|
:style="{
|
||||||
hover &&
|
visibility:
|
||||||
value &&
|
hover &&
|
||||||
!$attrs.disabled &&
|
value &&
|
||||||
!$attrs.readonly &&
|
!$attrs.disabled &&
|
||||||
$props.clearable
|
!$attrs.readonly &&
|
||||||
"
|
$props.clearable
|
||||||
|
? 'visible'
|
||||||
|
: 'hidden',
|
||||||
|
}"
|
||||||
@click="
|
@click="
|
||||||
() => {
|
() => {
|
||||||
value = null;
|
value = null;
|
||||||
|
@ -156,6 +167,15 @@ const handleInsertMode = (e) => {
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
></QIcon>
|
></QIcon>
|
||||||
|
|
||||||
|
<QIcon
|
||||||
|
name="match_case"
|
||||||
|
size="xs"
|
||||||
|
v-if="!$attrs.disabled && !($attrs.readonly) && $props.uppercase"
|
||||||
|
@click="handleUppercase"
|
||||||
|
class="uppercase-icon"
|
||||||
|
/>
|
||||||
|
|
||||||
<slot name="append" v-if="$slots.append && !$attrs.disabled" />
|
<slot name="append" v-if="$slots.append && !$attrs.disabled" />
|
||||||
<QIcon v-if="info" name="info">
|
<QIcon v-if="info" name="info">
|
||||||
<QTooltip max-width="350px">
|
<QTooltip max-width="350px">
|
||||||
|
@ -166,6 +186,7 @@ const handleInsertMode = (e) => {
|
||||||
</QInput>
|
</QInput>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
inputMin: Must be more than {value}
|
inputMin: Must be more than {value}
|
||||||
|
@ -176,8 +197,3 @@ const handleInsertMode = (e) => {
|
||||||
maxLength: El valor excede los {value} carácteres
|
maxLength: El valor excede los {value} carácteres
|
||||||
inputMax: Debe ser menor a {value}
|
inputMax: Debe ser menor a {value}
|
||||||
</i18n>
|
</i18n>
|
||||||
<style lang="scss">
|
|
||||||
.q-field__append {
|
|
||||||
padding-inline: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, watch, computed, ref, useAttrs } from 'vue';
|
import { onMounted, watch, computed, ref, useAttrs } from 'vue';
|
||||||
import { date } from 'quasar';
|
import { date } from 'quasar';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import VnDate from './VnDate.vue';
|
import VnDate from './VnDate.vue';
|
||||||
import { useRequired } from 'src/composables/useRequired';
|
import { useRequired } from 'src/composables/useRequired';
|
||||||
|
|
||||||
const $attrs = useAttrs();
|
const $attrs = useAttrs();
|
||||||
const { isRequired, requiredFieldRule } = useRequired($attrs);
|
const { isRequired, requiredFieldRule } = useRequired($attrs);
|
||||||
const model = defineModel({ type: [String, Date] });
|
const model = defineModel({ type: [String, Date] });
|
||||||
const { t } = useI18n();
|
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
isOutlined: {
|
isOutlined: {
|
||||||
|
@ -106,7 +104,8 @@ const manageDate = (date) => {
|
||||||
:class="{ required: isRequired }"
|
:class="{ required: isRequired }"
|
||||||
:rules="mixinRules"
|
:rules="mixinRules"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
@click="isPopupOpen = true"
|
@click="isPopupOpen = !isPopupOpen"
|
||||||
|
@keydown="isPopupOpen = false"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
|
@ -125,13 +124,6 @@ const manageDate = (date) => {
|
||||||
isPopupOpen = false;
|
isPopupOpen = false;
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<QIcon
|
|
||||||
v-if="showEvent"
|
|
||||||
name="event"
|
|
||||||
class="cursor-pointer"
|
|
||||||
@click="isPopupOpen = !isPopupOpen"
|
|
||||||
:title="t('Open date')"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<QMenu
|
<QMenu
|
||||||
v-if="$q.screen.gt.xs"
|
v-if="$q.screen.gt.xs"
|
||||||
|
@ -151,15 +143,6 @@ const manageDate = (date) => {
|
||||||
</QInput>
|
</QInput>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss">
|
|
||||||
.vn-input-date.q-field--standard.q-field--readonly .q-field__control:before {
|
|
||||||
border-bottom-style: solid;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vn-input-date.q-field--outlined.q-field--readonly .q-field__control:before {
|
|
||||||
border-style: solid;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Open date: Abrir fecha
|
Open date: Abrir fecha
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
<script setup>
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
const model = defineModel({ type: [Number, String] });
|
||||||
|
const $props = defineProps({
|
||||||
|
toggleVisibility: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const showPassword = ref(false);
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VnInput
|
||||||
|
v-bind="{ ...$attrs }"
|
||||||
|
v-model="model"
|
||||||
|
:type="
|
||||||
|
$props.toggleVisibility ? (showPassword ? 'text' : 'password') : $attrs.type
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<template #append v-if="toggleVisibility">
|
||||||
|
<QIcon
|
||||||
|
:name="showPassword ? 'visibility_off' : 'visibility'"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="showPassword = !showPassword"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</VnInput>
|
||||||
|
</template>
|
|
@ -1,13 +1,11 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref, useAttrs } from 'vue';
|
import { computed, ref, useAttrs } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import { date } from 'quasar';
|
import { date } from 'quasar';
|
||||||
import VnTime from './VnTime.vue';
|
import VnTime from './VnTime.vue';
|
||||||
import { useRequired } from 'src/composables/useRequired';
|
import { useRequired } from 'src/composables/useRequired';
|
||||||
|
|
||||||
const $attrs = useAttrs();
|
const $attrs = useAttrs();
|
||||||
const { isRequired, requiredFieldRule } = useRequired($attrs);
|
const { isRequired, requiredFieldRule } = useRequired($attrs);
|
||||||
const { t } = useI18n();
|
|
||||||
const model = defineModel({ type: String });
|
const model = defineModel({ type: String });
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
timeOnly: {
|
timeOnly: {
|
||||||
|
@ -80,7 +78,8 @@ function dateToTime(newDate) {
|
||||||
:class="{ required: isRequired }"
|
:class="{ required: isRequired }"
|
||||||
style="min-width: 100px"
|
style="min-width: 100px"
|
||||||
:rules="mixinRules"
|
:rules="mixinRules"
|
||||||
@click="isPopupOpen = false"
|
@click="isPopupOpen = !isPopupOpen"
|
||||||
|
@keydown="isPopupOpen = false"
|
||||||
type="time"
|
type="time"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
>
|
>
|
||||||
|
@ -100,12 +99,6 @@ function dateToTime(newDate) {
|
||||||
isPopupOpen = false;
|
isPopupOpen = false;
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<QIcon
|
|
||||||
name="Schedule"
|
|
||||||
class="cursor-pointer"
|
|
||||||
@click="isPopupOpen = !isPopupOpen"
|
|
||||||
:title="t('Open time')"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<QMenu
|
<QMenu
|
||||||
v-if="$q.screen.gt.xs"
|
v-if="$q.screen.gt.xs"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
|
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
|
||||||
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { computed } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { useAttrs } from 'vue';
|
import { useAttrs } from 'vue';
|
||||||
import { useRequired } from 'src/composables/useRequired';
|
import { useRequired } from 'src/composables/useRequired';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -16,6 +16,14 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.location,
|
||||||
|
(newValue) => {
|
||||||
|
if (!modelValue.value) return;
|
||||||
|
modelValue.value = formatLocation(newValue) ?? null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const mixinRules = [requiredFieldRule];
|
const mixinRules = [requiredFieldRule];
|
||||||
const locationProperties = [
|
const locationProperties = [
|
||||||
'postcode',
|
'postcode',
|
||||||
|
@ -26,7 +34,7 @@ const locationProperties = [
|
||||||
(obj) => obj.country?.name,
|
(obj) => obj.country?.name,
|
||||||
];
|
];
|
||||||
|
|
||||||
const formatLocation = (obj, properties) => {
|
const formatLocation = (obj, properties = locationProperties) => {
|
||||||
const parts = properties.map((prop) => {
|
const parts = properties.map((prop) => {
|
||||||
if (typeof prop === 'string') {
|
if (typeof prop === 'string') {
|
||||||
return obj[prop];
|
return obj[prop];
|
||||||
|
@ -43,9 +51,7 @@ const formatLocation = (obj, properties) => {
|
||||||
return filteredParts.join(', ');
|
return filteredParts.join(', ');
|
||||||
};
|
};
|
||||||
|
|
||||||
const modelValue = computed(() =>
|
const modelValue = ref(props.location ? formatLocation(props.location) : null);
|
||||||
props.location ? formatLocation(props.location, locationProperties) : null
|
|
||||||
);
|
|
||||||
|
|
||||||
function showLabel(data) {
|
function showLabel(data) {
|
||||||
const dataProperties = [
|
const dataProperties = [
|
||||||
|
|
|
@ -20,16 +20,15 @@ const hasContent = ref();
|
||||||
let observer;
|
let observer;
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (teleportRef.value) {
|
if (!teleportRef.value) return;
|
||||||
const checkContent = () => {
|
const checkContent = () => {
|
||||||
hasContent.value = teleportRef.value.innerHTML.trim() !== '';
|
hasContent.value = teleportRef.value?.innerHTML?.trim() !== '';
|
||||||
};
|
};
|
||||||
|
|
||||||
observer = new MutationObserver(checkContent);
|
observer = new MutationObserver(checkContent);
|
||||||
observer.observe(teleportRef.value, { childList: true, subtree: true });
|
observer.observe(teleportRef.value, { childList: true, subtree: true });
|
||||||
|
|
||||||
checkContent();
|
checkContent();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,15 @@
|
||||||
import RightMenu from './RightMenu.vue';
|
import RightMenu from './RightMenu.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import VnTableFilter from '../VnTable/VnTableFilter.vue';
|
import VnTableFilter from '../VnTable/VnTableFilter.vue';
|
||||||
import { onBeforeMount, computed } from 'vue';
|
import { onBeforeMount, computed, ref } from 'vue';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useHasContent } from 'src/composables/useHasContent';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
section: {
|
section: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
default: null,
|
||||||
},
|
},
|
||||||
dataKey: {
|
dataKey: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -38,14 +40,30 @@ const $props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
keepData: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const sectionValue = computed(() => $props.section ?? $props.dataKey);
|
const route = useRoute();
|
||||||
let arrayData;
|
let arrayData;
|
||||||
|
const sectionValue = computed(() => $props.section ?? $props.dataKey);
|
||||||
|
const isMainSection = computed(() => {
|
||||||
|
const isSame = sectionValue.value == route.name;
|
||||||
|
if (!isSame && arrayData) {
|
||||||
|
arrayData.reset(['userParams', 'userFilter']);
|
||||||
|
}
|
||||||
|
return isSame;
|
||||||
|
});
|
||||||
|
const searchbarId = 'section-searchbar';
|
||||||
|
const hasContent = useHasContent(`#${searchbarId}`);
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
if ($props.dataKey)
|
if ($props.dataKey)
|
||||||
arrayData = useArrayData($props.dataKey, {
|
arrayData = useArrayData($props.dataKey, {
|
||||||
searchUrl: 'table',
|
searchUrl: 'table',
|
||||||
|
keepData: $props.keepData,
|
||||||
...$props.arrayDataProps,
|
...$props.arrayDataProps,
|
||||||
navigate: $props.redirect,
|
navigate: $props.redirect,
|
||||||
});
|
});
|
||||||
|
@ -54,14 +72,14 @@ onBeforeMount(() => {
|
||||||
<template>
|
<template>
|
||||||
<slot name="searchbar">
|
<slot name="searchbar">
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
v-if="searchBar"
|
v-if="searchBar && !hasContent"
|
||||||
v-bind="arrayDataProps"
|
v-bind="arrayDataProps"
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
:label="$t(`${prefix}.search`)"
|
:label="$t(`${prefix}.search`)"
|
||||||
:info="$t(`${prefix}.searchInfo`)"
|
:info="$t(`${prefix}.searchInfo`)"
|
||||||
/>
|
/>
|
||||||
|
<div :id="searchbarId"></div>
|
||||||
</slot>
|
</slot>
|
||||||
|
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel v-if="$slots['rightMenu'] || rightFilter">
|
<template #right-panel v-if="$slots['rightMenu'] || rightFilter">
|
||||||
<slot name="rightMenu">
|
<slot name="rightMenu">
|
||||||
|
@ -74,6 +92,6 @@ onBeforeMount(() => {
|
||||||
</slot>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
<slot name="body" v-if="sectionValue == $route.name" />
|
<slot name="body" v-if="isMainSection" />
|
||||||
<RouterView v-else />
|
<RouterView v-else />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -113,8 +113,15 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
|
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
|
||||||
const { optionLabel, optionValue, optionFilter, optionFilterValue, options, modelValue } =
|
const {
|
||||||
toRefs($props);
|
optionLabel,
|
||||||
|
optionValue,
|
||||||
|
optionCaption,
|
||||||
|
optionFilter,
|
||||||
|
optionFilterValue,
|
||||||
|
options,
|
||||||
|
modelValue,
|
||||||
|
} = toRefs($props);
|
||||||
const myOptions = ref([]);
|
const myOptions = ref([]);
|
||||||
const myOptionsOriginal = ref([]);
|
const myOptionsOriginal = ref([]);
|
||||||
const vnSelectRef = ref();
|
const vnSelectRef = ref();
|
||||||
|
@ -166,7 +173,11 @@ onMounted(() => {
|
||||||
const arrayDataKey =
|
const arrayDataKey =
|
||||||
$props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
|
$props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
|
||||||
|
|
||||||
const arrayData = useArrayData(arrayDataKey, { url: $props.url, searchUrl: false });
|
const arrayData = useArrayData(arrayDataKey, {
|
||||||
|
url: $props.url,
|
||||||
|
searchUrl: false,
|
||||||
|
mapKey: $attrs['map-key'],
|
||||||
|
});
|
||||||
|
|
||||||
function findKeyInOptions() {
|
function findKeyInOptions() {
|
||||||
if (!$props.options) return;
|
if (!$props.options) return;
|
||||||
|
@ -194,10 +205,10 @@ function filter(val, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!row) return;
|
if (!row) return;
|
||||||
const id = row[$props.optionValue];
|
const id = String(row[$props.optionValue]);
|
||||||
const optionLabel = String(row[$props.optionLabel]).toLowerCase();
|
const optionLabel = String(row[$props.optionLabel]).toLowerCase();
|
||||||
|
|
||||||
return id == search || optionLabel.includes(search);
|
return id.includes(search) || optionLabel.includes(search);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,7 +294,7 @@ async function onScroll({ to, direction, from, index }) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ opts: myOptions });
|
defineExpose({ opts: myOptions, vnSelectRef });
|
||||||
|
|
||||||
function handleKeyDown(event) {
|
function handleKeyDown(event) {
|
||||||
if (event.key === 'Tab' && !event.shiftKey) {
|
if (event.key === 'Tab' && !event.shiftKey) {
|
||||||
|
@ -317,6 +328,11 @@ function handleKeyDown(event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCaption(opt) {
|
||||||
|
if (optionCaption.value === false) return;
|
||||||
|
return opt[optionCaption.value] || opt[optionValue.value];
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -387,8 +403,8 @@ function handleKeyDown(event) {
|
||||||
<QItemLabel>
|
<QItemLabel>
|
||||||
{{ opt[optionLabel] }}
|
{{ opt[optionLabel] }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
<QItemLabel caption v-if="optionCaption !== false">
|
<QItemLabel caption v-if="getCaption(opt)">
|
||||||
{{ `#${opt[optionCaption] || opt[optionValue]}` }}
|
{{ `#${getCaption(opt)}` }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useRole } from 'src/composables/useRole';
|
import { useRole } from 'src/composables/useRole';
|
||||||
import { useAcl } from 'src/composables/useAcl';
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
const emit = defineEmits(['update:modelValue']);
|
const emit = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
const value = defineModel({ type: [String, Number, Object] });
|
const value = defineModel({ type: [String, Number, Object] });
|
||||||
|
const select = ref(null);
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
rolesAllowedToCreate: {
|
rolesAllowedToCreate: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
@ -33,10 +34,13 @@ const isAllowedToCreate = computed(() => {
|
||||||
if ($props.acls.length) return acl.hasAny($props.acls);
|
if ($props.acls.length) return acl.hasAny($props.acls);
|
||||||
return role.hasAny($props.rolesAllowedToCreate);
|
return role.hasAny($props.rolesAllowedToCreate);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
defineExpose({ vnSelectDialogRef: select });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
ref="select"
|
||||||
v-model="value"
|
v-model="value"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
@update:model-value="(...args) => emit('update:modelValue', ...args)"
|
@update:model-value="(...args) => emit('update:modelValue', ...args)"
|
||||||
|
|
|
@ -51,6 +51,7 @@ const url = computed(() => {
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="nickname"
|
option-label="nickname"
|
||||||
:fields="['id', 'name', 'nickname', 'code']"
|
:fields="['id', 'name', 'nickname', 'code']"
|
||||||
|
:filter-options="['id', 'name', 'nickname', 'code']"
|
||||||
sort-by="nickname ASC"
|
sort-by="nickname ASC"
|
||||||
>
|
>
|
||||||
<template #prepend v-if="$props.hasAvatar">
|
<template #prepend v-if="$props.hasAvatar">
|
||||||
|
@ -71,7 +72,7 @@ const url = computed(() => {
|
||||||
{{ scope.opt.nickname }}
|
{{ scope.opt.nickname }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
<QItemLabel caption v-else>
|
<QItemLabel caption v-else>
|
||||||
{{ scope.opt.nickname }}, {{ scope.opt.code }}
|
#{{ scope.opt.id }}, {{ scope.opt.nickname }}, {{ scope.opt.code }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
|
@ -0,0 +1,87 @@
|
||||||
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
|
import VnDmsList from 'src/components/common/VnDmsList.vue';
|
||||||
|
import { vi, afterEach, beforeAll, describe, expect, it } from 'vitest';
|
||||||
|
|
||||||
|
describe('VnDmsList', () => {
|
||||||
|
let vm;
|
||||||
|
const dms = {
|
||||||
|
userFk: 1,
|
||||||
|
name: 'DMS 1'
|
||||||
|
};
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
vi.spyOn(axios, 'get').mockResolvedValue({ data: [] });
|
||||||
|
vm = createWrapper(VnDmsList, {
|
||||||
|
props: {
|
||||||
|
model: 'WorkerDms/1110/filter',
|
||||||
|
defaultDmsCode: 'hhrrData',
|
||||||
|
filter: 'wd.workerFk',
|
||||||
|
updateModel: 'Workers',
|
||||||
|
deleteModel: 'WorkerDms',
|
||||||
|
downloadModel: 'WorkerDms'
|
||||||
|
}
|
||||||
|
}).vm;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('setData()', () => {
|
||||||
|
const data = [
|
||||||
|
{
|
||||||
|
userFk: 1,
|
||||||
|
name: 'Jessica',
|
||||||
|
lastName: 'Jones',
|
||||||
|
file: '4.jpg',
|
||||||
|
created: '2021-07-28 21:00:00'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
userFk: 2,
|
||||||
|
name: 'Bruce',
|
||||||
|
lastName: 'Banner',
|
||||||
|
created: '2022-07-28 21:00:00',
|
||||||
|
dms: {
|
||||||
|
userFk: 2,
|
||||||
|
name: 'Bruce',
|
||||||
|
lastName: 'BannerDMS',
|
||||||
|
created: '2022-07-28 21:00:00',
|
||||||
|
file: '4.jpg',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
userFk: 3,
|
||||||
|
name: 'Natasha',
|
||||||
|
lastName: 'Romanoff',
|
||||||
|
file: '4.jpg',
|
||||||
|
created: '2021-10-28 21:00:00'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
it('Should replace objects that contain the "dms" property with the value of the same and sort by creation date', () => {
|
||||||
|
vm.setData(data);
|
||||||
|
expect([vm.rows][0][0].lastName).toEqual('BannerDMS');
|
||||||
|
expect([vm.rows][0][1].lastName).toEqual('Romanoff');
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('parseDms()', () => {
|
||||||
|
const resultDms = { ...dms, userId:1};
|
||||||
|
|
||||||
|
it('Should add properties that end with "Fk" by changing the suffix to "Id"', () => {
|
||||||
|
const parsedDms = vm.parseDms(dms);
|
||||||
|
expect(parsedDms).toEqual(resultDms);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('showFormDialog()', () => {
|
||||||
|
const resultDms = { ...dms, userId:1};
|
||||||
|
|
||||||
|
it('should call fn parseDms() and set show true if dms is defined', () => {
|
||||||
|
vm.showFormDialog(dms);
|
||||||
|
expect(vm.formDialog.show).toEqual(true);
|
||||||
|
expect(vm.formDialog.dms).toEqual(resultDms);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,72 @@
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper.js';
|
||||||
|
import { describe, it, expect } from 'vitest';
|
||||||
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
|
|
||||||
|
let vm;
|
||||||
|
let wrapper;
|
||||||
|
|
||||||
|
function generateWrapper(date, outlined, required) {
|
||||||
|
wrapper = createWrapper(VnInputDate, {
|
||||||
|
props: {
|
||||||
|
modelValue: date,
|
||||||
|
},
|
||||||
|
attrs: {
|
||||||
|
isOutlined: outlined,
|
||||||
|
required: required
|
||||||
|
},
|
||||||
|
});
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
vm = wrapper.vm;
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('VnInputDate', () => {
|
||||||
|
|
||||||
|
describe('formattedDate', () => {
|
||||||
|
it('formats a valid date correctly', async () => {
|
||||||
|
generateWrapper('2023-12-25', false, false);
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(vm.formattedDate).toBe('25/12/2023');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('updates the model value when a new date is set', async () => {
|
||||||
|
const input = wrapper.find('input');
|
||||||
|
await input.setValue('31/12/2023');
|
||||||
|
expect(wrapper.emitted()['update:modelValue']).toBeTruthy();
|
||||||
|
expect(wrapper.emitted()['update:modelValue'][0][0]).toBe('2023-12-31T00:00:00.000Z');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not update the model value when an invalid date is set', async () => {
|
||||||
|
const input = wrapper.find('input');
|
||||||
|
await input.setValue('invalid-date');
|
||||||
|
expect(wrapper.emitted()['update:modelValue'][0][0]).toBe('2023-12-31T00:00:00.000Z');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('styleAttrs', () => {
|
||||||
|
it('should return empty styleAttrs when isOutlined is false', async () => {
|
||||||
|
generateWrapper('2023-12-25', false, false);
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(vm.styleAttrs).toEqual({});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set styleAttrs when isOutlined is true', async () => {
|
||||||
|
generateWrapper('2023-12-25', true, false);
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(vm.styleAttrs.outlined).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('required', () => {
|
||||||
|
it('should not applies required class when isRequired is false', async () => {
|
||||||
|
generateWrapper('2023-12-25', false, false);
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(wrapper.find('.vn-input-date').classes()).not.toContain('required');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should applies required class when isRequired is true', async () => {
|
||||||
|
generateWrapper('2023-12-25', false, true);
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(wrapper.find('.vn-input-date').classes()).toContain('required');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,63 @@
|
||||||
|
import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest';
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
import VnInputTime from 'components/common/VnInputTime.vue';
|
||||||
|
|
||||||
|
describe('VnInputTime', () => {
|
||||||
|
let wrapper;
|
||||||
|
let vm;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
wrapper = createWrapper(VnInputTime, {
|
||||||
|
props: {
|
||||||
|
isOutlined: true,
|
||||||
|
timeOnly: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
vm = wrapper.vm;
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return the correct data if isOutlined is true', () => {
|
||||||
|
expect(vm.isOutlined).toBe(true);
|
||||||
|
expect(vm.styleAttrs).toEqual({ dense: true, outlined: true, rounded: true });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return the formatted data', () => {
|
||||||
|
expect(vm.dateToTime('2022-01-01T03:23:43')).toBe('03:23');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('formattedTime', () => {
|
||||||
|
it('should return the formatted time for a valid ISO date', () => {
|
||||||
|
vm.model = '2025-01-02T15:45:00';
|
||||||
|
expect(vm.formattedTime).toBe('15:45');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle null model value gracefully', () => {
|
||||||
|
vm.model = null;
|
||||||
|
expect(vm.formattedTime).toBe(null);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle time-only input correctly', async () => {
|
||||||
|
await wrapper.setProps({ timeOnly: true });
|
||||||
|
vm.formattedTime = '14:30';
|
||||||
|
expect(vm.model).toBe('14:30');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should pad short time values correctly', async () => {
|
||||||
|
await wrapper.setProps({ timeOnly: true });
|
||||||
|
vm.formattedTime = '9';
|
||||||
|
expect(vm.model).toBe('09:00');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not update the model if the value is unchanged', () => {
|
||||||
|
vm.model = '14:30';
|
||||||
|
const previousModel = vm.model;
|
||||||
|
vm.formattedTime = '14:30';
|
||||||
|
expect(vm.model).toBe(previousModel);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,95 @@
|
||||||
|
import { describe, it, expect } from 'vitest';
|
||||||
|
import VnJsonValue from 'src/components/common/VnJsonValue.vue';
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
|
||||||
|
const buildComponent = (props) => {
|
||||||
|
return createWrapper(VnJsonValue, {
|
||||||
|
props,
|
||||||
|
}).wrapper;
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('VnJsonValue', () => {
|
||||||
|
it('renders null value correctly', async () => {
|
||||||
|
const wrapper = buildComponent({ value: null });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('∅');
|
||||||
|
expect(span.classes()).toContain('json-null');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders boolean true correctly', async () => {
|
||||||
|
const wrapper = buildComponent({ value: true });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('✓');
|
||||||
|
expect(span.classes()).toContain('json-true');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders boolean false correctly', async () => {
|
||||||
|
const wrapper = buildComponent({ value: false });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('✗');
|
||||||
|
expect(span.classes()).toContain('json-false');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders a short string correctly', async () => {
|
||||||
|
const wrapper = buildComponent({ value: 'Hello' });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('Hello');
|
||||||
|
expect(span.classes()).toContain('json-string');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders a long string correctly with ellipsis', async () => {
|
||||||
|
const longString = 'a'.repeat(600);
|
||||||
|
const wrapper = buildComponent({ value: longString });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toContain('...');
|
||||||
|
expect(span.text().length).toBeLessThanOrEqual(515);
|
||||||
|
expect(span.attributes('title')).toBe(longString);
|
||||||
|
expect(span.classes()).toContain('json-string');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders a number correctly', async () => {
|
||||||
|
const wrapper = buildComponent({ value: 123.4567 });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('123.457');
|
||||||
|
expect(span.classes()).toContain('json-number');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders an integer correctly', async () => {
|
||||||
|
const wrapper = buildComponent({ value: 42 });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('42');
|
||||||
|
expect(span.classes()).toContain('json-number');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders a date correctly', async () => {
|
||||||
|
const date = new Date('2023-01-01');
|
||||||
|
const wrapper = buildComponent({ value: date });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('2023-01-01');
|
||||||
|
expect(span.classes()).toContain('json-object');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders an object correctly', async () => {
|
||||||
|
const obj = { key: 'value' };
|
||||||
|
const wrapper = buildComponent({ value: obj });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe(obj.toString());
|
||||||
|
expect(span.classes()).toContain('json-object');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders an array correctly', async () => {
|
||||||
|
const arr = [1, 2, 3];
|
||||||
|
const wrapper = buildComponent({ value: arr });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe(arr.toString());
|
||||||
|
expect(span.classes()).toContain('json-object');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('updates value when prop changes', async () => {
|
||||||
|
const wrapper = buildComponent({ value: true });
|
||||||
|
await wrapper.setProps({ value: 123 });
|
||||||
|
const span = wrapper.find('span');
|
||||||
|
expect(span.text()).toBe('123');
|
||||||
|
expect(span.classes()).toContain('json-number');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,91 @@
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
import VnLocation from 'components/common/VnLocation.vue';
|
||||||
|
import { vi, afterEach, expect, it, beforeEach, describe } from 'vitest';
|
||||||
|
|
||||||
|
function buildComponent(data) {
|
||||||
|
return createWrapper(VnLocation, {
|
||||||
|
global: {
|
||||||
|
props: {
|
||||||
|
location: data
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}).vm;
|
||||||
|
}
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('formatLocation', () => {
|
||||||
|
let locationBase;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
locationBase = {
|
||||||
|
postcode: '46680',
|
||||||
|
city: 'Algemesi',
|
||||||
|
province: { name: 'Valencia' },
|
||||||
|
country: { name: 'Spain' }
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return the postcode, city, province and country', () => {
|
||||||
|
const location = { ...locationBase };
|
||||||
|
const vm = buildComponent(location);
|
||||||
|
expect(vm.formatLocation(location)).toEqual('46680, Algemesi(Valencia), Spain');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return the postcode and country', () => {
|
||||||
|
const location = { ...locationBase, city: undefined };
|
||||||
|
const vm = buildComponent(location);
|
||||||
|
expect(vm.formatLocation(location)).toEqual('46680, Spain');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return the city, province and country', () => {
|
||||||
|
const location = { ...locationBase, postcode: undefined };
|
||||||
|
const vm = buildComponent(location);
|
||||||
|
expect(vm.formatLocation(location)).toEqual('Algemesi(Valencia), Spain');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return the country', () => {
|
||||||
|
const location = { ...locationBase, postcode: undefined, city: undefined, province: undefined };
|
||||||
|
const vm = buildComponent(location);
|
||||||
|
expect(vm.formatLocation(location)).toEqual('Spain');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('showLabel', () => {
|
||||||
|
let locationBase;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
locationBase = {
|
||||||
|
code: '46680',
|
||||||
|
town: 'Algemesi',
|
||||||
|
province: 'Valencia',
|
||||||
|
country: 'Spain'
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should show the label with postcode, city, province and country', () => {
|
||||||
|
const location = { ...locationBase };
|
||||||
|
const vm = buildComponent(location);
|
||||||
|
expect(vm.showLabel(location)).toEqual('46680, Algemesi(Valencia), Spain');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should show the label with postcode and country', () => {
|
||||||
|
const location = { ...locationBase, town: undefined };
|
||||||
|
const vm = buildComponent(location);
|
||||||
|
expect(vm.showLabel(location)).toEqual('46680, Spain');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should show the label with city, province and country', () => {
|
||||||
|
const location = { ...locationBase, code: undefined };
|
||||||
|
const vm = buildComponent(location);
|
||||||
|
expect(vm.showLabel(location)).toEqual('Algemesi(Valencia), Spain');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should show the label with country', () => {
|
||||||
|
const location = { ...locationBase, code: undefined, town: undefined, province: undefined };
|
||||||
|
const vm = buildComponent(location);
|
||||||
|
expect(vm.showLabel(location)).toEqual('Spain');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,107 @@
|
||||||
|
import { describe, it, expect, vi, beforeAll, afterEach, beforeEach } from 'vitest';
|
||||||
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
|
import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||||
|
|
||||||
|
describe('VnNotes', () => {
|
||||||
|
let vm;
|
||||||
|
let wrapper;
|
||||||
|
let spyFetch;
|
||||||
|
let postMock;
|
||||||
|
let expectedBody;
|
||||||
|
const mockData= {name: 'Tony', lastName: 'Stark', text: 'Test Note', observationTypeFk: 1};
|
||||||
|
|
||||||
|
function generateExpectedBody() {
|
||||||
|
expectedBody = {...vm.$props.body, ...{ text: vm.newNote.text, observationTypeFk: vm.newNote.observationTypeFk }};
|
||||||
|
}
|
||||||
|
|
||||||
|
async function setTestParams(text, observationType, type){
|
||||||
|
vm.newNote.text = text;
|
||||||
|
vm.newNote.observationTypeFk = observationType;
|
||||||
|
wrapper.setProps({ selectType: type });
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
vi.spyOn(axios, 'get').mockReturnValue({ data: [] });
|
||||||
|
|
||||||
|
wrapper = createWrapper(VnNotes, {
|
||||||
|
propsData: {
|
||||||
|
url: '/test',
|
||||||
|
body: { name: 'Tony', lastName: 'Stark' },
|
||||||
|
}
|
||||||
|
});
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
vm = wrapper.vm;
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
postMock = vi.spyOn(axios, 'post').mockResolvedValue(mockData);
|
||||||
|
spyFetch = vi.spyOn(vm.vnPaginateRef, 'fetch').mockImplementation(() => vi.fn());
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
expectedBody = {};
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('insert', () => {
|
||||||
|
it('should not call axios.post and vnPaginateRef.fetch if newNote.text is null', async () => {
|
||||||
|
await setTestParams( null, null, true );
|
||||||
|
|
||||||
|
await vm.insert();
|
||||||
|
|
||||||
|
expect(postMock).not.toHaveBeenCalled();
|
||||||
|
expect(spyFetch).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not call axios.post and vnPaginateRef.fetch if newNote.text is empty', async () => {
|
||||||
|
await setTestParams( "", null, false );
|
||||||
|
|
||||||
|
await vm.insert();
|
||||||
|
|
||||||
|
expect(postMock).not.toHaveBeenCalled();
|
||||||
|
expect(spyFetch).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not call axios.post and vnPaginateRef.fetch if observationTypeFk is missing and selectType is true', async () => {
|
||||||
|
await setTestParams( "Test Note", null, true );
|
||||||
|
|
||||||
|
await vm.insert();
|
||||||
|
|
||||||
|
expect(postMock).not.toHaveBeenCalled();
|
||||||
|
expect(spyFetch).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should call axios.post and vnPaginateRef.fetch if observationTypeFk is missing and selectType is false', async () => {
|
||||||
|
await setTestParams( "Test Note", null, false );
|
||||||
|
|
||||||
|
generateExpectedBody();
|
||||||
|
|
||||||
|
await vm.insert();
|
||||||
|
|
||||||
|
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
|
||||||
|
expect(spyFetch).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should call axios.post and vnPaginateRef.fetch if observationTypeFk is setted and selectType is false', async () => {
|
||||||
|
await setTestParams( "Test Note", 1, false );
|
||||||
|
|
||||||
|
generateExpectedBody();
|
||||||
|
|
||||||
|
await vm.insert();
|
||||||
|
|
||||||
|
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
|
||||||
|
expect(spyFetch).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should call axios.post and vnPaginateRef.fetch when newNote is valid', async () => {
|
||||||
|
await setTestParams( "Test Note", 1, true );
|
||||||
|
|
||||||
|
generateExpectedBody();
|
||||||
|
|
||||||
|
await vm.insert();
|
||||||
|
|
||||||
|
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
|
||||||
|
expect(spyFetch).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -6,6 +6,7 @@ import { useArrayData } from 'composables/useArrayData';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
import VnMoreOptions from './VnMoreOptions.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
url: {
|
url: {
|
||||||
|
@ -47,7 +48,6 @@ let store;
|
||||||
let entity;
|
let entity;
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName);
|
const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName);
|
||||||
const menuRef = ref();
|
|
||||||
defineExpose({ getData });
|
defineExpose({ getData });
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
|
@ -159,25 +159,11 @@ const toModule = computed(() =>
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
<QBtn
|
<VnMoreOptions v-if="$slots.menu">
|
||||||
v-if="$slots.menu"
|
<template #menu="{ menuRef }">
|
||||||
color="white"
|
<slot name="menu" :entity="entity" :menu-ref="menuRef" />
|
||||||
dense
|
</template>
|
||||||
flat
|
</VnMoreOptions>
|
||||||
icon="more_vert"
|
|
||||||
round
|
|
||||||
size="md"
|
|
||||||
data-cy="descriptor-more-opts"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('components.cardDescriptor.moreOptions') }}
|
|
||||||
</QTooltip>
|
|
||||||
<QMenu :ref="menuRef">
|
|
||||||
<QList>
|
|
||||||
<slot name="menu" :entity="entity" :menu-ref="menuRef" />
|
|
||||||
</QList>
|
|
||||||
</QMenu>
|
|
||||||
</QBtn>
|
|
||||||
</div>
|
</div>
|
||||||
<slot name="before" />
|
<slot name="before" />
|
||||||
<div class="body q-py-sm">
|
<div class="body q-py-sm">
|
||||||
|
@ -222,8 +208,8 @@ const toModule = computed(() =>
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss">
|
||||||
:deep(.body) {
|
.body {
|
||||||
background-color: var(--vn-section-color);
|
background-color: var(--vn-section-color);
|
||||||
.text-h5 {
|
.text-h5 {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
@ -262,7 +248,9 @@ const toModule = computed(() =>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
.title {
|
.title {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
import { ref, computed, watch, onBeforeMount } from 'vue';
|
import { ref, computed, watch, onBeforeMount } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
|
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { isDialogOpened } from 'src/filters';
|
import { isDialogOpened } from 'src/filters';
|
||||||
|
import VnMoreOptions from './VnMoreOptions.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
url: {
|
url: {
|
||||||
|
@ -81,11 +81,16 @@ async function fetch() {
|
||||||
<span v-else></span>
|
<span v-else></span>
|
||||||
</slot>
|
</slot>
|
||||||
<slot name="header" :entity="entity" dense>
|
<slot name="header" :entity="entity" dense>
|
||||||
<VnLv :label="`${entity.id} -`" :value="entity.name" />
|
{{ entity.id + ' - ' + entity.name }}
|
||||||
</slot>
|
|
||||||
<slot name="header-right" :entity="entity">
|
|
||||||
<span></span>
|
|
||||||
</slot>
|
</slot>
|
||||||
|
<span class="row no-wrap">
|
||||||
|
<slot name="header-right" :entity="entity" />
|
||||||
|
<VnMoreOptions v-if="$slots.menu && isDialogOpened()">
|
||||||
|
<template #menu="{ menuRef }">
|
||||||
|
<slot name="menu" :entity="entity" :menu-ref="menuRef" />
|
||||||
|
</template>
|
||||||
|
</VnMoreOptions>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="summaryBody row q-mb-md">
|
<div class="summaryBody row q-mb-md">
|
||||||
<slot name="body" :entity="entity" />
|
<slot name="body" :entity="entity" />
|
||||||
|
|
|
@ -16,7 +16,12 @@ const $props = defineProps({
|
||||||
required: false,
|
required: false,
|
||||||
default: 'value',
|
default: 'value',
|
||||||
},
|
},
|
||||||
|
columns: {
|
||||||
|
type: Number,
|
||||||
|
default: 3,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const tags = computed(() => {
|
const tags = computed(() => {
|
||||||
return Object.keys($props.item)
|
return Object.keys($props.item)
|
||||||
.filter((i) => i.startsWith(`${$props.tag}`))
|
.filter((i) => i.startsWith(`${$props.tag}`))
|
||||||
|
@ -28,10 +33,21 @@ const tags = computed(() => {
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const columnStyle = computed(() => {
|
||||||
|
if ($props.columns) {
|
||||||
|
return {
|
||||||
|
'grid-template-columns': `repeat(${$props.columns}, 1fr)`,
|
||||||
|
'max-width': `${$props.columns * 4}rem`,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="fetchedTags">
|
<div class="fetchedTags">
|
||||||
<div class="wrap">
|
<div class="wrap" :style="columnStyle">
|
||||||
<div
|
<div
|
||||||
v-for="(val, key) in tags"
|
v-for="(val, key) in tags"
|
||||||
:key="key"
|
:key="key"
|
||||||
|
@ -39,37 +55,43 @@ const tags = computed(() => {
|
||||||
:title="`${key}: ${val}`"
|
:title="`${key}: ${val}`"
|
||||||
:class="{ empty: !val }"
|
:class="{ empty: !val }"
|
||||||
>
|
>
|
||||||
{{ val }}
|
<span class="text">{{ val }} </span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.fetchedTags {
|
.fetchedTags {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.wrap {
|
.wrap {
|
||||||
width: 100%;
|
display: grid;
|
||||||
flex-wrap: wrap;
|
|
||||||
display: flex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.inline-tag {
|
.inline-tag {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
height: 1rem;
|
height: 1rem;
|
||||||
margin: 0.05rem;
|
margin: 0.05rem;
|
||||||
color: $color-font-secondary;
|
color: var(--vn-label-color);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: smaller;
|
font-size: smaller;
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
flex: 1;
|
border: 1px solid var(--vn-label-color);
|
||||||
border: 1px solid $color-spacer;
|
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
min-width: 4rem;
|
min-width: 4rem;
|
||||||
max-width: 4rem;
|
max-width: 4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
font-size: smaller;
|
||||||
|
}
|
||||||
.empty {
|
.empty {
|
||||||
border: 1px solid #2b2b2b;
|
border: 1px solid var(--vn-empty-tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,38 +1,49 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="header bg-primary q-pa-sm q-mb-md">
|
<div class="header bg-primary q-pa-sm q-mb-md">
|
||||||
<QSkeleton type="rect" square />
|
<QSkeleton type="rect" square />
|
||||||
|
<QSkeleton type="rect" square />
|
||||||
</div>
|
</div>
|
||||||
<div class="row q-pa-md q-col-gutter-md q-mb-md">
|
<div class="row q-pa-md q-col-gutter-md q-mb-md">
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<div class="col">
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
</div>
|
||||||
<QSkeleton type="text" square />
|
<div class="col">
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
</div>
|
||||||
<QSkeleton type="text" square />
|
<div class="col">
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
</div>
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<div class="col">
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
|
<QSkeleton type="text" square />
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
|
<QSkeleton type="text" square />
|
||||||
|
<QSkeleton type="text" square />
|
||||||
|
<QSkeleton type="text" square />
|
||||||
|
<QSkeleton type="text" square />
|
||||||
|
<QSkeleton type="text" square />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,7 @@ const getLocale = (label) => {
|
||||||
const globalLocale = `globals.params.${param}`;
|
const globalLocale = `globals.params.${param}`;
|
||||||
if (te(globalLocale)) return t(globalLocale);
|
if (te(globalLocale)) return t(globalLocale);
|
||||||
else if (te(t(`params.${param}`)));
|
else if (te(t(`params.${param}`)));
|
||||||
else return t(`${route.meta.moduleName}.params.${param}`);
|
else return t(`${route.meta.moduleName.toLowerCase()}.params.${param}`);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -202,7 +202,11 @@ const getLocale = (label) => {
|
||||||
style="position: fixed; z-index: 1; right: 0; bottom: 0"
|
style="position: fixed; z-index: 1; right: 0; bottom: 0"
|
||||||
icon="search"
|
icon="search"
|
||||||
@click="search()"
|
@click="search()"
|
||||||
></QBtn>
|
>
|
||||||
|
<QTooltip bottom anchor="bottom right">
|
||||||
|
{{ t('globals.search') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QBtn>
|
||||||
<QForm @submit="search" id="filterPanelForm" @keyup.enter="search()">
|
<QForm @submit="search" id="filterPanelForm" @keyup.enter="search()">
|
||||||
<QList dense>
|
<QList dense>
|
||||||
<QItem class="q-mt-xs">
|
<QItem class="q-mt-xs">
|
||||||
|
|
|
@ -30,7 +30,7 @@ onBeforeMount(async () => {
|
||||||
.data;
|
.data;
|
||||||
if (!channel) channel = defaultChannel;
|
if (!channel) channel = defaultChannel;
|
||||||
|
|
||||||
phone.value = await parsePhone(props.phoneNumber, props.country.toLowerCase());
|
phone.value = await parsePhone(props.phoneNumber, props.country?.toLowerCase());
|
||||||
config[
|
config[
|
||||||
type
|
type
|
||||||
].url = `${url}?customerIdentity=%2B${phone.value}&channelId=${channel}`;
|
].url = `${url}?customerIdentity=%2B${phone.value}&channelId=${channel}`;
|
||||||
|
|
|
@ -39,7 +39,7 @@ const val = computed(() => $props.value);
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div v-if="label || $slots.label" class="label">
|
<div v-if="label || $slots.label" class="label">
|
||||||
<slot name="label">
|
<slot name="label">
|
||||||
<span>{{ label }}</span>
|
<span style="color: var(--vn-label-color)">{{ label }}</span>
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="value">
|
<div class="value">
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
<template>
|
||||||
|
<QBtn
|
||||||
|
color="white"
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
icon="more_vert"
|
||||||
|
round
|
||||||
|
size="md"
|
||||||
|
data-cy="descriptor-more-opts"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ $t('components.cardDescriptor.moreOptions') }}
|
||||||
|
</QTooltip>
|
||||||
|
<QMenu ref="menuRef">
|
||||||
|
<QList>
|
||||||
|
<slot name="menu" :menu-ref="$refs.menuRef" />
|
||||||
|
</QList>
|
||||||
|
</QMenu>
|
||||||
|
</QBtn>
|
||||||
|
</template>
|
|
@ -110,7 +110,7 @@ onBeforeRouteLeave((to, from, next) => {
|
||||||
:url="$props.url"
|
:url="$props.url"
|
||||||
order="created DESC"
|
order="created DESC"
|
||||||
:limit="0"
|
:limit="0"
|
||||||
:filter="$props.filter"
|
:user-filter="$props.filter"
|
||||||
auto-load
|
auto-load
|
||||||
ref="vnPaginateRef"
|
ref="vnPaginateRef"
|
||||||
class="show"
|
class="show"
|
||||||
|
|
|
@ -111,6 +111,7 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
if (!store.keepData) arrayData.reset(['data']);
|
||||||
arrayData.resetPagination();
|
arrayData.resetPagination();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, watch } from 'vue';
|
import { onMounted, ref, computed, watch } from 'vue';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useStateStore } from 'src/stores/useStateStore';
|
import { useStateStore } from 'src/stores/useStateStore';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const state = useStateStore();
|
const state = useStateStore();
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
dataKey: {
|
dataKey: {
|
||||||
|
@ -83,6 +85,17 @@ if (props.redirect)
|
||||||
};
|
};
|
||||||
let arrayData = useArrayData(props.dataKey, arrayDataProps);
|
let arrayData = useArrayData(props.dataKey, arrayDataProps);
|
||||||
let store = arrayData.store;
|
let store = arrayData.store;
|
||||||
|
const to = computed(() => {
|
||||||
|
const url = { path: route.path, query: { ...(route.query ?? {}) } };
|
||||||
|
const searchUrl = arrayData.store.searchUrl;
|
||||||
|
const currentFilter = {
|
||||||
|
...arrayData.store.currentFilter,
|
||||||
|
search: searchText.value || undefined,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (searchUrl) url.query[searchUrl] = JSON.stringify(currentFilter);
|
||||||
|
return url;
|
||||||
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.dataKey,
|
() => props.dataKey,
|
||||||
|
@ -126,28 +139,38 @@ async function search() {
|
||||||
delete filter.params.search;
|
delete filter.params.search;
|
||||||
}
|
}
|
||||||
await arrayData.applyFilter(filter);
|
await arrayData.applyFilter(filter);
|
||||||
|
searchText.value = undefined;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Teleport to="#searchbar" v-if="state.isHeaderMounted()">
|
<Teleport to="#searchbar" v-if="state.isHeaderMounted()">
|
||||||
<QForm @submit="search" id="searchbarForm">
|
<QForm @submit="search" id="searchbarForm">
|
||||||
|
<RouterLink
|
||||||
|
:to="to"
|
||||||
|
@click="
|
||||||
|
!$event.shiftKey && !$event.ctrlKey && search();
|
||||||
|
$refs.input.focus();
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<QIcon
|
||||||
|
v-if="!quasar.platform.is.mobile"
|
||||||
|
class="cursor-pointer"
|
||||||
|
name="search"
|
||||||
|
size="sm"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('link') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</RouterLink>
|
||||||
<VnInput
|
<VnInput
|
||||||
id="searchbar"
|
id="searchbar"
|
||||||
|
ref="input"
|
||||||
v-model.trim="searchText"
|
v-model.trim="searchText"
|
||||||
:placeholder="t(props.label)"
|
:placeholder="t(props.label)"
|
||||||
dense
|
dense
|
||||||
standout
|
|
||||||
autofocus
|
autofocus
|
||||||
data-cy="vnSearchBar"
|
data-cy="vn-searchbar"
|
||||||
|
borderless
|
||||||
>
|
>
|
||||||
<template #prepend>
|
|
||||||
<QIcon
|
|
||||||
v-if="!quasar.platform.is.mobile"
|
|
||||||
class="cursor-pointer"
|
|
||||||
name="search"
|
|
||||||
@click="search"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="props.info && $q.screen.gt.xs"
|
v-if="props.info && $q.screen.gt.xs"
|
||||||
|
@ -172,20 +195,52 @@ async function search() {
|
||||||
.q-field {
|
.q-field {
|
||||||
transition: width 0.36s;
|
transition: width 0.36s;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
|
||||||
<style lang="scss">
|
:deep(.q-field__native) {
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.q-field--dark .q-field__native:focus) {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.q-field--focused) {
|
||||||
|
.q-icon {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.cursor-info {
|
.cursor-info {
|
||||||
cursor: help;
|
cursor: help;
|
||||||
}
|
}
|
||||||
#searchbar {
|
|
||||||
.q-field--standout.q-field--highlighted .q-field__control {
|
.q-form {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 0 5px;
|
||||||
|
background-color: var(--vn-search-color);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: var(--vn-search-color-hover);
|
||||||
|
}
|
||||||
|
&:focus-within {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
color: black;
|
|
||||||
.q-field__native,
|
|
||||||
.q-icon {
|
.q-icon {
|
||||||
color: black !important;
|
color: black;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.q-icon {
|
||||||
|
color: var(--vn-label-color);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
link: click to search, ctrl + click to open in a new tab, shift + click to open in a new window
|
||||||
|
es:
|
||||||
|
link: clic para buscar, ctrl + clic para abrir en una nueva pestaña, shift + clic para abrir en una nueva ventana
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -54,6 +54,7 @@ function formatNumber(number) {
|
||||||
:offset="100"
|
:offset="100"
|
||||||
:limit="5"
|
:limit="5"
|
||||||
auto-load
|
auto-load
|
||||||
|
map-key="smsFk"
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<QCard
|
<QCard
|
||||||
|
|
|
@ -0,0 +1,78 @@
|
||||||
|
import { vi, describe, expect, it, beforeAll, afterEach, beforeEach } from 'vitest';
|
||||||
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
|
import CardSummary from 'src/components/ui/CardSummary.vue';
|
||||||
|
import * as vueRouter from 'vue-router';
|
||||||
|
|
||||||
|
describe('CardSummary', () => {
|
||||||
|
let vm;
|
||||||
|
let wrapper;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
vi.spyOn(axios, 'get').mockResolvedValue({ data: [] });
|
||||||
|
});
|
||||||
|
|
||||||
|
vi.spyOn(vueRouter, 'useRoute').mockReturnValue({
|
||||||
|
query: {},
|
||||||
|
params: {},
|
||||||
|
meta: { moduleName: 'mockName' },
|
||||||
|
path: 'mockName/1/summary',
|
||||||
|
name: 'CardSummary',
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
wrapper = createWrapper(CardSummary, {
|
||||||
|
propsData: {
|
||||||
|
dataKey: 'cardSummaryKey',
|
||||||
|
url: 'cardSummaryUrl',
|
||||||
|
filter: 'cardFilter',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
vm = wrapper.vm;
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should fetch data correctly', async () => {
|
||||||
|
const fetchSpy = vi
|
||||||
|
.spyOn(vm.arrayData, 'fetch')
|
||||||
|
.mockResolvedValue({ data: [{ id: 1, name: 'Test Entity' }] });
|
||||||
|
await vm.fetch();
|
||||||
|
|
||||||
|
expect(fetchSpy).toHaveBeenCalledWith({ append: false, updateRouter: false });
|
||||||
|
expect(wrapper.emitted('onFetch')).toBeTruthy();
|
||||||
|
expect(vm.isLoading).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set correct props to the store', () => {
|
||||||
|
expect(vm.store.url).toEqual('cardSummaryUrl');
|
||||||
|
expect(vm.store.filter).toEqual('cardFilter');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should compute entity correctly from store data', () => {
|
||||||
|
vm.store.data = [{ id: 1, name: 'Entity 1' }];
|
||||||
|
expect(vm.entity).toEqual({ id: 1, name: 'Entity 1' });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle empty data gracefully', () => {
|
||||||
|
vm.store.data = [];
|
||||||
|
expect(vm.entity).toBeUndefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should respond to prop changes and refetch data', async () => {
|
||||||
|
const newUrl = 'CardSummary/35';
|
||||||
|
const newKey = 'cardSummaryKey/35';
|
||||||
|
const fetchSpy = vi.spyOn(vm.arrayData, 'fetch');
|
||||||
|
await wrapper.setProps({ url: newUrl, filter: { key: newKey } });
|
||||||
|
|
||||||
|
expect(fetchSpy).toHaveBeenCalled();
|
||||||
|
expect(vm.store.url).toBe(newUrl);
|
||||||
|
expect(vm.store.filter).toEqual({ key: newKey });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return true if route path ends with /summary' , () => {
|
||||||
|
expect(vm.isSummary).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,81 @@
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
import FetchedTags from 'src/components/ui/FetchedTags.vue';
|
||||||
|
|
||||||
|
describe('tags computed property', () => {
|
||||||
|
it('returns an object with the correct keys and values', () => {
|
||||||
|
const vm = createWrapper(FetchedTags, {
|
||||||
|
props: {
|
||||||
|
item: {
|
||||||
|
tag1: 'JavaScript',
|
||||||
|
value1: 'Programming Language',
|
||||||
|
tag2: 'Vue',
|
||||||
|
value2: 'Framework',
|
||||||
|
tag3: 'EmptyTag',
|
||||||
|
},
|
||||||
|
tag: 'tag',
|
||||||
|
value: 'value',
|
||||||
|
columns: 2,
|
||||||
|
},
|
||||||
|
}).vm;
|
||||||
|
expect(vm.tags).toEqual({
|
||||||
|
JavaScript: 'Programming Language',
|
||||||
|
Vue: 'Framework',
|
||||||
|
EmptyTag: '',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns an empty object if the item prop is an empty object', () => {
|
||||||
|
const vm = createWrapper(FetchedTags, {
|
||||||
|
props: {
|
||||||
|
item: {},
|
||||||
|
tag: 'tag',
|
||||||
|
value: 'value',
|
||||||
|
},
|
||||||
|
}).vm;
|
||||||
|
expect(vm.tags).toEqual({});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should calculate the correct columnStyle when columns prop is defined', () => {
|
||||||
|
const vm = createWrapper(FetchedTags, {
|
||||||
|
props: {
|
||||||
|
item: {
|
||||||
|
tag1: 'JavaScript',
|
||||||
|
value1: 'Programming Language',
|
||||||
|
tag2: 'Vue',
|
||||||
|
value2: 'Framework',
|
||||||
|
tag3: 'EmptyTag',
|
||||||
|
},
|
||||||
|
tag: 'tag',
|
||||||
|
value: 'value',
|
||||||
|
columns: 2,
|
||||||
|
},
|
||||||
|
}).vm;
|
||||||
|
|
||||||
|
const expectedStyle = {
|
||||||
|
'grid-template-columns': 'repeat(2, 1fr)',
|
||||||
|
'max-width': '8rem',
|
||||||
|
};
|
||||||
|
|
||||||
|
expect(vm.columnStyle).toEqual(expectedStyle);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return an empty object for columnStyle when columns prop is not defined', () => {
|
||||||
|
const vm = createWrapper(FetchedTags, {
|
||||||
|
props: {
|
||||||
|
item: {
|
||||||
|
tag1: 'JavaScript',
|
||||||
|
value1: 'Programming Language',
|
||||||
|
tag2: 'Vue',
|
||||||
|
value2: 'Framework',
|
||||||
|
tag3: 'EmptyTag',
|
||||||
|
},
|
||||||
|
tag: 'tag',
|
||||||
|
value: 'value',
|
||||||
|
columns: null,
|
||||||
|
},
|
||||||
|
}).vm;
|
||||||
|
|
||||||
|
expect(vm.columnStyle).toEqual({});
|
||||||
|
});
|
||||||
|
});
|
|
@ -7,7 +7,9 @@ import { isDialogOpened } from 'src/filters';
|
||||||
|
|
||||||
const arrayDataStore = useArrayDataStore();
|
const arrayDataStore = useArrayDataStore();
|
||||||
|
|
||||||
export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
export function useArrayData(key, userOptions) {
|
||||||
|
key ??= useRoute().meta.moduleName;
|
||||||
|
|
||||||
if (!key) throw new Error('ArrayData: A key is required to use this composable');
|
if (!key) throw new Error('ArrayData: A key is required to use this composable');
|
||||||
|
|
||||||
if (!arrayDataStore.get(key)) arrayDataStore.set(key);
|
if (!arrayDataStore.get(key)) arrayDataStore.set(key);
|
||||||
|
@ -53,6 +55,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
'searchUrl',
|
'searchUrl',
|
||||||
'navigate',
|
'navigate',
|
||||||
'mapKey',
|
'mapKey',
|
||||||
|
'keepData',
|
||||||
];
|
];
|
||||||
if (typeof userOptions === 'object') {
|
if (typeof userOptions === 'object') {
|
||||||
for (const option in userOptions) {
|
for (const option in userOptions) {
|
||||||
|
@ -75,26 +78,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
|
|
||||||
cancelRequest();
|
cancelRequest();
|
||||||
canceller = new AbortController();
|
canceller = new AbortController();
|
||||||
|
const { params, limit } = getCurrentFilter();
|
||||||
const filter = {
|
|
||||||
limit: store.limit,
|
|
||||||
};
|
|
||||||
let userParams = { ...store.userParams };
|
|
||||||
|
|
||||||
Object.assign(filter, store.userFilter);
|
|
||||||
|
|
||||||
let where;
|
|
||||||
if (filter?.where || store.filter?.where)
|
|
||||||
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
|
|
||||||
Object.assign(filter, store.filter);
|
|
||||||
filter.where = where;
|
|
||||||
const params = { filter };
|
|
||||||
|
|
||||||
Object.assign(params, userParams);
|
|
||||||
if (params.filter) params.filter.skip = store.skip;
|
|
||||||
if (store?.order && typeof store?.order == 'string') store.order = [store.order];
|
|
||||||
if (store.order?.length) params.filter.order = [...store.order];
|
|
||||||
else delete params.filter.order;
|
|
||||||
|
|
||||||
store.currentFilter = JSON.parse(JSON.stringify(params));
|
store.currentFilter = JSON.parse(JSON.stringify(params));
|
||||||
delete store.currentFilter.filter.include;
|
delete store.currentFilter.filter.include;
|
||||||
|
@ -120,15 +104,16 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { limit } = filter;
|
|
||||||
store.hasMoreData = limit && response.data.length >= limit;
|
store.hasMoreData = limit && response.data.length >= limit;
|
||||||
|
|
||||||
processData(response.data, { map: !!store.mapKey, append });
|
if (!append && !isDialogOpened() && updateRouter) {
|
||||||
if (!append && !isDialogOpened()) updateRouter && updateStateParams();
|
if (updateStateParams(response.data)?.redirect) return;
|
||||||
|
}
|
||||||
store.isLoading = false;
|
store.isLoading = false;
|
||||||
canceller = null;
|
canceller = null;
|
||||||
|
|
||||||
|
processData(response.data, { map: !!store.mapKey, append });
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,10 +173,9 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
|
|
||||||
async function addOrder(field, direction = 'ASC') {
|
async function addOrder(field, direction = 'ASC') {
|
||||||
const newOrder = field + ' ' + direction;
|
const newOrder = field + ' ' + direction;
|
||||||
let order = store.order || [];
|
const order = toArray(store.order);
|
||||||
if (typeof order == 'string') order = [order];
|
|
||||||
|
|
||||||
let index = order.findIndex((o) => o.split(' ')[0] === field);
|
let index = getOrderIndex(order, field);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
order[index] = newOrder;
|
order[index] = newOrder;
|
||||||
} else {
|
} else {
|
||||||
|
@ -208,16 +192,24 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteOrder(field) {
|
async function deleteOrder(field) {
|
||||||
let order = store.order ?? [];
|
const order = toArray(store.order);
|
||||||
if (typeof order == 'string') order = [order];
|
const index = getOrderIndex(order, field);
|
||||||
|
|
||||||
const index = order.findIndex((o) => o.split(' ')[0] === field);
|
|
||||||
if (index > -1) order.splice(index, 1);
|
if (index > -1) order.splice(index, 1);
|
||||||
|
|
||||||
store.order = order;
|
store.order = order;
|
||||||
fetch({});
|
fetch({});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getOrderIndex(order, field) {
|
||||||
|
return order.findIndex((o) => o.split(' ')[0] === field);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toArray(str = []) {
|
||||||
|
if (!str) return [];
|
||||||
|
if (Array.isArray(str)) return str;
|
||||||
|
if (typeof str === 'string') return str.split(',').map((item) => item.trim());
|
||||||
|
}
|
||||||
|
|
||||||
function sanitizerParams(params, exprBuilder) {
|
function sanitizerParams(params, exprBuilder) {
|
||||||
for (const param in params) {
|
for (const param in params) {
|
||||||
if (params[param] === '' || params[param] === null) {
|
if (params[param] === '' || params[param] === null) {
|
||||||
|
@ -258,7 +250,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
if (Object.values(store.userParams).length) await fetch({});
|
if (Object.values(store.userParams).length) await fetch({});
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateStateParams() {
|
function updateStateParams(data) {
|
||||||
if (!route?.path) return;
|
if (!route?.path) return;
|
||||||
const newUrl = { path: route.path, query: { ...(route.query ?? {}) } };
|
const newUrl = { path: route.path, query: { ...(route.query ?? {}) } };
|
||||||
if (store?.searchUrl)
|
if (store?.searchUrl)
|
||||||
|
@ -275,21 +267,45 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
const { path } = matches.at(-1);
|
const { path } = matches.at(-1);
|
||||||
|
|
||||||
const to =
|
const to =
|
||||||
store?.data?.length === 1
|
data?.length === 1
|
||||||
? path.replace(/\/(list|:id)|-list/, `/${store.data[0].id}`)
|
? path.replace(/\/(list|:id)|-list/, `/${data[0].id}`)
|
||||||
: path.replace(/:id.*/, '');
|
: path.replace(/:id.*/, '');
|
||||||
|
|
||||||
if (route.path != to) {
|
if (route.path != to) {
|
||||||
const pushUrl = { path: to };
|
const pushUrl = { path: to };
|
||||||
if (to.endsWith('/list') || to.endsWith('/'))
|
if (to.endsWith('/list') || to.endsWith('/'))
|
||||||
pushUrl.query = newUrl.query;
|
pushUrl.query = newUrl.query;
|
||||||
return router.push(pushUrl);
|
return router.push(pushUrl) && { redirect: true };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
router.replace(newUrl);
|
router.replace(newUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCurrentFilter() {
|
||||||
|
const filter = {
|
||||||
|
limit: store.limit,
|
||||||
|
};
|
||||||
|
|
||||||
|
let userParams = { ...store.userParams };
|
||||||
|
|
||||||
|
Object.assign(filter, store.userFilter);
|
||||||
|
|
||||||
|
let where;
|
||||||
|
if (filter?.where || store.filter?.where)
|
||||||
|
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
|
||||||
|
Object.assign(filter, store.filter);
|
||||||
|
filter.where = where;
|
||||||
|
const params = { filter };
|
||||||
|
|
||||||
|
Object.assign(params, userParams);
|
||||||
|
if (params.filter) params.filter.skip = store.skip;
|
||||||
|
if (store.order) params.filter.order = toArray(store.order);
|
||||||
|
else delete params.filter.order;
|
||||||
|
|
||||||
|
return { filter, params, limit: filter.limit };
|
||||||
|
}
|
||||||
|
|
||||||
function processData(data, { map = true, append = true }) {
|
function processData(data, { map = true, append = true }) {
|
||||||
if (!append) {
|
if (!append) {
|
||||||
store.data = [];
|
store.data = [];
|
||||||
|
@ -302,7 +318,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
for (const row of data) {
|
for (const row of data) {
|
||||||
const key = row[store.mapKey];
|
const key = row[store.mapKey];
|
||||||
const val = { ...row, key };
|
const val = { ...row, key };
|
||||||
if (store.map.has(key)) {
|
if (key && store.map.has(key)) {
|
||||||
const { position } = store.map.get(key);
|
const { position } = store.map.get(key);
|
||||||
val.position = position;
|
val.position = position;
|
||||||
store.map.set(key, val);
|
store.map.set(key, val);
|
||||||
|
@ -322,6 +338,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
fetch,
|
fetch,
|
||||||
applyFilter,
|
applyFilter,
|
||||||
addFilter,
|
addFilter,
|
||||||
|
getCurrentFilter,
|
||||||
addFilterWhere,
|
addFilterWhere,
|
||||||
addOrder,
|
addOrder,
|
||||||
deleteOrder,
|
deleteOrder,
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
export default async (id) => {
|
||||||
|
const { data } = await axios.get(`Accounts/${id}/exists`);
|
||||||
|
return data.exists;
|
||||||
|
};
|
|
@ -0,0 +1,24 @@
|
||||||
|
import { onMounted, ref } from 'vue';
|
||||||
|
|
||||||
|
export function useHasContent(selector) {
|
||||||
|
const container = ref({});
|
||||||
|
const hasContent = ref();
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
container.value = document.querySelector(selector);
|
||||||
|
if (!container.value) return;
|
||||||
|
|
||||||
|
const observer = new MutationObserver(() => {
|
||||||
|
if (document.querySelector(selector))
|
||||||
|
hasContent.value = !!container.value.childNodes.length;
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(container.value, {
|
||||||
|
subtree: true,
|
||||||
|
childList: true,
|
||||||
|
attributes: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return hasContent;
|
||||||
|
}
|
|
@ -3,19 +3,23 @@
|
||||||
@import '@quasar/quasar-ui-qcalendar/src/QCalendarMonth.sass';
|
@import '@quasar/quasar-ui-qcalendar/src/QCalendarMonth.sass';
|
||||||
|
|
||||||
body.body--light {
|
body.body--light {
|
||||||
--font-color: black;
|
|
||||||
--vn-header-color: #cecece;
|
--vn-header-color: #cecece;
|
||||||
--vn-page-color: #ffffff;
|
--vn-page-color: #ffffff;
|
||||||
--vn-section-color: #e0e0e0;
|
--vn-section-color: #e0e0e0;
|
||||||
--vn-section-hover-color: #b9b9b9;
|
--vn-section-hover-color: #b9b9b9;
|
||||||
--vn-text-color: var(--font-color);
|
--vn-text-color: black;
|
||||||
--vn-label-color: #5f5f5f;
|
--vn-label-color: #5f5f5f;
|
||||||
--vn-accent-color: #e7e3e3;
|
--vn-accent-color: #e7e3e3;
|
||||||
|
--vn-search-color: #d4d4d4;
|
||||||
|
--vn-search-color-hover: #cfcfcf;
|
||||||
|
--vn-empty-tag: #acacac;
|
||||||
|
--vn-black-text-color: black;
|
||||||
|
--vn-text-color-contrast: white;
|
||||||
|
|
||||||
background-color: var(--vn-page-color);
|
background-color: var(--vn-page-color);
|
||||||
|
|
||||||
.q-header .q-toolbar {
|
.q-header .q-toolbar {
|
||||||
color: var(--font-color);
|
color: var(--vn-text-color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
body.body--dark {
|
body.body--dark {
|
||||||
|
@ -26,6 +30,11 @@ body.body--dark {
|
||||||
--vn-text-color: white;
|
--vn-text-color: white;
|
||||||
--vn-label-color: #a8a8a8;
|
--vn-label-color: #a8a8a8;
|
||||||
--vn-accent-color: #424242;
|
--vn-accent-color: #424242;
|
||||||
|
--vn-search-color: #4b4b4b;
|
||||||
|
--vn-search-color-hover: #5b5b5b;
|
||||||
|
--vn-empty-tag: #2d2d2d;
|
||||||
|
--vn-black-text-color: black;
|
||||||
|
--vn-text-color-contrast: black;
|
||||||
|
|
||||||
background-color: var(--vn-page-color);
|
background-color: var(--vn-page-color);
|
||||||
}
|
}
|
||||||
|
@ -84,6 +93,10 @@ select:-webkit-autofill {
|
||||||
background-color: var(--vn-section-hover-color);
|
background-color: var(--vn-section-hover-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg-vn-page {
|
||||||
|
background-color: var(--vn-page-color);
|
||||||
|
}
|
||||||
|
|
||||||
.color-vn-label {
|
.color-vn-label {
|
||||||
color: var(--vn-label-color);
|
color: var(--vn-label-color);
|
||||||
}
|
}
|
||||||
|
@ -149,7 +162,8 @@ select:-webkit-autofill {
|
||||||
.q-card,
|
.q-card,
|
||||||
.q-table,
|
.q-table,
|
||||||
.q-table__bottom,
|
.q-table__bottom,
|
||||||
.q-drawer {
|
.q-drawer,
|
||||||
|
.bottomButton {
|
||||||
background-color: var(--vn-section-color);
|
background-color: var(--vn-section-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,7 +200,7 @@ select:-webkit-autofill {
|
||||||
|
|
||||||
.q-tooltip {
|
.q-tooltip {
|
||||||
background-color: var(--vn-page-color);
|
background-color: var(--vn-page-color);
|
||||||
color: var(--font-color);
|
color: var(--vn-text-color);
|
||||||
font-size: medium;
|
font-size: medium;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,7 +254,7 @@ input::-webkit-inner-spin-button {
|
||||||
.q-table {
|
.q-table {
|
||||||
th,
|
th,
|
||||||
td {
|
td {
|
||||||
padding: 1px 10px 1px 10px;
|
padding: 1px 3px 1px 3px;
|
||||||
max-width: 130px;
|
max-width: 130px;
|
||||||
div span {
|
div span {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -296,3 +310,28 @@ input::-webkit-inner-spin-button {
|
||||||
.no-visible {
|
.no-visible {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.q-item > .q-item__section:has(.q-checkbox) {
|
||||||
|
max-width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row > .column:has(.q-checkbox) {
|
||||||
|
max-width: fit-content;
|
||||||
|
}
|
||||||
|
.q-field__inner {
|
||||||
|
.q-field__control {
|
||||||
|
min-height: auto !important;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
.q-field__native.row {
|
||||||
|
min-height: auto !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-date__header-today {
|
||||||
|
border-radius: 12px;
|
||||||
|
border: 1px solid;
|
||||||
|
box-shadow: 0 4px 6px #00000000;
|
||||||
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import getUpdatedValues from './getUpdatedValues';
|
||||||
import getParamWhere from './getParamWhere';
|
import getParamWhere from './getParamWhere';
|
||||||
import parsePhone from './parsePhone';
|
import parsePhone from './parsePhone';
|
||||||
import isDialogOpened from './isDialogOpened';
|
import isDialogOpened from './isDialogOpened';
|
||||||
|
import toCelsius from './toCelsius';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getUpdatedValues,
|
getUpdatedValues,
|
||||||
|
@ -36,4 +37,5 @@ export {
|
||||||
dashIfEmpty,
|
dashIfEmpty,
|
||||||
dateRange,
|
dateRange,
|
||||||
getParamWhere,
|
getParamWhere,
|
||||||
|
toCelsius,
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
export default function toCelsius(value) {
|
||||||
|
return value ? `${value}°C` : '';
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
export default function toDateHourMin(date) {
|
export default function toDateHourMin(date) {
|
||||||
const dateHour = new Date(date).toLocaleDateString('es-ES', {
|
if (!date) return date;
|
||||||
|
return new Date(date).toLocaleDateString('es-ES', {
|
||||||
timeZone: 'Europe/Madrid',
|
timeZone: 'Europe/Madrid',
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: '2-digit',
|
month: '2-digit',
|
||||||
|
@ -7,5 +8,4 @@ export default function toDateHourMin(date) {
|
||||||
hour: '2-digit',
|
hour: '2-digit',
|
||||||
minute: '2-digit',
|
minute: '2-digit',
|
||||||
});
|
});
|
||||||
return dateHour;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
export default function toDateHourMinSec(date) {
|
export default function toDateHourMinSec(date) {
|
||||||
const dateHour = new Date(date).toLocaleDateString('es-ES', {
|
if (!date) return date;
|
||||||
|
return new Date(date).toLocaleDateString('es-ES', {
|
||||||
timeZone: 'Europe/Madrid',
|
timeZone: 'Europe/Madrid',
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: '2-digit',
|
month: '2-digit',
|
||||||
|
@ -8,5 +9,4 @@ export default function toDateHourMinSec(date) {
|
||||||
minute: '2-digit',
|
minute: '2-digit',
|
||||||
second: '2-digit',
|
second: '2-digit',
|
||||||
});
|
});
|
||||||
return dateHour;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ globals:
|
||||||
workCenters: Work centers
|
workCenters: Work centers
|
||||||
modes: Modes
|
modes: Modes
|
||||||
zones: Zones
|
zones: Zones
|
||||||
zonesList: Zones
|
zonesList: List
|
||||||
deliveryDays: Delivery days
|
deliveryDays: Delivery days
|
||||||
upcomingDeliveries: Upcoming deliveries
|
upcomingDeliveries: Upcoming deliveries
|
||||||
role: Role
|
role: Role
|
||||||
|
@ -346,6 +346,7 @@ globals:
|
||||||
countryFk: Country
|
countryFk: Country
|
||||||
companyFk: Company
|
companyFk: Company
|
||||||
changePass: Change password
|
changePass: Change password
|
||||||
|
setPass: Set password
|
||||||
deleteConfirmTitle: Delete selected elements
|
deleteConfirmTitle: Delete selected elements
|
||||||
changeState: Change state
|
changeState: Change state
|
||||||
raid: 'Raid {daysInForward} days'
|
raid: 'Raid {daysInForward} days'
|
||||||
|
@ -388,74 +389,19 @@ cau:
|
||||||
subtitle: By sending this ticket, all the data related to the error, the section, the user, etc., are already sent.
|
subtitle: By sending this ticket, all the data related to the error, the section, the user, etc., are already sent.
|
||||||
inputLabel: Explain why this error should not appear
|
inputLabel: Explain why this error should not appear
|
||||||
askPrivileges: Ask for privileges
|
askPrivileges: Ask for privileges
|
||||||
entry:
|
|
||||||
list:
|
|
||||||
newEntry: New entry
|
|
||||||
tableVisibleColumns:
|
|
||||||
created: Creation
|
|
||||||
supplierFk: Supplier
|
|
||||||
isBooked: Booked
|
|
||||||
isConfirmed: Confirmed
|
|
||||||
isOrdered: Ordered
|
|
||||||
companyFk: Company
|
|
||||||
travelFk: Travel
|
|
||||||
isExcludedFromAvailable: Inventory
|
|
||||||
invoiceAmount: Import
|
|
||||||
summary:
|
|
||||||
commission: Commission
|
|
||||||
currency: Currency
|
|
||||||
invoiceNumber: Invoice number
|
|
||||||
ordered: Ordered
|
|
||||||
booked: Booked
|
|
||||||
excludedFromAvailable: Inventory
|
|
||||||
travelReference: Reference
|
|
||||||
travelAgency: Agency
|
|
||||||
travelShipped: Shipped
|
|
||||||
travelDelivered: Delivered
|
|
||||||
travelLanded: Landed
|
|
||||||
travelReceived: Received
|
|
||||||
buys: Buys
|
|
||||||
stickers: Stickers
|
|
||||||
package: Package
|
|
||||||
packing: Pack.
|
|
||||||
grouping: Group.
|
|
||||||
buyingValue: Buying value
|
|
||||||
import: Import
|
|
||||||
pvp: PVP
|
|
||||||
basicData:
|
|
||||||
travel: Travel
|
|
||||||
currency: Currency
|
|
||||||
commission: Commission
|
|
||||||
observation: Observation
|
|
||||||
booked: Booked
|
|
||||||
excludedFromAvailable: Inventory
|
|
||||||
buys:
|
|
||||||
observations: Observations
|
|
||||||
packagingFk: Box
|
|
||||||
color: Color
|
|
||||||
printedStickers: Printed stickers
|
|
||||||
notes:
|
|
||||||
observationType: Observation type
|
|
||||||
latestBuys:
|
|
||||||
tableVisibleColumns:
|
|
||||||
image: Picture
|
|
||||||
itemFk: Item ID
|
|
||||||
weightByPiece: Weight/Piece
|
|
||||||
isActive: Active
|
|
||||||
family: Family
|
|
||||||
entryFk: Entry
|
|
||||||
freightValue: Freight value
|
|
||||||
comissionValue: Commission value
|
|
||||||
packageValue: Package value
|
|
||||||
isIgnored: Is ignored
|
|
||||||
price2: Grouping
|
|
||||||
price3: Packing
|
|
||||||
minPrice: Min
|
|
||||||
ektFk: Ekt
|
|
||||||
packingOut: Package out
|
|
||||||
landing: Landing
|
|
||||||
isExcludedFromAvailable: Es inventory
|
|
||||||
ticket:
|
ticket:
|
||||||
|
params:
|
||||||
|
ticketFk: Ticket ID
|
||||||
|
weekDay: Weekday
|
||||||
|
agencyModeFk: Agency
|
||||||
|
id: Worker
|
||||||
|
state: State
|
||||||
|
created: Created
|
||||||
|
externalId: External ID
|
||||||
|
counter: Counter
|
||||||
|
freightItemName: Freight item name
|
||||||
|
packageItemName: Package item name
|
||||||
|
longName: Long name
|
||||||
card:
|
card:
|
||||||
customerId: Customer ID
|
customerId: Customer ID
|
||||||
customerCard: Customer card
|
customerCard: Customer card
|
||||||
|
@ -506,6 +452,7 @@ invoiceOut:
|
||||||
card:
|
card:
|
||||||
issued: Issued
|
issued: Issued
|
||||||
customerCard: Customer card
|
customerCard: Customer card
|
||||||
|
ticketList: Ticket List
|
||||||
summary:
|
summary:
|
||||||
issued: Issued
|
issued: Issued
|
||||||
dued: Due
|
dued: Due
|
||||||
|
@ -558,27 +505,6 @@ parking:
|
||||||
searchBar:
|
searchBar:
|
||||||
info: You can search by parking code
|
info: You can search by parking code
|
||||||
label: Search parking...
|
label: Search parking...
|
||||||
order:
|
|
||||||
field:
|
|
||||||
salesPersonFk: Sales Person
|
|
||||||
form:
|
|
||||||
clientFk: Client
|
|
||||||
addressFk: Address
|
|
||||||
agencyModeFk: Agency
|
|
||||||
list:
|
|
||||||
newOrder: New Order
|
|
||||||
summary:
|
|
||||||
basket: Basket
|
|
||||||
notConfirmed: Not confirmed
|
|
||||||
created: Created
|
|
||||||
createdFrom: Created From
|
|
||||||
address: Address
|
|
||||||
total: Total
|
|
||||||
items: Items
|
|
||||||
orderTicketList: Order Ticket List
|
|
||||||
amount: Amount
|
|
||||||
confirm: Confirm
|
|
||||||
confirmLines: Confirm lines
|
|
||||||
department:
|
department:
|
||||||
chat: Chat
|
chat: Chat
|
||||||
bossDepartment: Boss Department
|
bossDepartment: Boss Department
|
||||||
|
@ -611,7 +537,7 @@ worker:
|
||||||
fi: DNI/NIE/NIF
|
fi: DNI/NIE/NIF
|
||||||
birth: Birth
|
birth: Birth
|
||||||
isFreelance: Freelance
|
isFreelance: Freelance
|
||||||
isSsDiscounted: Bonificación SS
|
isSsDiscounted: SS Bonification
|
||||||
hasMachineryAuthorized: Machinery authorized
|
hasMachineryAuthorized: Machinery authorized
|
||||||
isDisable: Disable
|
isDisable: Disable
|
||||||
notificationsManager:
|
notificationsManager:
|
||||||
|
@ -697,6 +623,11 @@ wagon:
|
||||||
minHeightBetweenTrays: 'The minimum height between trays is '
|
minHeightBetweenTrays: 'The minimum height between trays is '
|
||||||
maxWagonHeight: 'The maximum height of the wagon is '
|
maxWagonHeight: 'The maximum height of the wagon is '
|
||||||
uncompleteTrays: There are incomplete trays
|
uncompleteTrays: There are incomplete trays
|
||||||
|
params:
|
||||||
|
label: Label
|
||||||
|
plate: Plate
|
||||||
|
volume: Volume
|
||||||
|
name: Name
|
||||||
|
|
||||||
supplier:
|
supplier:
|
||||||
list:
|
list:
|
||||||
|
@ -773,6 +704,7 @@ travel:
|
||||||
totalEntries: Total entries
|
totalEntries: Total entries
|
||||||
totalEntriesTooltip: Total entries
|
totalEntriesTooltip: Total entries
|
||||||
daysOnward: Landed days onwards
|
daysOnward: Landed days onwards
|
||||||
|
awb: AWB
|
||||||
summary:
|
summary:
|
||||||
entryId: Entry Id
|
entryId: Entry Id
|
||||||
freight: Freight
|
freight: Freight
|
||||||
|
@ -857,13 +789,17 @@ components:
|
||||||
value: Value
|
value: Value
|
||||||
# ItemFixedPriceFilter
|
# ItemFixedPriceFilter
|
||||||
buyerFk: Buyer
|
buyerFk: Buyer
|
||||||
|
warehouseFk: Warehouse
|
||||||
started: From
|
started: From
|
||||||
ended: To
|
ended: To
|
||||||
mine: For me
|
mine: For me
|
||||||
hasMinPrice: Minimum price
|
hasMinPrice: Minimum price
|
||||||
# LatestBuysFilter
|
# LatestBuysFilter
|
||||||
salesPersonFk: Buyer
|
salesPersonFk: Buyer
|
||||||
|
supplierFk: Supplier
|
||||||
from: From
|
from: From
|
||||||
|
to: To
|
||||||
|
visible: Is visible
|
||||||
active: Is active
|
active: Is active
|
||||||
floramondo: Is floramondo
|
floramondo: Is floramondo
|
||||||
showBadDates: Show future items
|
showBadDates: Show future items
|
||||||
|
|
|
@ -144,7 +144,7 @@ globals:
|
||||||
workCenters: Centros de trabajo
|
workCenters: Centros de trabajo
|
||||||
modes: Modos
|
modes: Modos
|
||||||
zones: Zonas
|
zones: Zonas
|
||||||
zonesList: Zonas
|
zonesList: Listado
|
||||||
deliveryDays: Días de entrega
|
deliveryDays: Días de entrega
|
||||||
upcomingDeliveries: Próximos repartos
|
upcomingDeliveries: Próximos repartos
|
||||||
role: Role
|
role: Role
|
||||||
|
@ -348,6 +348,7 @@ globals:
|
||||||
countryFk: País
|
countryFk: País
|
||||||
companyFk: Empresa
|
companyFk: Empresa
|
||||||
changePass: Cambiar contraseña
|
changePass: Cambiar contraseña
|
||||||
|
setPass: Establecer contraseña
|
||||||
deleteConfirmTitle: Eliminar los elementos seleccionados
|
deleteConfirmTitle: Eliminar los elementos seleccionados
|
||||||
changeState: Cambiar estado
|
changeState: Cambiar estado
|
||||||
raid: 'Redada {daysInForward} días'
|
raid: 'Redada {daysInForward} días'
|
||||||
|
@ -388,75 +389,19 @@ cau:
|
||||||
subtitle: Al enviar este cau ya se envían todos los datos relacionados con el error, la sección, el usuario, etc
|
subtitle: Al enviar este cau ya se envían todos los datos relacionados con el error, la sección, el usuario, etc
|
||||||
inputLabel: Explique el motivo por el que no deberia aparecer este fallo
|
inputLabel: Explique el motivo por el que no deberia aparecer este fallo
|
||||||
askPrivileges: Solicitar permisos
|
askPrivileges: Solicitar permisos
|
||||||
entry:
|
|
||||||
list:
|
|
||||||
newEntry: Nueva entrada
|
|
||||||
tableVisibleColumns:
|
|
||||||
created: Creación
|
|
||||||
supplierFk: Proveedor
|
|
||||||
isBooked: Asentado
|
|
||||||
isConfirmed: Confirmado
|
|
||||||
isOrdered: Pedida
|
|
||||||
companyFk: Empresa
|
|
||||||
travelFk: Envio
|
|
||||||
isExcludedFromAvailable: Inventario
|
|
||||||
invoiceAmount: Importe
|
|
||||||
summary:
|
|
||||||
commission: Comisión
|
|
||||||
currency: Moneda
|
|
||||||
invoiceNumber: Núm. factura
|
|
||||||
ordered: Pedida
|
|
||||||
booked: Contabilizada
|
|
||||||
excludedFromAvailable: Inventario
|
|
||||||
travelReference: Referencia
|
|
||||||
travelAgency: Agencia
|
|
||||||
travelShipped: F. envio
|
|
||||||
travelWarehouseOut: Alm. salida
|
|
||||||
travelDelivered: Enviada
|
|
||||||
travelLanded: F. entrega
|
|
||||||
travelReceived: Recibida
|
|
||||||
buys: Compras
|
|
||||||
stickers: Etiquetas
|
|
||||||
package: Embalaje
|
|
||||||
packing: Pack.
|
|
||||||
grouping: Group.
|
|
||||||
buyingValue: Coste
|
|
||||||
import: Importe
|
|
||||||
pvp: PVP
|
|
||||||
basicData:
|
|
||||||
travel: Envío
|
|
||||||
currency: Moneda
|
|
||||||
observation: Observación
|
|
||||||
commission: Comisión
|
|
||||||
booked: Asentado
|
|
||||||
excludedFromAvailable: Inventario
|
|
||||||
buys:
|
|
||||||
observations: Observaciónes
|
|
||||||
packagingFk: Embalaje
|
|
||||||
color: Color
|
|
||||||
printedStickers: Etiquetas impresas
|
|
||||||
notes:
|
|
||||||
observationType: Tipo de observación
|
|
||||||
latestBuys:
|
|
||||||
tableVisibleColumns:
|
|
||||||
image: Foto
|
|
||||||
itemFk: Id Artículo
|
|
||||||
weightByPiece: Peso (gramos)/tallo
|
|
||||||
isActive: Activo
|
|
||||||
family: Familia
|
|
||||||
entryFk: Entrada
|
|
||||||
freightValue: Porte
|
|
||||||
comissionValue: Comisión
|
|
||||||
packageValue: Embalaje
|
|
||||||
isIgnored: Ignorado
|
|
||||||
price2: Grouping
|
|
||||||
price3: Packing
|
|
||||||
minPrice: Min
|
|
||||||
ektFk: Ekt
|
|
||||||
packingOut: Embalaje envíos
|
|
||||||
landing: Llegada
|
|
||||||
isExcludedFromAvailable: Es inventario
|
|
||||||
ticket:
|
ticket:
|
||||||
|
params:
|
||||||
|
ticketFk: ID de ticket
|
||||||
|
weekDay: Salida
|
||||||
|
agencyModeFk: Agencia
|
||||||
|
id: Comercial
|
||||||
|
created: Creado
|
||||||
|
state: Estado
|
||||||
|
externalId: ID externo
|
||||||
|
counter: Contador
|
||||||
|
freightItemName: Nombre
|
||||||
|
packageItemName: Embalaje
|
||||||
|
longName: Descripción
|
||||||
card:
|
card:
|
||||||
customerId: ID cliente
|
customerId: ID cliente
|
||||||
customerCard: Ficha del cliente
|
customerCard: Ficha del cliente
|
||||||
|
@ -544,30 +489,6 @@ invoiceOut:
|
||||||
comercial: Comercial
|
comercial: Comercial
|
||||||
errors:
|
errors:
|
||||||
downloadCsvFailed: Error al descargar CSV
|
downloadCsvFailed: Error al descargar CSV
|
||||||
order:
|
|
||||||
field:
|
|
||||||
salesPersonFk: Comercial
|
|
||||||
form:
|
|
||||||
clientFk: Cliente
|
|
||||||
addressFk: Dirección
|
|
||||||
agencyModeFk: Agencia
|
|
||||||
list:
|
|
||||||
newOrder: Nuevo Pedido
|
|
||||||
summary:
|
|
||||||
basket: Cesta
|
|
||||||
notConfirmed: No confirmada
|
|
||||||
created: Creado
|
|
||||||
createdFrom: Creado desde
|
|
||||||
address: Dirección
|
|
||||||
total: Total
|
|
||||||
vat: IVA
|
|
||||||
state: Estado
|
|
||||||
alias: Alias
|
|
||||||
items: Artículos
|
|
||||||
orderTicketList: Tickets del pedido
|
|
||||||
amount: Monto
|
|
||||||
confirm: Confirmar
|
|
||||||
confirmLines: Confirmar lineas
|
|
||||||
shelving:
|
shelving:
|
||||||
list:
|
list:
|
||||||
parking: Parking
|
parking: Parking
|
||||||
|
@ -608,6 +529,15 @@ worker:
|
||||||
role: Rol
|
role: Rol
|
||||||
sipExtension: Extensión
|
sipExtension: Extensión
|
||||||
locker: Taquilla
|
locker: Taquilla
|
||||||
|
fiDueDate: F. caducidad DNI
|
||||||
|
sex: Sexo
|
||||||
|
seniority: Antigüedad
|
||||||
|
fi: DNI/NIE/NIF
|
||||||
|
birth: F. nacimiento
|
||||||
|
isFreelance: Autónomo
|
||||||
|
isSsDiscounted: Bonificación SS
|
||||||
|
hasMachineryAuthorized: Autorizado para maquinaria
|
||||||
|
isDisable: Deshabilitado
|
||||||
notificationsManager:
|
notificationsManager:
|
||||||
activeNotifications: Notificaciones activas
|
activeNotifications: Notificaciones activas
|
||||||
availableNotifications: Notificaciones disponibles
|
availableNotifications: Notificaciones disponibles
|
||||||
|
@ -691,6 +621,11 @@ wagon:
|
||||||
minHeightBetweenTrays: 'La distancia mínima entre bandejas es '
|
minHeightBetweenTrays: 'La distancia mínima entre bandejas es '
|
||||||
maxWagonHeight: 'La altura máxima del vagón es '
|
maxWagonHeight: 'La altura máxima del vagón es '
|
||||||
uncompleteTrays: Hay bandejas sin completar
|
uncompleteTrays: Hay bandejas sin completar
|
||||||
|
params:
|
||||||
|
label: Etiqueta
|
||||||
|
plate: Matrícula
|
||||||
|
volume: Volumen
|
||||||
|
name: Nombre
|
||||||
supplier:
|
supplier:
|
||||||
list:
|
list:
|
||||||
payMethod: Método de pago
|
payMethod: Método de pago
|
||||||
|
@ -765,6 +700,7 @@ travel:
|
||||||
totalEntries: ∑
|
totalEntries: ∑
|
||||||
totalEntriesTooltip: Entradas totales
|
totalEntriesTooltip: Entradas totales
|
||||||
daysOnward: Días de llegada en adelante
|
daysOnward: Días de llegada en adelante
|
||||||
|
awb: AWB
|
||||||
summary:
|
summary:
|
||||||
entryId: Id entrada
|
entryId: Id entrada
|
||||||
freight: Porte
|
freight: Porte
|
||||||
|
@ -849,13 +785,19 @@ components:
|
||||||
value: Valor
|
value: Valor
|
||||||
# ItemFixedPriceFilter
|
# ItemFixedPriceFilter
|
||||||
buyerFk: Comprador
|
buyerFk: Comprador
|
||||||
|
warehouseFk: Almacen
|
||||||
started: Desde
|
started: Desde
|
||||||
ended: Hasta
|
ended: Hasta
|
||||||
mine: Para mi
|
mine: Para mi
|
||||||
hasMinPrice: Precio mínimo
|
hasMinPrice: Precio mínimo
|
||||||
|
wareHouseFk: Almacén
|
||||||
# LatestBuysFilter
|
# LatestBuysFilter
|
||||||
salesPersonFk: Comprador
|
salesPersonFk: Comprador
|
||||||
|
supplierFk: Proveedor
|
||||||
|
visible: Visible
|
||||||
active: Activo
|
active: Activo
|
||||||
|
from: Desde
|
||||||
|
to: Hasta
|
||||||
floramondo: Floramondo
|
floramondo: Floramondo
|
||||||
showBadDates: Ver items a futuro
|
showBadDates: Ver items a futuro
|
||||||
userPanel:
|
userPanel:
|
||||||
|
|
|
@ -6,6 +6,7 @@ import FormModelPopup from 'components/FormModelPopup.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -61,10 +62,10 @@ const redirectToAccountBasicData = (_, { id }) => {
|
||||||
hide-selected
|
hide-selected
|
||||||
:rules="validate('VnUser.roleFk')"
|
:rules="validate('VnUser.roleFk')"
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInputPassword
|
||||||
v-model="data.password"
|
v-model="data.password"
|
||||||
:label="t('ldap.password')"
|
:label="t('ldap.password')"
|
||||||
type="password"
|
:toggle-visibility="true"
|
||||||
:rules="validate('VnUser.password')"
|
:rules="validate('VnUser.password')"
|
||||||
/>
|
/>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
|
|
|
@ -8,6 +8,7 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
@ -128,10 +129,9 @@ onMounted(async () => await getInitialLdapConfig());
|
||||||
:required="true"
|
:required="true"
|
||||||
:rules="validate('LdapConfig.rdn')"
|
:rules="validate('LdapConfig.rdn')"
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInputPassword
|
||||||
:label="t('ldap.password')"
|
:label="t('ldap.password')"
|
||||||
clearable
|
clearable
|
||||||
type="password"
|
|
||||||
v-model="data.password"
|
v-model="data.password"
|
||||||
:required="true"
|
:required="true"
|
||||||
:rules="validate('LdapConfig.password')"
|
:rules="validate('LdapConfig.password')"
|
||||||
|
|
|
@ -4,9 +4,9 @@ import { computed, ref } from 'vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import AccountSummary from './Card/AccountSummary.vue';
|
import AccountSummary from './Card/AccountSummary.vue';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
|
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
@ -168,10 +168,9 @@ function exprBuilder(param, value) {
|
||||||
>
|
>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<QCardSection>
|
<QCardSection>
|
||||||
<VnInput
|
<VnInputPassword
|
||||||
:label="t('Password')"
|
:label="t('Password')"
|
||||||
v-model="data.password"
|
v-model="data.password"
|
||||||
type="password"
|
|
||||||
:required="true"
|
:required="true"
|
||||||
autocomplete="new-password"
|
autocomplete="new-password"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -8,6 +8,7 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
@ -143,10 +144,9 @@ onMounted(async () => await getInitialSambaConfig());
|
||||||
v-model="data.adUser"
|
v-model="data.adUser"
|
||||||
:rules="validate('SambaConfigs.adUser')"
|
:rules="validate('SambaConfigs.adUser')"
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInputPassword
|
||||||
:label="t('samba.passwordAD')"
|
:label="t('samba.passwordAD')"
|
||||||
clearable
|
clearable
|
||||||
type="password"
|
|
||||||
v-model="data.adPassword"
|
v-model="data.adPassword"
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed, onMounted } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
import useCardDescription from 'src/composables/useCardDescription';
|
||||||
import AccountDescriptorMenu from './AccountDescriptorMenu.vue';
|
import AccountDescriptorMenu from './AccountDescriptorMenu.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
|
||||||
import VnImg from 'src/components/ui/VnImg.vue';
|
import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
import useHasAccount from 'src/composables/useHasAccount.js';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -23,6 +23,7 @@ const entityId = computed(() => {
|
||||||
return $props.id || route.params.id;
|
return $props.id || route.params.id;
|
||||||
});
|
});
|
||||||
const data = ref(useCardDescription());
|
const data = ref(useCardDescription());
|
||||||
|
const hasAccount = ref();
|
||||||
const setData = (entity) => (data.value = useCardDescription(entity.nickname, entity.id));
|
const setData = (entity) => (data.value = useCardDescription(entity.nickname, entity.id));
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
|
@ -30,18 +31,16 @@ const filter = {
|
||||||
fields: ['id', 'nickname', 'name', 'role'],
|
fields: ['id', 'nickname', 'name', 'role'],
|
||||||
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
|
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
|
||||||
};
|
};
|
||||||
const hasAccount = ref(false);
|
|
||||||
|
onMounted(async () => {
|
||||||
|
hasAccount.value = await useHasAccount(entityId.value);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
:url="`Accounts/${entityId}/exists`"
|
|
||||||
auto-load
|
|
||||||
@on-fetch="(data) => (hasAccount = data.exists)"
|
|
||||||
/>
|
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
url="VnUsers/preview"
|
:url="`VnUsers/preview`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
module="Account"
|
module="Account"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
|
@ -50,10 +49,9 @@ const hasAccount = ref(false);
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
>
|
>
|
||||||
<template #menu>
|
<template #menu>
|
||||||
<AccountDescriptorMenu :has-account="hasAccount" />
|
<AccountDescriptorMenu :entity-id="entityId" />
|
||||||
</template>
|
</template>
|
||||||
<template #before>
|
<template #before>
|
||||||
<!-- falla id :id="entityId.value" collection="user" size="160x160" -->
|
|
||||||
<VnImg :id="entityId" collection="user" resolution="520x520" class="photo">
|
<VnImg :id="entityId" collection="user" resolution="520x520" class="photo">
|
||||||
<template #error>
|
<template #error>
|
||||||
<div
|
<div
|
||||||
|
@ -91,7 +89,7 @@ const hasAccount = ref(false);
|
||||||
<QIcon
|
<QIcon
|
||||||
color="primary"
|
color="primary"
|
||||||
name="contact_mail"
|
name="contact_mail"
|
||||||
v-if="entity.hasAccount"
|
v-if="hasAccount"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
size="sm"
|
size="sm"
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { computed, ref, toRefs } from 'vue';
|
import { computed, onMounted, ref, toRefs } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useAcl } from 'src/composables/useAcl';
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||||
|
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
|
||||||
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
|
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
hasAccount: {
|
hasAccount: {
|
||||||
|
@ -17,14 +20,20 @@ const $props = defineProps({
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { hasAccount } = toRefs($props);
|
const { hasAccount } = toRefs($props);
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
const state = useState();
|
||||||
|
const user = state.getUser();
|
||||||
const { notify } = useQuasar();
|
const { notify } = useQuasar();
|
||||||
const account = computed(() => useArrayData('AccountId').store.data[0]);
|
const account = computed(() => useArrayData('AccountId').store.data[0]);
|
||||||
account.value.hasAccount = hasAccount.value;
|
account.value.hasAccount = hasAccount.value;
|
||||||
const entityId = computed(() => +route.params.id);
|
const entityId = computed(() => +route.params.id);
|
||||||
|
const hasitManagementAccess = ref();
|
||||||
|
const hasSysadminAccess = ref();
|
||||||
|
|
||||||
async function updateStatusAccount(active) {
|
async function updateStatusAccount(active) {
|
||||||
if (active) {
|
if (active) {
|
||||||
|
@ -36,7 +45,7 @@ async function updateStatusAccount(active) {
|
||||||
account.value.hasAccount = active;
|
account.value.hasAccount = active;
|
||||||
const status = active ? 'enable' : 'disable';
|
const status = active ? 'enable' : 'disable';
|
||||||
notify({
|
notify({
|
||||||
message: t(`account.card.${status}Account.success`),
|
message: t(`account.card.actions.${status}Account.success`),
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -49,6 +58,17 @@ async function updateStatusUser(active) {
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function deleteAccount() {
|
||||||
|
const { data } = await axios.delete(`VnUsers/${entityId.value}`);
|
||||||
|
if (data) {
|
||||||
|
notify({
|
||||||
|
message: t('account.card.actions.delete.success'),
|
||||||
|
type: 'positive',
|
||||||
|
});
|
||||||
|
router.push({ name: 'AccountList' });
|
||||||
|
}
|
||||||
|
}
|
||||||
const showSyncDialog = ref(false);
|
const showSyncDialog = ref(false);
|
||||||
const syncPassword = ref(null);
|
const syncPassword = ref(null);
|
||||||
const shouldSyncPassword = ref(false);
|
const shouldSyncPassword = ref(false);
|
||||||
|
@ -63,11 +83,27 @@ async function sync() {
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
const askOldPass = ref(false);
|
||||||
|
const changePassRef = ref();
|
||||||
|
|
||||||
|
const onChangePass = (oldPass) => {
|
||||||
|
askOldPass.value = oldPass;
|
||||||
|
changePassRef.value.show();
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
hasitManagementAccess.value = useAcl().hasAny([
|
||||||
|
{ model: 'VnUser', props: 'higherPrivileges', accessType: 'WRITE' },
|
||||||
|
]);
|
||||||
|
hasSysadminAccess.value = useAcl().hasAny([
|
||||||
|
{ model: 'VnUser', props: 'adminUser', accessType: 'WRITE' },
|
||||||
|
]);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnChangePassword
|
<VnChangePassword
|
||||||
ref="changePassRef"
|
ref="changePassRef"
|
||||||
:ask-old-pass="true"
|
:ask-old-pass="askOldPass"
|
||||||
:submit-fn="
|
:submit-fn="
|
||||||
async (newPassword, oldPassword) => {
|
async (newPassword, oldPassword) => {
|
||||||
await axios.patch(`Accounts/change-password`, {
|
await axios.patch(`Accounts/change-password`, {
|
||||||
|
@ -97,7 +133,7 @@ async function sync() {
|
||||||
<QTooltip>{{ t('account.card.actions.sync.tooltip') }}</QTooltip>
|
<QTooltip>{{ t('account.card.actions.sync.tooltip') }}</QTooltip>
|
||||||
</QIcon></QCheckbox
|
</QIcon></QCheckbox
|
||||||
>
|
>
|
||||||
<QInput
|
<VnInputPassword
|
||||||
v-if="shouldSyncPassword"
|
v-if="shouldSyncPassword"
|
||||||
:label="t('login.password')"
|
:label="t('login.password')"
|
||||||
v-model="syncPassword"
|
v-model="syncPassword"
|
||||||
|
@ -109,18 +145,46 @@ async function sync() {
|
||||||
</template>
|
</template>
|
||||||
</VnConfirm>
|
</VnConfirm>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="
|
v-if="hasitManagementAccess"
|
||||||
entityId == account.id &&
|
|
||||||
useAcl().hasAny([{ model: 'Account', props: '*', accessType: 'WRITE' }])
|
|
||||||
"
|
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="$refs.changePassRef.show()"
|
@click="
|
||||||
|
openConfirmationModal(
|
||||||
|
t('account.card.actions.disableAccount.title'),
|
||||||
|
t('account.card.actions.disableAccount.subtitle'),
|
||||||
|
() => deleteAccount()
|
||||||
|
)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('globals.changePass') }}</QItemSection>
|
<QItemSection>{{ t('globals.delete') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="account.hasAccount"
|
v-if="hasSysadminAccess"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="user.id === account.id ? onChangePass(true) : onChangePass(false)"
|
||||||
|
>
|
||||||
|
<QItemSection v-if="user.id === account.id">
|
||||||
|
{{ t('globals.changePass') }}
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection v-else>{{ t('globals.setPass') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
v-if="!account.hasAccount && hasSysadminAccess"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="
|
||||||
|
openConfirmationModal(
|
||||||
|
t('account.card.actions.enableAccount.title'),
|
||||||
|
t('account.card.actions.enableAccount.subtitle'),
|
||||||
|
() => updateStatusAccount(true)
|
||||||
|
)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<QItemSection>{{ t('account.card.actions.enableAccount.name') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
v-if="account.hasAccount && hasSysadminAccess"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="
|
@click="
|
||||||
|
@ -135,7 +199,7 @@ async function sync() {
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
||||||
<QItem
|
<QItem
|
||||||
v-if="!account.active"
|
v-if="!account.active && hasitManagementAccess"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="
|
@click="
|
||||||
|
@ -149,7 +213,7 @@ async function sync() {
|
||||||
<QItemSection>{{ t('account.card.actions.activateUser.name') }}</QItemSection>
|
<QItemSection>{{ t('account.card.actions.activateUser.name') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="account.active"
|
v-if="account.active && hasitManagementAccess"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="
|
@click="
|
||||||
|
@ -162,7 +226,12 @@ async function sync() {
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('account.card.actions.deactivateUser.name') }}</QItemSection>
|
<QItemSection>{{ t('account.card.actions.deactivateUser.name') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem v-ripple clickable @click="showSyncDialog = true">
|
<QItem
|
||||||
|
v-if="useAcl().hasAny([{ model: 'VnRole', props: '*', accessType: 'WRITE' }])"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="showSyncDialog = true"
|
||||||
|
>
|
||||||
<QItemSection>{{ t('account.card.actions.sync.name') }}</QItemSection>
|
<QItemSection>{{ t('account.card.actions.sync.name') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
|
|
|
@ -9,6 +9,7 @@ import AccountMailAliasCreateForm from './AccountMailAliasCreateForm.vue';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import useHasAccount from 'src/composables/useHasAccount.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -50,16 +51,6 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const fetchAccountExistence = async () => {
|
|
||||||
try {
|
|
||||||
const { data } = await axios.get(`Accounts/${route.params.id}/exists`);
|
|
||||||
return data.exists;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error fetching account existence', error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const deleteMailAlias = async (row) => {
|
const deleteMailAlias = async (row) => {
|
||||||
await axios.delete(`${urlPath}/${row.id}`);
|
await axios.delete(`${urlPath}/${row.id}`);
|
||||||
fetchMailAliases();
|
fetchMailAliases();
|
||||||
|
@ -79,7 +70,7 @@ const fetchMailAliases = async () => {
|
||||||
|
|
||||||
const getAccountData = async (reload = true) => {
|
const getAccountData = async (reload = true) => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
hasAccount.value = await fetchAccountExistence();
|
hasAccount.value = await useHasAccount(route.params.id);
|
||||||
if (!hasAccount.value) {
|
if (!hasAccount.value) {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
store.data = [];
|
store.data = [];
|
||||||
|
|
|
@ -9,6 +9,7 @@ import VnRow from 'components/ui/VnRow.vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import useHasAccount from 'src/composables/useHasAccount';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -30,23 +31,9 @@ const hasDataChanged = computed(
|
||||||
initialData.value.hasData !== hasData.value
|
initialData.value.hasData !== hasData.value
|
||||||
);
|
);
|
||||||
|
|
||||||
const fetchAccountExistence = async () => {
|
|
||||||
try {
|
|
||||||
const { data } = await axios.get(`Accounts/${route.params.id}/exists`);
|
|
||||||
return data.exists;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error fetching account existence', error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchMailForwards = async () => {
|
const fetchMailForwards = async () => {
|
||||||
try {
|
const response = await axios.get(`MailForwards/${route.params.id}`);
|
||||||
const response = await axios.get(`MailForwards/${route.params.id}`);
|
return response.data;
|
||||||
return response.data;
|
|
||||||
} catch {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteMailForward = async () => {
|
const deleteMailForward = async () => {
|
||||||
|
@ -72,7 +59,7 @@ const setInitialData = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
initialData.value.account = route.params.id;
|
initialData.value.account = route.params.id;
|
||||||
formData.value.account = route.params.id;
|
formData.value.account = route.params.id;
|
||||||
hasAccount.value = await fetchAccountExistence(route.params.id);
|
hasAccount.value = await useHasAccount(route.params.id);
|
||||||
if (!hasAccount.value) {
|
if (!hasAccount.value) {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -7,6 +7,7 @@ import CardSummary from 'components/ui/CardSummary.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
|
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
import AccountDescriptorMenu from './AccountDescriptorMenu.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -31,12 +32,14 @@ const filter = {
|
||||||
<template>
|
<template>
|
||||||
<CardSummary
|
<CardSummary
|
||||||
data-key="AccountId"
|
data-key="AccountId"
|
||||||
ref="AccountSummary"
|
|
||||||
url="VnUsers/preview"
|
url="VnUsers/preview"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
@on-fetch="(data) => (account = data)"
|
@on-fetch="(data) => (account = data)"
|
||||||
>
|
>
|
||||||
<template #header>{{ account.id }} - {{ account.nickname }}</template>
|
<template #header>{{ account.id }} - {{ account.nickname }}</template>
|
||||||
|
<template #menu="">
|
||||||
|
<AccountDescriptorMenu :entity-id="entityId" />
|
||||||
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<QCardSection class="q-pa-none">
|
<QCardSection class="q-pa-none">
|
||||||
|
|
|
@ -50,7 +50,7 @@ const removeRole = async () => {
|
||||||
>
|
>
|
||||||
<template #menu>
|
<template #menu>
|
||||||
<QItem v-ripple clickable @click="removeRole()">
|
<QItem v-ripple clickable @click="removeRole()">
|
||||||
<QItemSection>{{ t('Delete') }}</QItemSection>
|
<QItemSection>{{ t('globals.delete') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
account:
|
account:
|
||||||
|
params:
|
||||||
|
id: Id
|
||||||
|
name: Name
|
||||||
|
roleFk: Role
|
||||||
|
nickname: Nickname
|
||||||
|
password: Password
|
||||||
|
active: Active
|
||||||
|
search: Id
|
||||||
|
description: Description
|
||||||
|
alias: Alias
|
||||||
|
model: Model
|
||||||
|
principalId: Role
|
||||||
|
property: Property
|
||||||
|
accessType: Access
|
||||||
card:
|
card:
|
||||||
nickname: User
|
nickname: User
|
||||||
role: Role
|
role: Role
|
||||||
|
|
|
@ -1,4 +1,20 @@
|
||||||
|
accessType: Acceso
|
||||||
|
property: Propiedad
|
||||||
account:
|
account:
|
||||||
|
params:
|
||||||
|
id: Id
|
||||||
|
name: Nombre
|
||||||
|
roleFk: Rol
|
||||||
|
nickname: Nickname
|
||||||
|
password: Contraseña
|
||||||
|
active: Activo
|
||||||
|
search: Id
|
||||||
|
description: Descripción
|
||||||
|
alias: Alias
|
||||||
|
model: Modelo
|
||||||
|
principalId: Rol
|
||||||
|
property: Propiedad
|
||||||
|
accessType: Acceso
|
||||||
card:
|
card:
|
||||||
nickname: Usuario
|
nickname: Usuario
|
||||||
role: Rol
|
role: Rol
|
||||||
|
|
|
@ -1,21 +1,13 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||||
import ClaimDescriptor from './ClaimDescriptor.vue';
|
import ClaimDescriptor from './ClaimDescriptor.vue';
|
||||||
import ClaimFilter from '../ClaimFilter.vue';
|
|
||||||
import filter from './ClaimFilter.js';
|
import filter from './ClaimFilter.js';
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCardBeta
|
||||||
data-key="Claim"
|
data-key="Claim"
|
||||||
base-url="Claims"
|
base-url="Claims"
|
||||||
:descriptor="ClaimDescriptor"
|
:descriptor="ClaimDescriptor"
|
||||||
:filter-panel="ClaimFilter"
|
|
||||||
search-data-key="ClaimList"
|
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
:searchbar-props="{
|
|
||||||
url: 'Claims/filter',
|
|
||||||
label: 'Search claim',
|
|
||||||
info: 'You can search by claim id or customer name',
|
|
||||||
}"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -164,19 +164,7 @@ const columns = computed(() => [
|
||||||
:autofocus="col.tabIndex == 1"
|
:autofocus="col.tabIndex == 1"
|
||||||
input-debounce="0"
|
input-debounce="0"
|
||||||
hide-selected
|
hide-selected
|
||||||
>
|
/>
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ scope.opt?.nickname }}
|
|
||||||
{{ scope.opt?.code }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelectWorker>
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-else
|
v-else
|
||||||
v-model="row[col.model]"
|
v-model="row[col.model]"
|
||||||
|
|
|
@ -57,6 +57,7 @@ function onFetch(rows, newRows) {
|
||||||
const price = row.quantity * sale.price;
|
const price = row.quantity * sale.price;
|
||||||
const discount = (sale.discount * price) / 100;
|
const discount = (sale.discount * price) / 100;
|
||||||
amountClaimed.value = amountClaimed.value + (price - discount);
|
amountClaimed.value = amountClaimed.value + (price - discount);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,9 +208,10 @@ async function saveWhenHasChanges() {
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
:grid="$q.screen.lt.md"
|
:grid="$q.screen.lt.md"
|
||||||
|
|
||||||
>
|
>
|
||||||
<template #body-cell-claimed="{ row }">
|
<template #body-cell-claimed="{ row }">
|
||||||
<QTd auto-width align="right" class="text-primary">
|
<QTd auto-width align="right" class="text-primary shrink">
|
||||||
<QInput
|
<QInput
|
||||||
v-model.number="row.quantity"
|
v-model.number="row.quantity"
|
||||||
type="number"
|
type="number"
|
||||||
|
@ -220,7 +222,7 @@ async function saveWhenHasChanges() {
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-description="{ row, value }">
|
<template #body-cell-description="{ row, value }">
|
||||||
<QTd auto-width align="right" class="text-primary">
|
<QTd auto-width align="right" class="link expand">
|
||||||
{{ value }}
|
{{ value }}
|
||||||
<ItemDescriptorProxy
|
<ItemDescriptorProxy
|
||||||
:id="row.sale.itemFk"
|
:id="row.sale.itemFk"
|
||||||
|
@ -228,7 +230,7 @@ async function saveWhenHasChanges() {
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-discount="{ row, value, rowIndex }">
|
<template #body-cell-discount="{ row, value, rowIndex }">
|
||||||
<QTd auto-width align="right" class="text-primary">
|
<QTd auto-width align="right" class="link shrink">
|
||||||
{{ value }}
|
{{ value }}
|
||||||
<VnDiscount
|
<VnDiscount
|
||||||
:quantity="row.quantity"
|
:quantity="row.quantity"
|
||||||
|
@ -264,7 +266,7 @@ async function saveWhenHasChanges() {
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection side>
|
<QItemSection side>
|
||||||
<template v-if="column.name === 'claimed'">
|
<template v-if="column.name === 'claimed'">
|
||||||
<QItemLabel class="text-primary">
|
<QItemLabel class="text-primary shrink">
|
||||||
<QInput
|
<QInput
|
||||||
v-model.number="
|
v-model.number="
|
||||||
props.row.quantity
|
props.row.quantity
|
||||||
|
@ -282,7 +284,7 @@ async function saveWhenHasChanges() {
|
||||||
<template
|
<template
|
||||||
v-else-if="column.name === 'discount'"
|
v-else-if="column.name === 'discount'"
|
||||||
>
|
>
|
||||||
<QItemLabel class="text-primary">
|
<QItemLabel class="text-primary shrink">
|
||||||
{{ column.value }}
|
{{ column.value }}
|
||||||
<VnDiscount
|
<VnDiscount
|
||||||
:quantity="props.row.quantity"
|
:quantity="props.row.quantity"
|
||||||
|
@ -330,6 +332,7 @@ async function saveWhenHasChanges() {
|
||||||
.grid-style-transition {
|
.grid-style-transition {
|
||||||
transition: transform 0.28s, background-color 0.28s;
|
transition: transform 0.28s, background-color 0.28s;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -19,6 +19,7 @@ import ClaimNotes from 'src/pages/Claim/Card/ClaimNotes.vue';
|
||||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
|
import ClaimDescriptorMenu from './ClaimDescriptorMenu.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -228,6 +229,9 @@ function claimUrl(section) {
|
||||||
</QList>
|
</QList>
|
||||||
</QBtnDropdown>
|
</QBtnDropdown>
|
||||||
</template>
|
</template>
|
||||||
|
<template #menu="{ entity }">
|
||||||
|
<ClaimDescriptorMenu :claim="entity.claim" />
|
||||||
|
</template>
|
||||||
<template #body="{ entity: { claim, salesClaimed, developments } }">
|
<template #body="{ entity: { claim, salesClaimed, developments } }">
|
||||||
<QCard class="vn-one" v-if="$route.name != 'ClaimSummary'">
|
<QCard class="vn-one" v-if="$route.name != 'ClaimSummary'">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
|
@ -345,12 +349,9 @@ function claimUrl(section) {
|
||||||
<span v-if="col.name != 'description'">{{
|
<span v-if="col.name != 'description'">{{
|
||||||
t(col.value)
|
t(col.value)
|
||||||
}}</span>
|
}}</span>
|
||||||
<QBtn
|
<span class="link" v-if="col.name === 'description'">{{
|
||||||
v-if="col.name == 'description'"
|
t(col.value)
|
||||||
flat
|
}}</span>
|
||||||
color="blue"
|
|
||||||
>{{ col.value }}</QBtn
|
|
||||||
>
|
|
||||||
<ItemDescriptorProxy
|
<ItemDescriptorProxy
|
||||||
v-if="col.name == 'description'"
|
v-if="col.name == 'description'"
|
||||||
:id="props.row.sale.itemFk"
|
:id="props.row.sale.itemFk"
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue