From f4839cb642851a5ffd677534433b68c255c8565b Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 25 Jan 2019 08:50:13 +0100 Subject: [PATCH] #1022 ticket.create --- e2e/paths/client-module/14_risk.spec.js | 4 ++-- .../components/user-configuration-popover/index.js | 14 ++++++-------- modules/client/front/risk/index/index.html | 5 +++-- modules/client/front/risk/index/index.js | 3 +++ services/db/install/dump/fixtures.sql | 1 + 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/e2e/paths/client-module/14_risk.spec.js b/e2e/paths/client-module/14_risk.spec.js index 15958407e2..b0613e4fb9 100644 --- a/e2e/paths/client-module/14_risk.spec.js +++ b/e2e/paths/client-module/14_risk.spec.js @@ -1,7 +1,7 @@ import selectors from '../../helpers/selectors.js'; import createNightmare from '../../helpers/nightmare'; -// test excluded #1022 -xdescribe('Client risk path', () => { + +describe('Client risk path', () => { const nightmare = createNightmare(); beforeAll(() => { diff --git a/front/salix/components/user-configuration-popover/index.js b/front/salix/components/user-configuration-popover/index.js index 2b8d2d2437..ee4ebab087 100644 --- a/front/salix/components/user-configuration-popover/index.js +++ b/front/salix/components/user-configuration-popover/index.js @@ -43,6 +43,8 @@ class Controller { set warehouseFk(value) { this.warehouse = value; + if (!window.localStorage.defaultWarehouseFk) + window.localStorage.defaultWarehouseFk = value; this.setUserConfig('warehouseFk', value); } @@ -52,6 +54,8 @@ class Controller { set companyFk(value) { this.company = value; + if (!window.localStorage.defaultCompanyFk) + window.localStorage.defaultCompanyFk = value; this.setUserConfig('companyFk', value); } @@ -74,17 +78,11 @@ class Controller { getUserConfig() { this.$http.get('/api/UserConfigs/getUserConfig') .then(res => { - if (res.data && res.data.warehouseFk) { + if (res.data && res.data.warehouseFk) this.warehouse = res.data.warehouseFk; - if (!localStorage.getItem('localWarehouseFk')) - localStorage.setItem('defaultWarehouseFk', res.data.warehouseFk); - } - if (res.data && res.data.companyFk) { + if (res.data && res.data.companyFk) this.company = res.data.companyFk; - if (!localStorage.getItem('localCompanyFk')) - localStorage.setItem('defaultCompanyFk', res.data.companyFk); - } }); } diff --git a/modules/client/front/risk/index/index.html b/modules/client/front/risk/index/index.html index 273299f7c8..d5740cc715 100644 --- a/modules/client/front/risk/index/index.html +++ b/modules/client/front/risk/index/index.html @@ -3,12 +3,13 @@ url="/client/api/receipts/filter" params="$ctrl.params" limit="20" - data="$ctrl.risks"> + data="$ctrl.risks" + auto-load="true"> diff --git a/modules/client/front/risk/index/index.js b/modules/client/front/risk/index/index.js index 5744c6fb18..14c1be3b70 100644 --- a/modules/client/front/risk/index/index.js +++ b/modules/client/front/risk/index/index.js @@ -18,6 +18,7 @@ class Controller { }, where: { clientFk: $stateParams.id, + companyFk: this.companyFk }, }; this.params = { @@ -29,7 +30,9 @@ class Controller { } setOrder(value) { this.params.params.companyFk = value; + this.filter.where.companyFk = value; this.$.model.refresh(); + this.$.riskModel.refresh(); } set risks(value) { diff --git a/services/db/install/dump/fixtures.sql b/services/db/install/dump/fixtures.sql index e72ab35b74..231fb9ff66 100644 --- a/services/db/install/dump/fixtures.sql +++ b/services/db/install/dump/fixtures.sql @@ -1052,6 +1052,7 @@ INSERT INTO `vn`.`orderTicket`(`orderFk`, `ticketFk`) INSERT INTO `vn`.`userConfig` (`userFk`, `warehouseFk`, `companyFk`) VALUES (1, 2, 69), + (5, 1, 442), (9, 1, 442), (18, 3, 791);