2019-01-28 15:24:45 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
|
2019-10-21 12:21:52 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-05 06:19:16 +00:00
|
|
|
Controller.$inject = ['$http', '$state'];
|
|
|
|
|
|
|
|
|
2019-01-28 15:24:45 +00:00
|
|
|
ngModule.component('vnWorkerDescriptor', {
|
|
|
|
template: require('./index.html'),
|
2019-10-21 12:21:52 +00:00
|
|
|
controller: Controller,
|
2019-01-28 15:24:45 +00:00
|
|
|
bindings: {
|
|
|
|
worker: '<'
|
|
|
|
}
|
|
|
|
});
|