diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 6eda03891..32a8db16f 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -152,6 +152,10 @@ const value = computed({ }, }); +const computedSortBy = computed(() => { + return $props.sortBy || $props.optionLabel + ' ASC'; +}); + watch(options, (newValue) => { setOptions(newValue); }); @@ -186,7 +190,7 @@ function findKeyInOptions() { } function setOptions(data) { - data = dataByOrder(data, $props.sortBy); + data = dataByOrder(data, computedSortBy.value); myOptions.value = JSON.parse(JSON.stringify(data)); myOptionsOriginal.value = JSON.parse(JSON.stringify(data)); emit('update:options', data); @@ -216,7 +220,8 @@ function filter(val, options) { async function fetchFilter(val) { if (!$props.url) return; - const { fields, include, sortBy, limit } = $props; + const { fields, include, limit } = $props; + const sortBy = computedSortBy.value; const key = optionFilterValue.value ?? (new RegExp(/\d/g).test(val) diff --git a/src/components/ui/CardSummary.vue b/src/components/ui/CardSummary.vue index 05bfed998..2ec6bea78 100644 --- a/src/components/ui/CardSummary.vue +++ b/src/components/ui/CardSummary.vue @@ -201,6 +201,29 @@ async function fetch() { } } } + +.vn-card-group { + display: flex; + flex-direction: column; +} + +.vn-card-content { + display: flex; + flex-direction: column; + text-overflow: ellipsis; + > div { + max-height: 70px; + } +} + +@media (min-width: 1010px) { + .vn-card-group { + flex-direction: row; + } + .vn-card-content { + flex: 1; + } +} diff --git a/test/cypress/integration/invoiceIn/invoiceInList.spec.js b/test/cypress/integration/invoiceIn/invoiceInList.spec.js index 44a61609e..6b5d28c70 100644 --- a/test/cypress/integration/invoiceIn/invoiceInList.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInList.spec.js @@ -4,7 +4,7 @@ describe('InvoiceInList', () => { const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(1)'; const firstId = `${firstRow} > td:nth-child(2) span`; const firstDetailBtn = `${firstRow} .q-btn:nth-child(1)`; - const summaryHeaders = '.summaryBody .header-link'; + const summaryHeaders = (opt) => `.summaryBody > .${opt} > .q-pb-lg > .header-link`; const mockInvoiceRef = `createMockInvoice${Math.floor(Math.random() * 100)}`; const mock = { vnSupplierSelect: { val: 'farmer king', type: 'select' }, @@ -32,8 +32,8 @@ describe('InvoiceInList', () => { it('should open the details', () => { cy.get(firstDetailBtn).click(); - cy.get(summaryHeaders).eq(1).contains('Basic data'); - cy.get(summaryHeaders).eq(4).contains('Vat'); + cy.get(summaryHeaders('max-width')).contains('Basic data'); + cy.get(summaryHeaders('vat')).contains('Vat'); }); it('should create a new Invoice', () => { diff --git a/test/cypress/integration/ticket/ticketDescriptor.spec.js b/test/cypress/integration/ticket/ticketDescriptor.spec.js index 0ba2723a2..b5c95c463 100644 --- a/test/cypress/integration/ticket/ticketDescriptor.spec.js +++ b/test/cypress/integration/ticket/ticketDescriptor.spec.js @@ -3,10 +3,10 @@ describe('Ticket descriptor', () => { const listItem = '[role="menu"] .q-list .q-item'; const toCloneOpt = 'To clone ticket'; const setWeightOpt = 'Set weight'; - const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span'; + const warehouseValue = ':nth-child(1) > [data-cy="vnLvWarehouse"]'; const summaryHeader = '.summaryHeader > div'; const weight = 25; - const weightValue = '.summaryBody.row :nth-child(1) > :nth-child(9) > .value > span'; + const weightValue = '[data-cy="vnLvWeight"]'; beforeEach(() => { cy.login('developer'); cy.viewport(1920, 1080); diff --git a/test/cypress/integration/vnComponent/UserPanel.spec.js b/test/cypress/integration/vnComponent/UserPanel.spec.js index 25724e873..8722fe37e 100644 --- a/test/cypress/integration/vnComponent/UserPanel.spec.js +++ b/test/cypress/integration/vnComponent/UserPanel.spec.js @@ -39,11 +39,11 @@ describe('UserPanel', () => { cy.get(userCompany).should('have.value', 'Warehouse One').click(); //Actualizo la opción - cy.getOption(2); + cy.getOption(3); //Compruebo la notificación cy.get('.q-notification').should('be.visible'); - cy.get(userCompany).should('have.value', 'Warehouse Two'); + cy.get(userCompany).should('have.value', 'TestingWarehouse'); //Restauro el valor cy.get(userCompany).click(); diff --git a/test/cypress/integration/vnComponent/VnLog.spec.js b/test/cypress/integration/vnComponent/VnLog.spec.js index ae0013150..8ca32b681 100644 --- a/test/cypress/integration/vnComponent/VnLog.spec.js +++ b/test/cypress/integration/vnComponent/VnLog.spec.js @@ -20,7 +20,7 @@ describe('VnLog', () => { it('should filter by entity', () => { cy.selectOption('.q-drawer--right .q-item > .q-select', 'Claim'); cy.get('.q-page').click(); - cy.validateContent(chips[0], 'Claim'); + cy.validateContent(chips[0], 'Beginning'); }); it('should show claimDescriptor', () => { diff --git a/test/cypress/integration/worker/workerSummary.spec.js b/test/cypress/integration/worker/workerSummary.spec.js index c50b2c943..6071c4cdf 100644 --- a/test/cypress/integration/worker/workerSummary.spec.js +++ b/test/cypress/integration/worker/workerSummary.spec.js @@ -1,27 +1,25 @@ describe('WorkerSummary', () => { - const departmentDescriptor = ':nth-child(1) > :nth-child(3) > .value > .link'; - const roleDescriptor = ':nth-child(3) > :nth-child(4) > .value > .link'; + const department = ':nth-child(1) > [data-cy="vnLvDepartment"] > .value'; + const role = '[data-cy="vnLvRole"] > .value'; beforeEach(() => { cy.viewport(1280, 720); cy.login('developer'); cy.visit('/#/worker/19/summary'); }); - it('should load worker summary', () => { + it('should load worker summary and show the department', () => { cy.waitForElement('.summaryHeader'); cy.get('.summaryHeader > div').should('have.text', '19 - salesboss salesboss'); - cy.get(':nth-child(1) > :nth-child(2) > .value > span').should( - 'have.text', - 'salesBossNick', - ); + cy.get(department).should('have.text', 'VENTAS'); }); it('should try descriptors', () => { cy.waitForElement('.summaryHeader'); - cy.get(departmentDescriptor).click(); + cy.get(department).click(); cy.get('.descriptor').should('be.visible'); cy.get('.q-item > .q-item__label').should('include.text', '43'); - cy.get(roleDescriptor).click(); + cy.get('.summaryBody').click(); + cy.get(role).click(); cy.get('.descriptor').should('be.visible'); cy.get('.q-item > .q-item__label').should('include.text', '19'); });