From 2aaded4ed41dd304aa3c06f0a4b9937a5b769177 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 8 May 2023 16:30:21 +0200 Subject: [PATCH] refs #5517 Fix: Show spinner when loading --- e2e/paths/02-client/10_add_greuge.spec.js | 7 ++----- front/core/components/crud-model/crud-model.js | 2 +- front/core/components/th/index.js | 13 ------------- front/salix/components/log/index.html | 5 +---- modules/client/front/greuge/index/index.html | 14 +++++++------- modules/client/front/greuge/index/index.js | 5 +---- modules/order/front/volume/index.html | 6 +++--- modules/order/front/volume/index.js | 5 +++-- modules/ticket/front/volume/index.html | 9 +++++---- modules/ticket/front/volume/index.js | 5 +++-- 10 files changed, 26 insertions(+), 45 deletions(-) diff --git a/e2e/paths/02-client/10_add_greuge.spec.js b/e2e/paths/02-client/10_add_greuge.spec.js index 6ea923a281..9141c499ab 100644 --- a/e2e/paths/02-client/10_add_greuge.spec.js +++ b/e2e/paths/02-client/10_add_greuge.spec.js @@ -29,19 +29,16 @@ describe('Client Add greuge path', () => { expect(message.text).toContain('Some fields are invalid'); }); - it(`should create a new greuge with all its data`, async() => { + it(`should create a new greuge with all its data and confirm the greuge was added to the list`, async() => { await page.write(selectors.clientGreuge.amount, '999'); await page.waitForTextInField(selectors.clientGreuge.amount, '999'); await page.write(selectors.clientGreuge.description, 'new armor for Batman!'); await page.waitToClick(selectors.clientGreuge.saveButton); const message = await page.waitForSnackbar(); - expect(message.text).toContain('Data saved!'); - }); - - it('should confirm the greuge was added to the list', async() => { const result = await page.waitToGetProperty(selectors.clientGreuge.firstGreugeText, 'innerText'); + expect(message.text).toContain('Data saved!'); expect(result).toContain(999); expect(result).toContain('new armor for Batman!'); expect(result).toContain('Diff'); diff --git a/front/core/components/crud-model/crud-model.js b/front/core/components/crud-model/crud-model.js index 421a79f9b0..fcfe0be44d 100644 --- a/front/core/components/crud-model/crud-model.js +++ b/front/core/components/crud-model/crud-model.js @@ -236,7 +236,7 @@ export default class CrudModel extends ModelProxy { this.canceler = this.$q.defer(); this.isPaging = append; - if (!append && this.status != 'ready') + if (!append) this.status = 'loading'; let params = Object.assign( diff --git a/front/core/components/th/index.js b/front/core/components/th/index.js index 341558fb1c..9f1e119033 100644 --- a/front/core/components/th/index.js +++ b/front/core/components/th/index.js @@ -8,18 +8,8 @@ export default class Th { $element.on('click', () => this.onToggleOrder()); } - /** - * Changes the order if the cell has a field and defaultOrder property - */ $onInit() { if (!this.field) return; - - if (this.defaultOrder) { - this.order = this.defaultOrder; - this.table.applyOrder(this.field, this.order); - this.updateArrow(); - } - this.updateArrow(); } @@ -82,9 +72,6 @@ ngModule.vnComponent('vnTh', { template: require('./index.html'), transclude: true, controller: Th, - bindings: { - defaultOrder: '@?' - }, require: { table: '^^vnTable' } diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html index f41dfccebb..b7697a1fdc 100644 --- a/front/salix/components/log/index.html +++ b/front/salix/components/log/index.html @@ -14,10 +14,7 @@ order="changedModel" auto-load="true"> - +
- @@ -28,7 +28,7 @@ - Date + Date Created by Comment Type @@ -53,11 +53,11 @@ - \ No newline at end of file + diff --git a/modules/client/front/greuge/index/index.js b/modules/client/front/greuge/index/index.js index 7a5ccc5316..4f1b77b4bf 100644 --- a/modules/client/front/greuge/index/index.js +++ b/modules/client/front/greuge/index/index.js @@ -11,8 +11,7 @@ class Controller extends Section { scope: { fields: ['id', 'name'] }, - }, - { + }, { relation: 'user', scope: { fields: ['id', 'name'] @@ -24,8 +23,6 @@ class Controller extends Section { } } -Controller.$inject = ['$element', '$scope']; - ngModule.vnComponent('vnClientGreugeIndex', { template: require('./index.html'), controller: Controller diff --git a/modules/order/front/volume/index.html b/modules/order/front/volume/index.html index 7c2ff4e3d9..e0053f9edc 100644 --- a/modules/order/front/volume/index.html +++ b/modules/order/front/volume/index.html @@ -12,11 +12,11 @@ @@ -24,7 +24,7 @@ - Item + Item Description Quantity m³ per quantity diff --git a/modules/order/front/volume/index.js b/modules/order/front/volume/index.js index aaadf2af67..c1bc5ec7d9 100644 --- a/modules/order/front/volume/index.js +++ b/modules/order/front/volume/index.js @@ -6,9 +6,10 @@ class Controller extends Section { constructor($element, $) { super($element, $); this.filter = { - include: [{ + include: { relation: 'item' - }] + }, + order: 'itemFk' }; this.order = {}; this.ticketVolumes = []; diff --git a/modules/ticket/front/volume/index.html b/modules/ticket/front/volume/index.html index f5dd180333..ff0a867723 100644 --- a/modules/ticket/front/volume/index.html +++ b/modules/ticket/front/volume/index.html @@ -1,4 +1,5 @@ -
- -
@@ -23,7 +24,7 @@ Item - Description + Description Packing type Quantity m³ per quantity diff --git a/modules/ticket/front/volume/index.js b/modules/ticket/front/volume/index.js index a3d531898c..7acecf5701 100644 --- a/modules/ticket/front/volume/index.js +++ b/modules/ticket/front/volume/index.js @@ -5,9 +5,10 @@ class Controller extends Section { constructor($element, $) { super($element, $); this.filter = { - include: [{ + include: { relation: 'item' - }] + }, + order: 'concept' }; this.ticketVolumes = [];