From 011bba16606101ad786087c3dfd0125f45ddde9c Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 19 Oct 2020 09:05:38 +0200 Subject: [PATCH] Added vn-anchor to client and ticket index --- front/core/directives/anchor.js | 26 +++++++++---------- modules/client/front/descriptor/locale/es.yml | 3 ++- modules/client/front/index/index.html | 2 +- modules/ticket/front/index/index.html | 2 +- modules/ticket/front/index/index.js | 5 ---- modules/worker/front/index/index.html | 2 +- 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/front/core/directives/anchor.js b/front/core/directives/anchor.js index a0ae62a980..4b35f14752 100644 --- a/front/core/directives/anchor.js +++ b/front/core/directives/anchor.js @@ -20,25 +20,25 @@ export function directive($state, $window) { ctrlPressed = false; }); - function changeState(event, state) { - const params = stringifyParams(state); - $state.go(state.url, params); + function changeState(event, data) { + const params = stringifyParams(data); + $state.go(data.state, params); event.preventDefault(); event.stopPropagation(); } - function newTab(event, state) { - const params = stringifyParams(state); - const url = $state.href(state.url, params); - $window.open(url); + function newTab(event, data) { + const params = stringifyParams(data); + const href = $state.href(data.state, params); + $window.open(href); event.preventDefault(); event.stopPropagation(); } - function stringifyParams(state) { - const params = Object.assign({}, state.params); + function stringifyParams(data) { + const params = Object.assign({}, data.params); for (let param in params) params[param] = JSON.stringify(params[param]); @@ -48,17 +48,17 @@ export function directive($state, $window) { return { restrict: 'A', link: function($scope, $element, $attrs) { - const state = $scope.$eval($attrs.vnAnchor); + const data = $scope.$eval($attrs.vnAnchor); $element.on('click', event => { if (ctrlPressed) - newTab(event, state); + newTab(event, data); else - changeState(event, state); + changeState(event, data); }); $element.on('mousedown', event => { if (event.button == 1) - newTab(event, state); + newTab(event, data); }); } }; diff --git a/modules/client/front/descriptor/locale/es.yml b/modules/client/front/descriptor/locale/es.yml index 3f59aede8d..03cf17e7bf 100644 --- a/modules/client/front/descriptor/locale/es.yml +++ b/modules/client/front/descriptor/locale/es.yml @@ -1,4 +1,5 @@ Simple ticket: Ticket simple View consumer report: Ver informe de consumo From date: Fecha desde -To date: Fecha hasta \ No newline at end of file +To date: Fecha hasta +Go to user: Ir al usuario \ No newline at end of file diff --git a/modules/client/front/index/index.html b/modules/client/front/index/index.html index dc65d60252..3c64fe55fa 100644 --- a/modules/client/front/index/index.html +++ b/modules/client/front/index/index.html @@ -40,7 +40,7 @@ vn-tooltip="Client frozen" icon="icon-frozen"> - diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index e9066a41b9..902d1f5a47 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -119,7 +119,7 @@ diff --git a/modules/ticket/front/index/index.js b/modules/ticket/front/index/index.js index 32c2f0baac..cae9c403cc 100644 --- a/modules/ticket/front/index/index.js +++ b/modules/ticket/front/index/index.js @@ -114,11 +114,6 @@ export default class Controller extends Section { return 'warning'; } - goToLines(ticketFk) { - let url = this.$state.href('ticket.card.sale', {id: ticketFk}, {absolute: true}); - window.open(url, '_blank'); - } - preview(ticket) { this.selectedTicket = ticket; this.$.summary.show(); diff --git a/modules/worker/front/index/index.html b/modules/worker/front/index/index.html index 3d383ae040..c994e7a7b1 100644 --- a/modules/worker/front/index/index.html +++ b/modules/worker/front/index/index.html @@ -29,7 +29,7 @@