From 831bfb0352b9cefad5877c5e988a1891b58bc85a Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 21 Dec 2021 08:52:39 +0100 Subject: [PATCH] change route for hasRoute --- modules/ticket/back/methods/ticket/filter.js | 4 ++-- .../ticket/back/methods/ticket/specs/filter.spec.js | 10 +++++----- modules/ticket/front/search-panel/index.html | 4 ++-- modules/ticket/front/search-panel/locale/es.yml | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/ticket/back/methods/ticket/filter.js b/modules/ticket/back/methods/ticket/filter.js index 9e51d36070..58c440e950 100644 --- a/modules/ticket/back/methods/ticket/filter.js +++ b/modules/ticket/back/methods/ticket/filter.js @@ -84,7 +84,7 @@ module.exports = Self => { description: `Whether to show only tickets with problems` }, { - arg: 'route', + arg: 'hasRoute', type: 'boolean', description: `Whether to show only tickets with route` }, @@ -193,7 +193,7 @@ module.exports = Self => { case 'alertLevel': return {'ts.alertLevel': value}; - case 'route': + case 'hasRoute': if (value == true) return {'t.routeFk': {neq: null}}; return {'t.routeFk': null}; diff --git a/modules/ticket/back/methods/ticket/specs/filter.spec.js b/modules/ticket/back/methods/ticket/specs/filter.spec.js index d1d44bb9c2..b251d53356 100644 --- a/modules/ticket/back/methods/ticket/specs/filter.spec.js +++ b/modules/ticket/back/methods/ticket/specs/filter.spec.js @@ -228,7 +228,7 @@ describe('ticket filter()', () => { try { const options = {transaction: tx}; - const ctx = {req: {accessToken: {userId: 9}}, args: {route: true}}; + const ctx = {req: {accessToken: {userId: 9}}, args: {hasRoute: true}}; const filter = {}; const result = await models.Ticket.filter(ctx, filter, options); @@ -247,11 +247,11 @@ describe('ticket filter()', () => { try { const options = {transaction: tx}; - const ctx = {req: {accessToken: {userId: 9}}, args: {route: false}}; + const ctx = {req: {accessToken: {userId: 9}}, args: {hasRoute: false}}; const filter = {}; const result = await models.Ticket.filter(ctx, filter, options); - expect(result.length).toEqual(2); + expect(result.length).toEqual(5); await tx.rollback(); } catch (e) { @@ -266,11 +266,11 @@ describe('ticket filter()', () => { try { const options = {transaction: tx}; - const ctx = {req: {accessToken: {userId: 9}}, args: {route: null}}; + const ctx = {req: {accessToken: {userId: 9}}, args: {hasRoute: null}}; const filter = {}; const result = await models.Ticket.filter(ctx, filter, options); - expect(result.length).toEqual(24); + expect(result.length).toEqual(27); await tx.rollback(); } catch (e) { diff --git a/modules/ticket/front/search-panel/index.html b/modules/ticket/front/search-panel/index.html index 78ae727342..b0d4963bd5 100644 --- a/modules/ticket/front/search-panel/index.html +++ b/modules/ticket/front/search-panel/index.html @@ -137,8 +137,8 @@ diff --git a/modules/ticket/front/search-panel/locale/es.yml b/modules/ticket/front/search-panel/locale/es.yml index fcb7cc7e33..52cc04d6eb 100644 --- a/modules/ticket/front/search-panel/locale/es.yml +++ b/modules/ticket/front/search-panel/locale/es.yml @@ -12,7 +12,7 @@ Order id: Id cesta Grouped States: Estado agrupado Days onward: Días adelante With problems: Con problemas -With route: Con ruta +Has route: Con ruta Pending: Pendiente FREE: Libre DELIVERED: Servido