added quicklinks to worker descriptor
gitea/salix/dev There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2019-10-21 14:21:52 +02:00
parent 8e1d594a13
commit 58a763acf5
4 changed files with 42 additions and 13 deletions

View File

@ -13,6 +13,10 @@ class Controller {
callback.call(this); callback.call(this);
} }
get client() {
return this._client;
}
set client(value) { set client(value) {
this._client = value; this._client = value;
@ -32,10 +36,6 @@ class Controller {
}; };
} }
get client() {
return this._client;
}
set quicklinks(value = {}) { set quicklinks(value = {}) {
this._quicklinks = Object.assign(value, this._quicklinks); this._quicklinks = Object.assign(value, this._quicklinks);
} }

View File

@ -127,7 +127,7 @@
<vn-td-editable ng-if="sale.id" disabled="!$ctrl.isEditable" number> <vn-td-editable ng-if="sale.id" disabled="!$ctrl.isEditable" number>
<text>{{sale.quantity}}</text> <text>{{sale.quantity}}</text>
<field> <field>
<vn-input-number <vn-input-number class="dense"
vn-focus vn-focus
ng-model="sale.quantity" ng-model="sale.quantity"
on-change="$ctrl.onChangeQuantity(sale)"> on-change="$ctrl.onChangeQuantity(sale)">

View File

@ -34,13 +34,8 @@
value="{{$ctrl.worker.sip.extension}}"> value="{{$ctrl.worker.sip.extension}}">
</vn-label-value> </vn-label-value>
</div> </div>
<div class="quicklinks"> <vn-quick-links
<a links="$ctrl.quicklinks">
ui-sref="client.card.summary({id: $ctrl.worker.userFk})" </vn-quick-links>
vn-tooltip="Go to client"
class="vn-button">
<vn-icon icon="person"></vn-icon>
</a>
</div>
</div> </div>
</div> </div>

View File

@ -1,7 +1,41 @@
import ngModule from '../module'; 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', { ngModule.component('vnWorkerDescriptor', {
template: require('./index.html'), template: require('./index.html'),
controller: Controller,
bindings: { bindings: {
worker: '<' worker: '<'
} }