diff --git a/package.json b/package.json index ead0193c9..eaaa0b812 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.40.0", + "version": "24.42.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", diff --git a/src/boot/quasar.js b/src/boot/quasar.js index e2035c880..5db6edd24 100644 --- a/src/boot/quasar.js +++ b/src/boot/quasar.js @@ -2,9 +2,15 @@ import { boot } from 'quasar/wrappers'; import qFormMixin from './qformMixin'; import mainShortcutMixin from './mainShortcutMixin'; import keyShortcut from './keyShortcut'; +import useNotify from 'src/composables/useNotify.js'; +const { notify } = useNotify(); export default boot(({ app }) => { app.mixin(qFormMixin); app.mixin(mainShortcutMixin); app.directive('shortcut', keyShortcut); + app.config.errorHandler = function (err) { + console.error(err); + notify('globals.error', 'negative', 'error'); + }; }); diff --git a/src/components/ItemsFilterPanel.vue b/src/components/ItemsFilterPanel.vue index 8449f9354..e89d32da4 100644 --- a/src/components/ItemsFilterPanel.vue +++ b/src/components/ItemsFilterPanel.vue @@ -297,11 +297,12 @@ const removeTag = (index, params, search) => { /> - diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index ca7043b75..a6c20a75f 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -69,10 +69,7 @@ const $props = defineProps({ type: Boolean, default: false, }, - disableInfiniteScroll: { - type: Boolean, - default: false, - }, + hasSubToolbar: { type: Boolean, default: null, @@ -150,7 +147,7 @@ onMounted(() => { quasar.platform.is.mobile && !$props.disableOption?.card ? CARD_MODE : $props.defaultMode; - stateStore.rightDrawer = true; + stateStore.rightDrawer = quasar.screen.gt.xs; columnsVisibilitySkipped.value = [ ...splittedColumns.value.columns .filter((c) => c.visible == false) @@ -305,6 +302,7 @@ defineExpose({ redirect: redirectFn, selected, CrudModelRef, + params, }); function handleOnDataSaved(_) { @@ -372,7 +370,7 @@ function handleOnDataSaved(_) { ref="CrudModelRef" @on-fetch="(...args) => emit('onFetch', ...args)" :search-url="searchUrl" - :disable-infinite-scroll="$attrs['disableInfiniteScroll']" + :disable-infinite-scroll="isTableMode" @save-changes="reload" :has-sub-toolbar="$props.hasSubToolbar ?? isEditable" :auto-load="hasParams || $attrs['auto-load']" @@ -392,7 +390,7 @@ function handleOnDataSaved(_) { card-container-class="grid-three" flat :style="isTableMode && `max-height: ${tableHeight}`" - virtual-scroll + :virtual-scroll="!isTableMode" @virtual-scroll=" (event) => event.index > rows.length - 2 && @@ -428,7 +426,7 @@ function handleOnDataSaved(_) { @@ -515,8 +513,12 @@ function handleOnDataSaved(_) { :key="index" :title="btn.title" :icon="btn.icon" - class="q-px-sm text-primary-light" + class="q-pa-xs" flat + dense + :class=" + btn.isPrimary ? 'text-primary-light' : 'color-vn-text ' + " :style="`visibility: ${ (btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden' }`" @@ -647,18 +649,10 @@ function handleOnDataSaved(_) { :key="col?.id" class="text-center" > -
- {{ - rows.reduce( - (sum, currentRow) => sum + currentRow[col.name], - 0 - ) - }} -
+ @@ -775,10 +769,16 @@ es: } } -.q-table th { - padding: 0; -} +.q-table { + th { + padding: 0; + } + &__top { + padding: 12px 0px; + top: 0; + } +} .vnTable { thead tr th { position: sticky; diff --git a/src/components/VnTable/VnVisibleColumn.vue b/src/components/VnTable/VnVisibleColumn.vue index 36f5ed7de..f5c3458cd 100644 --- a/src/components/VnTable/VnVisibleColumn.vue +++ b/src/components/VnTable/VnVisibleColumn.vue @@ -135,7 +135,7 @@ onMounted(async () => { }); - + diff --git a/src/pages/Ticket/locale/en.yml b/src/pages/Ticket/locale/en.yml index 5db64da6f..3fcaba0bd 100644 --- a/src/pages/Ticket/locale/en.yml +++ b/src/pages/Ticket/locale/en.yml @@ -40,6 +40,7 @@ ticketSale: address: Address transferLines: Transfer lines advanceTickets: + preparation: Preparation origin: Origin destination: Destination originAgency: 'Origin agency: {agency}' diff --git a/src/pages/Ticket/locale/es.yml b/src/pages/Ticket/locale/es.yml index 4b246df3a..106b6c487 100644 --- a/src/pages/Ticket/locale/es.yml +++ b/src/pages/Ticket/locale/es.yml @@ -86,6 +86,7 @@ weeklyTickets: search: Buscar por tickets programados searchInfo: Buscar tickets programados por el identificador o el identificador del cliente advanceTickets: + preparation: Preparación origin: Origen destination: Destinatario originAgency: 'Agencia origen: {agency}' diff --git a/src/pages/Travel/Card/TravelThermographsForm.vue b/src/pages/Travel/Card/TravelThermographsForm.vue index 7f40873b1..4f16b0a49 100644 --- a/src/pages/Travel/Card/TravelThermographsForm.vue +++ b/src/pages/Travel/Card/TravelThermographsForm.vue @@ -28,18 +28,8 @@ const route = useRoute(); const router = useRouter(); const state = useState(); const { notify } = useNotify(); - -const thermographFilter = { - fields: ['thermographFk'], - where: { - travelFk: null, - }, - order: 'thermographFk ASC', -}; -const fetchTravelThermographsRef = ref(null); const allowedContentTypes = ref(''); const user = state.getUser(); -const thermographsOptions = ref([]); const dmsTypesOptions = ref([]); const companiesOptions = ref([]); const warehousesOptions = ref([]); @@ -168,24 +158,15 @@ const updateThermograph = async () => { }; const onThermographCreated = async (data) => { - await fetchTravelThermographsRef.value.fetch(); - thermographForm.thermographId = data.thermographId; + thermographForm.thermographId = data.id; }; - - es: Select files: Selecciona ficheros diff --git a/src/pages/Travel/ExtraCommunityFilter.vue b/src/pages/Travel/ExtraCommunityFilter.vue index a8bbde75b..75b744168 100644 --- a/src/pages/Travel/ExtraCommunityFilter.vue +++ b/src/pages/Travel/ExtraCommunityFilter.vue @@ -112,6 +112,7 @@ warehouses(); + diff --git a/src/pages/Wagon/Type/WagonTypeList.vue b/src/pages/Wagon/Type/WagonTypeList.vue index 2f0d55fbe..c0943c58e 100644 --- a/src/pages/Wagon/Type/WagonTypeList.vue +++ b/src/pages/Wagon/Type/WagonTypeList.vue @@ -103,7 +103,7 @@ async function remove(row) { url-create="WagonTypes" model="WagonType" :form-initial-data="initialData" - @on-data-saved="window.location.reload()" + @on-data-saved="tableRef.reload()" auto-load > diff --git a/test/cypress/integration/claim/claimDevelopment.spec.js b/test/cypress/integration/claim/claimDevelopment.spec.js index 3b73a24d9..81fc33ecd 100755 --- a/test/cypress/integration/claim/claimDevelopment.spec.js +++ b/test/cypress/integration/claim/claimDevelopment.spec.js @@ -37,7 +37,7 @@ describe('ClaimDevelopment', () => { cy.wait(['@workers', '@workers']); cy.addCard(); - cy.get(thirdRow).should('exist'); + cy.waitForElement(thirdRow); const rowData = [ false, diff --git a/test/cypress/integration/entry/stockBought.spec.js b/test/cypress/integration/entry/stockBought.spec.js index b93afa520..66e06b79e 100644 --- a/test/cypress/integration/entry/stockBought.spec.js +++ b/test/cypress/integration/entry/stockBought.spec.js @@ -6,7 +6,6 @@ describe('EntryStockBought', () => { }); it('Should edit the reserved space', () => { cy.get('.q-field__native.q-placeholder').should('have.value', '01/01/2001'); - cy.get('tBody > tr').its('length').should('eq', 2); cy.get('input[name="reserve"]').type('10{enter}'); cy.get('button[title="Save"]').click(); cy.get('.q-notification__message').should('have.text', 'Data saved'); @@ -18,7 +17,6 @@ describe('EntryStockBought', () => { cy.get('input[aria-label="Date"]').eq(1).type('01-01'); cy.get('input[aria-label="Buyer"]').type('buyerboss{downarrow}{enter}'); cy.get('.q-notification__message').should('have.text', 'Data created'); - cy.get('tBody > tr').its('length').should('eq', 3); }); it('Should check detail for the buyer', () => { cy.get(':nth-child(1) > .sticky > .q-btn > .q-btn__content > .q-icon').click(); diff --git a/test/cypress/integration/vnComponent/vnLocation.spec.js b/test/cypress/integration/vnComponent/vnLocation.spec.js index 3533a3c1f..1872d3591 100644 --- a/test/cypress/integration/vnComponent/vnLocation.spec.js +++ b/test/cypress/integration/vnComponent/vnLocation.spec.js @@ -34,22 +34,25 @@ describe('VnLocation', () => { cy.visit('/#/supplier/567/fiscal-data', { timeout: 7000 }); cy.waitForElement('.q-form'); }); - it('Fin by postalCode', () => { + it('Find by postalCode', () => { const postCode = '46600'; + const postCodeLabel = '46600, Valencia(Province one), España'; const firstOption = '[role="listbox"] .q-item:nth-child(1)'; cy.get(inputLocation).click(); cy.get(inputLocation).clear(); cy.get(inputLocation).type(postCode); - cy.get(locationOptions).should('have.length.at.least', 2); + cy.get(locationOptions) + .get(':nth-child(1)') + .should('have.length.at.least', 2); + cy.get( + firstOption.concat(' > .q-item__section > .q-item__label--caption') + ).should('have.text', postCodeLabel); cy.get(firstOption).click(); cy.get('.q-btn-group > .q-btn--standard > .q-btn__content > .q-icon').click(); cy.reload(); cy.waitForElement('.q-form'); - cy.get(inputLocation).should( - 'have.value', - '46600 - Valencia(Province one), España' - ); + cy.get(inputLocation).should('have.value', postCodeLabel); }); it('Create postCode', () => { diff --git a/test/cypress/integration/wagon/wagonCreate.spec.js b/test/cypress/integration/wagon/wagonCreate.spec.js index 9aff3a819..cd248d1bb 100644 --- a/test/cypress/integration/wagon/wagonCreate.spec.js +++ b/test/cypress/integration/wagon/wagonCreate.spec.js @@ -11,7 +11,9 @@ describe('WagonCreate', () => { cy.get('input').eq(1).type('1234ABCD'); cy.get('input').eq(2).type('100'); cy.get('input').eq(3).click(); - cy.get('div[role="listbox"]').find('div.q-item').click(); + cy.get('.q-select > .q-field__inner > .q-field__control').type( + '{downarrow}{enter}' + ); // Save cy.get('button[type="submit"]').click(); @@ -19,12 +21,22 @@ describe('WagonCreate', () => { // Check data has been saved successfully cy.waitForElement('.q-card'); - cy.get('.title').should('have.text', '1234'); - cy.get('[title-label="Plate"] > .value > span').should('have.text', '1234ABCD'); - cy.get(':nth-child(2) > .value > span').should('have.text', '100'); - cy.get(':nth-child(3) > .value > span').should('have.text', 'Wagon Type #1'); + cy.get( + '[to="/null/1"] > .q-card > .no-padding > .q-py-none > .cursor-text' + ).should('have.text', '1234'); + cy.get( + '[to="/null/1"] > .q-card > .no-padding > .q-pr-lg > :nth-child(1) > .vn-label-value > .value > :nth-child(1) > .row > span' + ).should('have.text', '1234ABCD'); + cy.get( + '[to="/null/1"] > .q-card > .no-padding > .q-pr-lg > :nth-child(2) > .vn-label-value > .value > :nth-child(1) > .row > span' + ).should('have.text', '100'); + cy.get( + '[to="/null/1"] > .q-card > .no-padding > .q-pr-lg > :nth-child(3) > .vn-label-value > .value > :nth-child(1) > .row > span' + ).should('have.text', 'Wagon Type #1'); // Delete wagon type created - cy.get('.actions > .q-btn--standard').click(); + cy.get( + '[to="/null/2"] > .q-card > .column > [title="Remove"] > .q-btn__content > .q-icon' + ).click(); }); }); diff --git a/test/cypress/integration/wagonType/wagonTypeCreate.spec.js b/test/cypress/integration/wagonType/wagonTypeCreate.spec.js index cd7ffa58f..0ad98e597 100644 --- a/test/cypress/integration/wagonType/wagonTypeCreate.spec.js +++ b/test/cypress/integration/wagonType/wagonTypeCreate.spec.js @@ -13,7 +13,7 @@ describe('WagonTypeCreate', () => { }); it('delete a wagon type', () => { cy.get( - ':nth-child(2) > :nth-child(1) > .card-list-body > .actions > .q-btn--standard' + '[to="/null/2"] > .q-card > .column > [title="Remove"] > .q-btn__content > .q-icon' ).click(); }); }); diff --git a/test/cypress/integration/wagonType/wagonTypeEdit.spec.js b/test/cypress/integration/wagonType/wagonTypeEdit.spec.js index 6e5816e51..36dd83411 100644 --- a/test/cypress/integration/wagonType/wagonTypeEdit.spec.js +++ b/test/cypress/integration/wagonType/wagonTypeEdit.spec.js @@ -4,7 +4,7 @@ describe('WagonTypeEdit', () => { beforeEach(() => { cy.viewport(1920, 1080); cy.login('developer'); - cy.visit('/#/wagon/type/2/edit'); + cy.visit('/#/wagon/type/1/edit'); }); it('should edit the name and the divisible field of the wagon type', () => { @@ -14,14 +14,14 @@ describe('WagonTypeEdit', () => { cy.get('.q-btn--standard').click(); }); - it('should create a tray', () => { - cy.get('.action-button > .q-btn > .q-btn__content > .q-icon').click(); - cy.get('input').last().type('150'); - cy.get(trayColorRow).type('{downArrow}{downArrow}{enter}'); - }); - it('should delete a tray', () => { cy.get('.action-button > .q-btn > .q-btn__content > .q-icon').first().click(); cy.reload(); }); + + it('should create a tray', () => { + cy.get('.action-button > .q-btn > .q-btn__content > .q-icon').last().click(); + cy.get('input').last().type('150'); + cy.get(trayColorRow).type('{downArrow}{downArrow}{downArrow}{enter}'); + }); }); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index a9a405313..43788f59f 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -140,6 +140,7 @@ Cypress.Commands.add('removeCard', () => { }); Cypress.Commands.add('addCard', () => { cy.waitForElement('tbody'); + cy.waitForElement('.q-page-sticky > div > .q-btn'); cy.get('.q-page-sticky > div > .q-btn').click(); }); Cypress.Commands.add('clickConfirm', () => {