From 3adc035cab712a30fb4bbc4edc002c2e448cc9cf Mon Sep 17 00:00:00 2001 From: Gerard Date: Mon, 18 Feb 2019 12:54:33 +0100 Subject: [PATCH] #1121 worker.descriptor --- front/core/components/label-value/label-value.js | 15 +++++++++++++++ modules/worker/front/card/index.js | 7 +++++++ modules/worker/front/descriptor/index.html | 11 +++++++---- modules/worker/front/locale/es.yml | 4 ++-- modules/worker/front/summary/index.html | 7 ++++--- modules/worker/front/summary/index.js | 7 +++++++ 6 files changed, 42 insertions(+), 9 deletions(-) diff --git a/front/core/components/label-value/label-value.js b/front/core/components/label-value/label-value.js index ecf3bf4b3..515df45c7 100644 --- a/front/core/components/label-value/label-value.js +++ b/front/core/components/label-value/label-value.js @@ -8,23 +8,37 @@ export default class Controller { this.hasInfo = Boolean($attrs.info); this.info = $attrs.info || null; } + set label(value) { let label = this.element.querySelector('vn-label'); label.textContent = this._.instant(value); this._label = value; } + get label() { return this._label; } + set value(value) { let span = this.element.querySelector('span'); span.title = value; span.textContent = value ? value : '-'; this._value = value; } + get value() { return this._value; } + + get title() { + return this._title; + } + + set title(value) { + let span = this.element.querySelector('span'); + span.title = value; + this._title = value; + } } Controller.$inject = ['$element', '$translate', '$attrs']; @@ -32,6 +46,7 @@ ngModule.component('vnLabelValue', { controller: Controller, template: require('./label-value.html'), bindings: { + title: '@?', label: '@', value: '@' } diff --git a/modules/worker/front/card/index.js b/modules/worker/front/card/index.js index c73c9f8ec..ea1457fc8 100644 --- a/modules/worker/front/card/index.js +++ b/modules/worker/front/card/index.js @@ -25,6 +25,13 @@ class Controller { }, { relation: 'sip', scope: {fields: ['extension']} + }, { + relation: 'department', + scope: { + include: { + relation: 'department' + } + } } ] }; diff --git a/modules/worker/front/descriptor/index.html b/modules/worker/front/descriptor/index.html index 315ad7c9c..696f2a22f 100644 --- a/modules/worker/front/descriptor/index.html +++ b/modules/worker/front/descriptor/index.html @@ -10,12 +10,15 @@
-
{{$ctrl.worker.firstName}} {{$ctrl.worker.name}}
+
+ {{$ctrl.worker.firstName}} {{$ctrl.worker.name}} +
+ value="{{$ctrl.worker.user.name}}" + title="{{$ctrl.worker.firstName}} {{$ctrl.worker.name}}"> @@ -24,13 +27,13 @@ value="{{$ctrl.worker.client.fi}}"> + value="{{$ctrl.worker.department.department.name}}"> + value="{{$ctrl.worker.sip.extension}}">