From a21476e3df80bf6f136df3807280c786d44ad6e0 Mon Sep 17 00:00:00 2001 From: bernat Date: Wed, 23 Dec 2020 12:42:41 +0100 Subject: [PATCH] fix searchbar index --- db/dump/fixtures.sql | 2 +- e2e/paths/02-client/15_user_config.spec.js | 2 +- modules/route/front/main/index.html | 5 ++--- modules/route/front/main/index.js | 3 ++- modules/ticket/front/main/index.html | 2 +- modules/ticket/front/main/index.js | 2 +- modules/travel/front/main/index.html | 3 ++- modules/travel/front/main/index.js | 8 ++++++++ 8 files changed, 18 insertions(+), 9 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 4ad5321b0..aa15b774f 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -1638,7 +1638,7 @@ INSERT INTO `vn`.`orderTicket`(`orderFk`, `ticketFk`) INSERT INTO `vn`.`userConfig` (`userFk`, `warehouseFk`, `companyFk`) VALUES - (1, 2, 69), + (1, 1, 69), (5, 1, 442), (9, 1, 442), (18, 3, 567); diff --git a/e2e/paths/02-client/15_user_config.spec.js b/e2e/paths/02-client/15_user_config.spec.js index 0e18c07ad..2954ff522 100644 --- a/e2e/paths/02-client/15_user_config.spec.js +++ b/e2e/paths/02-client/15_user_config.spec.js @@ -71,7 +71,7 @@ describe('User config', () => { expect(expectedLocalWarehouse).toBeTruthy(); expect(expectedLocalBank).toBeTruthy(); expect(expectedLocalCompany).toBeTruthy(); - expect(userWarehouse).toEqual('Warehouse Two'); + expect(userWarehouse).toEqual('Warehouse One'); expect(userCompany).toEqual('CCs'); }); diff --git a/modules/route/front/main/index.html b/modules/route/front/main/index.html index f0de3f09b..16243be03 100644 --- a/modules/route/front/main/index.html +++ b/modules/route/front/main/index.html @@ -2,15 +2,14 @@ vn-id="model" url="Routes/filter" limit="20" - order="created DESC" - auto-load="true"> + order="created DESC"> diff --git a/modules/route/front/main/index.js b/modules/route/front/main/index.js index 8aa6552e1..a6d5bedd1 100644 --- a/modules/route/front/main/index.js +++ b/modules/route/front/main/index.js @@ -10,7 +10,8 @@ export default class Route extends ModuleMain { let from = new Date(); from.setHours(0, 0, 0, 0); - this.filter = {from, to, warehouseFk: this.vnConfig.warehouseFk}; + this.filterParams = {from, to, warehouseFk: this.vnConfig.warehouseFk}; + this.$.model.applyFilter(null, this.filterParams); } } diff --git a/modules/ticket/front/main/index.html b/modules/ticket/front/main/index.html index 7ea5c86e6..953dc8a6b 100644 --- a/modules/ticket/front/main/index.html +++ b/modules/ticket/front/main/index.html @@ -11,7 +11,7 @@ info="Search ticket by id or alias" model="model" fetch-params="$ctrl.fetchParams($params)" - suggested-filter="$ctrl.defaultFilter"> + suggested-filter="$ctrl.filterParams"> diff --git a/modules/ticket/front/main/index.js b/modules/ticket/front/main/index.js index 9bbedbcc9..78334ba97 100644 --- a/modules/ticket/front/main/index.js +++ b/modules/ticket/front/main/index.js @@ -5,7 +5,7 @@ export default class Ticket extends ModuleMain { constructor() { super(); - this.defaultFilter = { + this.filterParams = { scopeDays: 1 }; } diff --git a/modules/travel/front/main/index.html b/modules/travel/front/main/index.html index 56167c6fc..feb1e8b01 100644 --- a/modules/travel/front/main/index.html +++ b/modules/travel/front/main/index.html @@ -10,7 +10,8 @@ panel="vn-travel-search-panel" info="Search travels by id" model="model" - fetch-params="$ctrl.fetchParams($params)"> + fetch-params="$ctrl.fetchParams($params)" + suggested-filter="$ctrl.filterParams"> diff --git a/modules/travel/front/main/index.js b/modules/travel/front/main/index.js index f04cc750d..d6f103033 100644 --- a/modules/travel/front/main/index.js +++ b/modules/travel/front/main/index.js @@ -2,6 +2,14 @@ import ngModule from '../module'; import ModuleMain from 'salix/components/module-main'; export default class Travel extends ModuleMain { + constructor() { + super(); + + this.filterParams = { + scopeDays: 1 + }; + } + fetchParams($params) { if (!Object.entries($params).length) $params.scopeDays = 1;