diff --git a/README.md b/README.md
index d280e29ce..8eff99137 100644
--- a/README.md
+++ b/README.md
@@ -49,3 +49,9 @@ pnpm run test:e2e:summary
```bash
quasar build
```
+
+### Serve the app for production
+
+```bash
+quasar build quasar serve dist/spa --host 0.0.0.0 --proxy=./proxy-serve.js
+```
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/src/stores/useDescriptorStore.js b/src/stores/useDescriptorStore.js
index 89189f32e..a5b83a42e 100644
--- a/src/stores/useDescriptorStore.js
+++ b/src/stores/useDescriptorStore.js
@@ -16,9 +16,7 @@ export const useDescriptorStore = defineStore('descriptorStore', () => {
for (const file in files) {
const name = file.split('/').at(-1).slice(0, -19).toLowerCase();
const descriptor = moduleParser[name] ?? name;
- currentDescriptors[descriptor + 'Fk'] = defineAsyncComponent(
- () => import(/* @vite-ignore */ file),
- );
+ currentDescriptors[descriptor + 'Fk'] = defineAsyncComponent(files[file]);
}
setDescriptors(currentDescriptors);
return currentDescriptors;
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/invoiceIn/invoiceInVat.spec.js b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
index e9412244f..ff7d639e6 100644
--- a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
@@ -1,7 +1,7 @@
///
describe('InvoiceInVat', () => {
const thirdRow = 'tbody > :nth-child(3)';
- const firstLineVat = 'tbody > :nth-child(1) > :nth-child(4)';
+ const firstLineVat = 'tbody > :nth-child(1) ';
const vats = '[data-cy="vat-sageiva"]';
const dialogInputs = '.q-dialog label input';
const addBtn = 'tbody tr:nth-child(1) td:nth-child(2) .--add-icon';
@@ -18,6 +18,17 @@ describe('InvoiceInVat', () => {
cy.get(vats).eq(0).should('have.value', '8: H.P. IVA 21% CEE');
});
+ it('should mark the line as deductible VAT', () => {
+ cy.get(`${firstLineVat} [data-cy="isDeductible_checkbox"]`).click();
+
+ cy.saveCard();
+
+ cy.get(`${firstLineVat} [data-cy="isDeductible_checkbox"]`)
+
+ .click();
+ cy.saveCard();
+ });
+
it('should add a new row', () => {
cy.addRow();
cy.fillRow(thirdRow, [true, 2000000001, 30, 'H.P. IVA 10']);
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');
});