From eff46c1cec81cf0d12a6e775e4749098481025fc Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 26 Jun 2023 07:43:36 +0200 Subject: [PATCH] refs #5066 e2e fix, vnConfig --- e2e/paths/08-route/02_basic_data.spec.js | 2 +- modules/route/front/basic-data/index.html | 3 ++- modules/route/front/basic-data/index.js | 19 +++++++------------ 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/e2e/paths/08-route/02_basic_data.spec.js b/e2e/paths/08-route/02_basic_data.spec.js index 6008b0482..7ab7dda42 100644 --- a/e2e/paths/08-route/02_basic_data.spec.js +++ b/e2e/paths/08-route/02_basic_data.spec.js @@ -24,7 +24,7 @@ describe('Route basic Data path', () => { const form = 'vn-route-basic-data form'; const values = { worker: 'adminBossNick', - vehicle: '1111-IMK - Warehouse One', + vehicle: '1111-IMK', created: nextMonth, kmStart: 1, kmEnd: 2, diff --git a/modules/route/front/basic-data/index.html b/modules/route/front/basic-data/index.html index 514c535a2..ade9230e8 100644 --- a/modules/route/front/basic-data/index.html +++ b/modules/route/front/basic-data/index.html @@ -28,7 +28,8 @@ data="$ctrl.vehicles" show-field="numberPlate" value-field="id" - order="false"> + order="false" + vn-name="vehicle"> {{::numberPlate}} - {{::name}} diff --git a/modules/route/front/basic-data/index.js b/modules/route/front/basic-data/index.js index e6be796ce..f051e23c5 100644 --- a/modules/route/front/basic-data/index.js +++ b/modules/route/front/basic-data/index.js @@ -2,23 +2,18 @@ import ngModule from '../module'; import Section from 'salix/components/section'; class Controller extends Section { + $onInit() { + this.$http.post(`Vehicles/sorted`, {warehouseFk: this.vnConfig.warehouseFk}) + .then(res => { + this.vehicles = res.data; + }); + } + onSubmit() { this.$.watcher.submit().then(() => this.card.reload() ); } - constructor($element, $) { - super($element, $); - this.$http.get(`UserConfigs/getUserConfig`) - .then(res => { - if (res.data) { - this.$http.post(`Vehicles/sorted`, {warehouseFk: res.data.warehouseFk}) - .then(res => { - this.vehicles = res.data; - }); - } - }); - } } ngModule.vnComponent('vnRouteBasicData', {