From a98a8831ed359ba2f3595b8f3a0c52c49dfcd040 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 30 Sep 2019 07:53:38 +0200 Subject: [PATCH 1/8] prevent popover focus propagation #1718 --- front/core/components/popover/popover.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/core/components/popover/popover.js b/front/core/components/popover/popover.js index 0041a84139..0cc2a74903 100644 --- a/front/core/components/popover/popover.js +++ b/front/core/components/popover/popover.js @@ -100,7 +100,7 @@ export default class Popover extends Component { }, 30); this.document.addEventListener('keydown', this.docKeyDownHandler); - this.document.addEventListener('focusin', this.docFocusInHandler); + this.document.addEventListener('focus', this.docFocusInHandler); this.element.addEventListener('mousedown', this.bgMouseDownHandler); this.deregisterCallback = this.$transitions.onStart({}, () => this.hide()); From e380e4466c587ee238870c04de7969b281e2e111 Mon Sep 17 00:00:00 2001 From: Bernat Date: Mon, 30 Sep 2019 08:26:51 +0200 Subject: [PATCH 2/8] =?UTF-8?q?#1717=20route.basic-data=20a=C3=B1adir=20ca?= =?UTF-8?q?mpo=20description?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- e2e/helpers/selectors.js | 4 +-- .../08-route-module/02_basic_data.spec.js | 4 +-- modules/route/front/basic-data/index.html | 27 ++++++++++--------- modules/route/front/basic-data/index.js | 16 +++++++++++ modules/route/front/basic-data/locale/es.yml | 1 + modules/route/front/descriptor/index.html | 4 +-- modules/route/front/descriptor/index.js | 1 - modules/route/front/descriptor/locale/es.yml | 3 ++- modules/route/front/routes.json | 4 +-- 9 files changed, 42 insertions(+), 22 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 9be6bc0dd5..34926155fe 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -652,8 +652,8 @@ export default { kmStartInput: 'vn-route-basic-data vn-input-number[field="$ctrl.route.kmStart"] input', kmEndInput: 'vn-route-basic-data vn-input-number[model="$ctrl.route.kmEnd"] input', createdDateInput: 'vn-route-basic-data vn-date-picker[model="$ctrl.route.created"] > div > input', - startedDateInput: 'vn-route-basic-data vn-date-picker[model="$ctrl.route.started"] > div > input', - finishedDateInput: 'vn-route-basic-data vn-date-picker[model="$ctrl.route.finished"] > div > input', + startedHourInput: 'vn-route-basic-data vn-input-time[model="$ctrl.route.started"] input', + finishedHourInput: 'vn-route-basic-data vn-input-time[model="$ctrl.route.finished"] input', saveButton: 'vn-route-basic-data vn-submit[label="Save"] input' }, routeTickets: { diff --git a/e2e/paths/08-route-module/02_basic_data.spec.js b/e2e/paths/08-route-module/02_basic_data.spec.js index 593a6b1863..63ed673d9f 100644 --- a/e2e/paths/08-route-module/02_basic_data.spec.js +++ b/e2e/paths/08-route-module/02_basic_data.spec.js @@ -20,8 +20,8 @@ describe('Route basic Data path', () => { .write(selectors.routeBasicData.kmStartInput, 1) .clearInput(selectors.routeBasicData.kmEndInput) .write(selectors.routeBasicData.kmEndInput, 2) - .datePicker(selectors.routeBasicData.startedDateInput, 1, null) - .datePicker(selectors.routeBasicData.finishedDateInput, 1, null) + .write(selectors.routeBasicData.startedHourInput, '0800') + .write(selectors.routeBasicData.finishedHourInput, '1230') .waitToClick(selectors.routeBasicData.saveButton) .waitForLastSnackbar(); diff --git a/modules/route/front/basic-data/index.html b/modules/route/front/basic-data/index.html index da58ead63f..5bdcfc1e5d 100644 --- a/modules/route/front/basic-data/index.html +++ b/modules/route/front/basic-data/index.html @@ -5,7 +5,7 @@ form="form" save="patch"> -
+ - + + + + + + - - - + label="Description" + field="$ctrl.route.description" vn-focus> + diff --git a/modules/route/front/basic-data/index.js b/modules/route/front/basic-data/index.js index 30e8abfb36..3c64200f4c 100644 --- a/modules/route/front/basic-data/index.js +++ b/modules/route/front/basic-data/index.js @@ -1,8 +1,24 @@ import ngModule from '../module'; +class Controller { + constructor($scope, $state) { + this.$scope = $scope; + this.$state = $state; + } + + onSubmit() { + this.$scope.watcher.submit().then(() => { + this.card.reload(); + }); + } +} ngModule.component('vnRouteBasicData', { template: require('./index.html'), + controller: Controller, bindings: { route: '<' + }, + require: { + card: '^vnRouteCard' } }); diff --git a/modules/route/front/basic-data/locale/es.yml b/modules/route/front/basic-data/locale/es.yml index 49bc892942..442a4fa828 100644 --- a/modules/route/front/basic-data/locale/es.yml +++ b/modules/route/front/basic-data/locale/es.yml @@ -2,3 +2,4 @@ Date finished: Fecha fin Date started: Fecha inicio Km start: Km de inicio Km end: Km de fin +Description: DescripciĆ³n \ No newline at end of file diff --git a/modules/route/front/descriptor/index.html b/modules/route/front/descriptor/index.html index dac65333e9..1b5576167c 100644 --- a/modules/route/front/descriptor/index.html +++ b/modules/route/front/descriptor/index.html @@ -40,7 +40,7 @@ + ng-class="{bright: $ctrl.route.m3 > $ctrl.route.vehicle.m3 && $ctrl.route.vehicle.m3 != NULL}">