From 58a763acf5314bdd98f083114f6fe39bde50d62f Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 21 Oct 2019 14:21:52 +0200 Subject: [PATCH] added quicklinks to worker descriptor --- modules/client/front/descriptor/index.js | 8 ++--- modules/ticket/front/sale/index.html | 2 +- modules/worker/front/descriptor/index.html | 11 ++----- modules/worker/front/descriptor/index.js | 34 ++++++++++++++++++++++ 4 files changed, 42 insertions(+), 13 deletions(-) diff --git a/modules/client/front/descriptor/index.js b/modules/client/front/descriptor/index.js index 1eecdc15a..04d619f50 100644 --- a/modules/client/front/descriptor/index.js +++ b/modules/client/front/descriptor/index.js @@ -13,6 +13,10 @@ class Controller { callback.call(this); } + get client() { + return this._client; + } + set client(value) { this._client = value; @@ -32,10 +36,6 @@ class Controller { }; } - get client() { - return this._client; - } - set quicklinks(value = {}) { this._quicklinks = Object.assign(value, this._quicklinks); } diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html index 38ed007a0..b818d86e0 100644 --- a/modules/ticket/front/sale/index.html +++ b/modules/ticket/front/sale/index.html @@ -127,7 +127,7 @@ {{sale.quantity}} - diff --git a/modules/worker/front/descriptor/index.html b/modules/worker/front/descriptor/index.html index 760f889ef..26c2f193e 100644 --- a/modules/worker/front/descriptor/index.html +++ b/modules/worker/front/descriptor/index.html @@ -34,13 +34,8 @@ value="{{$ctrl.worker.sip.extension}}"> - + + \ No newline at end of file diff --git a/modules/worker/front/descriptor/index.js b/modules/worker/front/descriptor/index.js index c8c2cb5e6..82718a29e 100644 --- a/modules/worker/front/descriptor/index.js +++ b/modules/worker/front/descriptor/index.js @@ -1,7 +1,41 @@ import ngModule from '../module'; +class Controller { + constructor($http, $state) { + this.$state = $state; + this.$http = $http; + } + + get worker() { + return this._worker; + } + + set worker(value) { + this._worker = value; + + if (!value) return; + + this._quicklinks = { + btnOne: { + icon: 'person', + state: `client.card.summary({id: ${value.userFk}})`, + tooltip: 'Go to client' + } + }; + } + + set quicklinks(value = {}) { + this._quicklinks = Object.assign(value, this._quicklinks); + } + + get quicklinks() { + return this._quicklinks; + } +} + ngModule.component('vnWorkerDescriptor', { template: require('./index.html'), + controller: Controller, bindings: { worker: '<' }