diff --git a/front/core/components/field/index.js b/front/core/components/field/index.js index 8d619e4a3..d18973bbe 100644 --- a/front/core/components/field/index.js +++ b/front/core/components/field/index.js @@ -187,7 +187,10 @@ export default class Field extends FormInput { } onChange() { - this.emit('change', {value: this.field}); + // Changes doesn't reflect until appling async + this.$.$applyAsync(() => { + this.emit('change', {value: this.field}); + }); } } Field.$inject = ['$element', '$scope']; diff --git a/modules/ticket/front/search-panel/index.html b/modules/ticket/front/search-panel/index.html index 6928e10c6..934b1fc1f 100644 --- a/modules/ticket/front/search-panel/index.html +++ b/modules/ticket/front/search-panel/index.html @@ -27,13 +27,13 @@ vn-one label="From" ng-model="filter.from" - on-change="$ctrl.from = value"> + on-change="filter.scopeDays = null"> + on-change="filter.scopeDays = null"> O + + diff --git a/modules/ticket/front/search-panel/index.js b/modules/ticket/front/search-panel/index.js index 3efeb576c..71a339482 100644 --- a/modules/ticket/front/search-panel/index.js +++ b/modules/ticket/front/search-panel/index.js @@ -24,26 +24,6 @@ class Controller extends SearchPanel { }); } - get from() { - return this._from; - } - - set from(value) { - this._from = value; - - this.filter.scopeDays = null; - } - - get to() { - return this._to; - } - - set to(value) { - this._to = value; - - this.filter.scopeDays = null; - } - get scopeDays() { return this._scopeDays; } diff --git a/modules/ticket/front/search-panel/index.spec.js b/modules/ticket/front/search-panel/index.spec.js index 55d341d2a..99c9d8da0 100644 --- a/modules/ticket/front/search-panel/index.spec.js +++ b/modules/ticket/front/search-panel/index.spec.js @@ -10,6 +10,7 @@ describe('Ticket Component vnTicketSearchPanel', () => { $httpBackend = _$httpBackend_; controller = $componentController('vnTicketSearchPanel', {$element: null}); controller.$t = () => {}; + controller.filter = {}; })); describe('getGroupedStates()', () => { @@ -32,4 +33,16 @@ describe('Ticket Component vnTicketSearchPanel', () => { }]); }); }); + + describe('scopeDays() setter', () => { + it('should clear the date range', () => { + controller.filter.from = new Date(); + controller.filter.to = new Date(); + + controller.scopeDays = 1; + + expect(controller.filter.from).toBeNull(); + expect(controller.filter.to).toBeNull(); + }); + }); }); diff --git a/modules/ticket/front/search-panel/locale/es.yml b/modules/ticket/front/search-panel/locale/es.yml index 5fa75ac09..54a01c82f 100644 --- a/modules/ticket/front/search-panel/locale/es.yml +++ b/modules/ticket/front/search-panel/locale/es.yml @@ -16,4 +16,5 @@ Pending: Pendiente FREE: Libre DELIVERED: Servido ON_PREPARATION: En preparacion -PACKED: Encajado \ No newline at end of file +PACKED: Encajado +Cannot choose a range of dates and days onward at the same time: No se puede selecionar un rango de fechas y días en adelante a la vez \ No newline at end of file diff --git a/modules/ticket/front/search-panel/style.scss b/modules/ticket/front/search-panel/style.scss index 374db22d7..56c36fabd 100644 --- a/modules/ticket/front/search-panel/style.scss +++ b/modules/ticket/front/search-panel/style.scss @@ -8,6 +8,7 @@ form#ticket-form { .scope-days { border: $border-thin-light; + position: relative; text-align: right; & > p { @@ -17,6 +18,13 @@ form#ticket-form { .or { font-weight: bold; - font-size: 26px + font-size: 26px; + color: $color-font-secondary + } + + vn-icon[icon="info"] { + position: absolute; + top: 2px; + right: 2px } } \ No newline at end of file diff --git a/modules/ticket/front/weekly/locale/es.yml b/modules/ticket/front/weekly/locale/es.yml index 804467dae..62f0f5b53 100644 --- a/modules/ticket/front/weekly/locale/es.yml +++ b/modules/ticket/front/weekly/locale/es.yml @@ -4,4 +4,4 @@ You are going to delete this weekly ticket: Vas a eliminar este ticket programad This ticket will be removed from weekly tickets! Continue anyway?: Este ticket se eliminará de tickets programados! ¿Continuar de todas formas? Search weekly ticket by id or client id: Busca tickets programados por el identificador o el identificador del cliente Search by weekly ticket: Buscar por tickets programados -weekDay: Dia \ No newline at end of file +Weekday: Llegada \ No newline at end of file