diff --git a/package.json b/package.json index 17f39cad7..d23ed0ced 100644 --- a/package.json +++ b/package.json @@ -1,74 +1,74 @@ { - "name": "salix-front", - "version": "25.06.0", - "description": "Salix frontend", - "productName": "Salix", - "author": "Verdnatura", - "private": true, - "packageManager": "pnpm@8.15.1", - "type": "module", - "scripts": { - "resetDatabase": "cd ../salix && gulp docker", - "lint": "eslint --ext .js,.vue ./", - "format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore", - "test:e2e": "cypress open", - "test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run", - "test": "echo \"See package.json => scripts for available tests.\" && exit 0", - "test:unit": "vitest", - "test:unit:ci": "vitest run", - "commitlint": "commitlint --edit", - "prepare": "npx husky install", - "addReferenceTag": "node .husky/addReferenceTag.js", - "docs:dev": "vitepress dev docs", - "docs:build": "vitepress build docs", - "docs:preview": "vitepress preview docs" - }, - "dependencies": { - "@quasar/cli": "^2.4.1", - "@quasar/extras": "^1.16.16", - "axios": "^1.4.0", - "chromium": "^3.0.3", - "croppie": "^2.6.5", - "moment": "^2.30.1", - "pinia": "^2.1.3", - "quasar": "^2.17.7", - "validator": "^13.9.0", - "vue": "^3.5.13", - "vue-i18n": "^9.3.0", - "vue-router": "^4.2.5" - }, - "devDependencies": { - "@commitlint/cli": "^19.2.1", - "@commitlint/config-conventional": "^19.1.0", - "@intlify/unplugin-vue-i18n": "^0.8.2", - "@pinia/testing": "^0.1.2", - "@quasar/app-vite": "^2.0.8", - "@quasar/quasar-app-extension-qcalendar": "^4.0.2", - "@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0", - "@vue/test-utils": "^2.4.4", - "autoprefixer": "^10.4.14", - "cypress": "^13.6.6", - "cypress-mochawesome-reporter": "^3.8.2", - "eslint": "^9.18.0", - "eslint-config-prettier": "^10.0.1", - "eslint-plugin-cypress": "^4.1.0", - "eslint-plugin-vue": "^9.32.0", - "husky": "^8.0.0", - "postcss": "^8.4.23", - "prettier": "^3.4.2", - "sass": "^1.83.4", - "vitepress": "^1.6.3", - "vitest": "^0.34.0" - }, - "engines": { - "node": "^20 || ^18 || ^16", - "npm": ">= 8.1.2", - "yarn": ">= 1.21.1", - "bun": ">= 1.0.25" - }, - "overrides": { - "@vitejs/plugin-vue": "^5.2.1", - "vite": "^6.0.11", - "vitest": "^0.31.1" - } + "name": "salix-front", + "version": "25.08.0", + "description": "Salix frontend", + "productName": "Salix", + "author": "Verdnatura", + "private": true, + "packageManager": "pnpm@8.15.1", + "type": "module", + "scripts": { + "resetDatabase": "cd ../salix && gulp docker", + "lint": "eslint --ext .js,.vue ./", + "format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore", + "test:e2e": "cypress open", + "test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run", + "test": "echo \"See package.json => scripts for available tests.\" && exit 0", + "test:unit": "vitest", + "test:unit:ci": "vitest run", + "commitlint": "commitlint --edit", + "prepare": "npx husky install", + "addReferenceTag": "node .husky/addReferenceTag.js", + "docs:dev": "vitepress dev docs", + "docs:build": "vitepress build docs", + "docs:preview": "vitepress preview docs" + }, + "dependencies": { + "@quasar/cli": "^2.4.1", + "@quasar/extras": "^1.16.16", + "axios": "^1.4.0", + "chromium": "^3.0.3", + "croppie": "^2.6.5", + "moment": "^2.30.1", + "pinia": "^2.1.3", + "quasar": "^2.17.7", + "validator": "^13.9.0", + "vue": "^3.5.13", + "vue-i18n": "^9.3.0", + "vue-router": "^4.2.5" + }, + "devDependencies": { + "@commitlint/cli": "^19.2.1", + "@commitlint/config-conventional": "^19.1.0", + "@intlify/unplugin-vue-i18n": "^0.8.2", + "@pinia/testing": "^0.1.2", + "@quasar/app-vite": "^2.0.8", + "@quasar/quasar-app-extension-qcalendar": "^4.0.2", + "@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0", + "@vue/test-utils": "^2.4.4", + "autoprefixer": "^10.4.14", + "cypress": "^13.6.6", + "cypress-mochawesome-reporter": "^3.8.2", + "eslint": "^9.18.0", + "eslint-config-prettier": "^10.0.1", + "eslint-plugin-cypress": "^4.1.0", + "eslint-plugin-vue": "^9.32.0", + "husky": "^8.0.0", + "postcss": "^8.4.23", + "prettier": "^3.4.2", + "sass": "^1.83.4", + "vitepress": "^1.6.3", + "vitest": "^0.34.0" + }, + "engines": { + "node": "^20 || ^18 || ^16", + "npm": ">= 8.1.2", + "yarn": ">= 1.21.1", + "bun": ">= 1.0.25" + }, + "overrides": { + "@vitejs/plugin-vue": "^5.2.1", + "vite": "^6.0.11", + "vitest": "^0.31.1" + } } \ No newline at end of file diff --git a/src/pages/Customer/Card/CustomerDescriptor.vue b/src/pages/Customer/Card/CustomerDescriptor.vue index 7a528a238..d1007647a 100644 --- a/src/pages/Customer/Card/CustomerDescriptor.vue +++ b/src/pages/Customer/Card/CustomerDescriptor.vue @@ -206,6 +206,7 @@ const debtWarning = computed(() => { query: { createForm: JSON.stringify({ clientFk: entity.id, + addressId: entity.defaultAddressFk, }), }, }" diff --git a/src/pages/Item/Card/ItemDiary.vue b/src/pages/Item/Card/ItemDiary.vue index c2f2c19a0..4b6775183 100644 --- a/src/pages/Item/Card/ItemDiary.vue +++ b/src/pages/Item/Card/ItemDiary.vue @@ -125,7 +125,7 @@ onMounted(async () => { inventoriedDate.value = (await axios.get('Configs/findOne')).data?.inventoried || today; - if (query.warehouseFk) ref.warehouseFk = query.warehouseFk; + if (query.warehouseFk) ref.warehouseFk = +query.warehouseFk; else if (!ref.warehouseFk && user.value) ref.warehouseFk = user.value.warehouseFk; if (ref.date) showWhatsBeforeInventory.value = true; ref.itemFk = route.params.id; @@ -143,7 +143,7 @@ onMounted(async () => { const fetchItemBalances = async () => await arrayDataItemBalances.fetch({}); const getBadgeAttrs = (_date) => { - const isSameDate = date.isSameDate(today.value, _date); + const isSameDate = date.isSameDate(today, _date); const attrs = { 'text-color': isSameDate ? 'black' : 'white', color: isSameDate ? 'warning' : 'transparent', @@ -153,8 +153,6 @@ const getBadgeAttrs = (_date) => { const scrollToToday = async () => { await nextTick(); - const today = Date.vnNew(); - today.setHours(0, 0, 0, 0); const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`); if (todayCell) { todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' }); diff --git a/src/pages/Order/OrderList.vue b/src/pages/Order/OrderList.vue index 6e4f0aac8..21cb5ed7e 100644 --- a/src/pages/Order/OrderList.vue +++ b/src/pages/Order/OrderList.vue @@ -81,7 +81,7 @@ const columns = computed(() => [ label: t('module.created'), component: 'date', cardVisible: true, - format: (row) => toDateTimeFormat(row?.landed), + format: (row) => toDateTimeFormat(row?.created), columnField: { component: null, }, diff --git a/src/router/modules/shelving.js b/src/router/modules/shelving.js index cd8a2bf15..55fb04278 100644 --- a/src/router/modules/shelving.js +++ b/src/router/modules/shelving.js @@ -44,6 +44,7 @@ const shelvingCard = { path: ':id', component: () => import('pages/Shelving/Card/ShelvingCard.vue'), redirect: { name: 'ShelvingSummary' }, + meta: { menu: ['ShelvingBasicData', 'ShelvingLog'] }, children: [ { name: 'ShelvingSummary', @@ -81,13 +82,10 @@ export default { title: 'shelving', icon: 'vn:inventory', moduleName: 'Shelving', + menu: ['ShelvingList', 'ParkingMain'], }, component: RouterView, redirect: { name: 'ShelvingMain' }, - menus: { - main: ['ShelvingList', 'ParkingMain'], - card: ['ShelvingBasicData', 'ShelvingLog'], - }, children: [ { path: '', diff --git a/test/cypress/integration/client/clientList.spec.js b/test/cypress/integration/client/clientList.spec.js index dcded63b0..f2e3671ba 100644 --- a/test/cypress/integration/client/clientList.spec.js +++ b/test/cypress/integration/client/clientList.spec.js @@ -62,10 +62,9 @@ describe('Client list', () => { it('Client founded create order', () => { const search = 'Jessica Jones'; cy.searchByLabel('Name', search); - cy.openActionDescriptor('New order'); + cy.clickButtonWith('icon', 'icon-basketadd'); cy.waitForElement('#formModel'); cy.waitForElement('.q-form'); cy.checkValueForm(1, search); - cy.checkValueForm(2, search); }); }); diff --git a/test/cypress/integration/client/clientSms.spec.js b/test/cypress/integration/client/clientSms.spec.js index 731522a5c..5c82fd9a3 100644 --- a/test/cypress/integration/client/clientSms.spec.js +++ b/test/cypress/integration/client/clientSms.spec.js @@ -7,6 +7,5 @@ describe('Client notes', () => { }); it('Should load layout', () => { cy.get('.q-page').should('be.visible'); - cy.get('.q-page > :nth-child(2) > :nth-child(1)').should('be.visible'); }); }); diff --git a/test/cypress/integration/item/itemTag.spec.js b/test/cypress/integration/item/itemTag.spec.js index 28e0a747f..10d68d08a 100644 --- a/test/cypress/integration/item/itemTag.spec.js +++ b/test/cypress/integration/item/itemTag.spec.js @@ -12,28 +12,22 @@ describe('Item tag', () => { cy.get('.q-page-sticky > div').click(); cy.dataCy('Tag_select').eq(7).type('Tallos'); cy.get('.q-menu .q-item').contains('Tallos').click(); - cy.get( - ':nth-child(8) > [label="Value"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Value_input"]' - ).type('1'); + cy.get(':nth-child(8) > [label="Value"]').type('1'); +cy.dataCy('crudModelDefaultSaveBtn').click(); cy.checkNotification("The tag or priority can't be repeated for an item"); }); - // https://redmine.verdnatura.es/issues/8422 - it.skip('should add a new tag', () => { + + it('should add a new tag', () => { cy.get('.q-page').should('be.visible'); cy.get('.q-page-sticky > div').click(); cy.get('.q-page-sticky > div').click(); cy.dataCy('Tag_select').eq(7).click(); - cy.get('.q-menu .q-item').contains('Ancho de la base').click(); - cy.get( - ':nth-child(8) > [label="Value"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Value_input"]' - ).type('50'); + cy.get('.q-menu .q-item').contains('Ancho de la base').type('{enter}'); + cy.get(':nth-child(8) > [label="Value"]').type('50'); cy.dataCy('crudModelDefaultSaveBtn').click(); cy.checkNotification('Data saved'); - cy.get( - '[data-cy="itemTags"] > :nth-child(7) > .justify-center > .q-icon' - ).click(); + cy.dataCy('itemTags').children(':nth-child(8)').find('.justify-center > .q-icon').click(); cy.dataCy('VnConfirm_confirm').click(); cy.checkNotification('Data saved'); }); -}); +}); \ No newline at end of file diff --git a/test/cypress/integration/parking/parkingBasicData.spec.js b/test/cypress/integration/parking/parkingBasicData.spec.js index b5633992c..0d130d335 100644 --- a/test/cypress/integration/parking/parkingBasicData.spec.js +++ b/test/cypress/integration/parking/parkingBasicData.spec.js @@ -5,7 +5,7 @@ describe('ParkingBasicData', () => { const sectorOpt = '.q-menu .q-item'; beforeEach(() => { cy.login('developer'); - cy.visit(`/#/parking/1/basic-data`); + cy.visit(`/#/shelving/parking/1/basic-data`); }); it('should edit the code and sector', () => { diff --git a/test/cypress/integration/parking/parkingList.spec.js b/test/cypress/integration/parking/parkingList.spec.js index f1efaa375..8b7152ca4 100644 --- a/test/cypress/integration/parking/parkingList.spec.js +++ b/test/cypress/integration/parking/parkingList.spec.js @@ -11,7 +11,7 @@ describe('ParkingList', () => { beforeEach(() => { cy.viewport(1920, 1080); cy.login('developer'); - cy.visit(`/#/parking/list`); + cy.visit(`/#/shelving/parking/list`); }); it('should redirect on clicking a parking', () => { diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 6a436c1eb..2c93fbf84 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -289,40 +289,13 @@ Cypress.Commands.add('openActionDescriptor', (opt) => { cy.openActionsDescriptor(); const listItem = '[role="menu"] .q-list .q-item'; cy.contains(listItem, opt).click(); - 1; }); Cypress.Commands.add('openActionsDescriptor', () => { cy.get('[data-cy="descriptor-more-opts"]').click(); }); -Cypress.Commands.add('clickButtonsDescriptor', (id) => { - cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`) - .invoke('removeAttr', 'target') - .click(); -}); - -Cypress.Commands.add('openActionDescriptor', (opt) => { - cy.openActionsDescriptor(); - const listItem = '[role="menu"] .q-list .q-item'; - cy.contains(listItem, opt).click(); - 1; -}); - -Cypress.Commands.add('clickButtonsDescriptor', (id) => { - cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`) - .invoke('removeAttr', 'target') - .click(); -}); - -Cypress.Commands.add('openActionDescriptor', (opt) => { - cy.openActionsDescriptor(); - const listItem = '[role="menu"] .q-list .q-item'; - cy.contains(listItem, opt).click(); - 1; -}); - -Cypress.Commands.add('clickButtonsDescriptor', (id) => { +Cypress.Commands.add('clickButtonDescriptor', (id) => { cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`) .invoke('removeAttr', 'target') .click(); @@ -374,3 +347,21 @@ Cypress.Commands.add('addBtnClick', () => { .and('be.visible') .click(); }); + +Cypress.Commands.add('clickButtonWith', (type, value) => { + switch (type) { + case 'icon': + cy.clickButtonWithIcon(value); + break; + + default: + cy.clickButtonWithText(value); + break; + } +}); +Cypress.Commands.add('clickButtonWithIcon', (iconClass) => { + cy.get(`.q-icon.${iconClass}`).parent().click(); +}); +Cypress.Commands.add('clickButtonWithText', (buttonText) => { + cy.get('.q-btn').contains(buttonText).click(); +});