From e380e4466c587ee238870c04de7969b281e2e111 Mon Sep 17 00:00:00 2001 From: Bernat Date: Mon, 30 Sep 2019 08:26:51 +0200 Subject: [PATCH] =?UTF-8?q?#1717=20route.basic-data=20a=C3=B1adir=20campo?= =?UTF-8?q?=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 9be6bc0dd..34926155f 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 593a6b186..63ed673d9 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 da58ead63..5bdcfc1e5 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 30e8abfb3..3c64200f4 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 49bc89294..442a4fa82 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 dac65333e..1b5576167 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}">