2018-08-30 06:50:03 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
|
|
|
|
class Controller {
|
2018-09-04 09:49:00 +00:00
|
|
|
constructor($state, $scope) {
|
2018-08-30 06:50:03 +00:00
|
|
|
this.$scope = $scope;
|
2018-09-04 09:49:00 +00:00
|
|
|
this.$state = $state;
|
2018-08-30 06:50:03 +00:00
|
|
|
}
|
|
|
|
|
2018-09-04 09:49:00 +00:00
|
|
|
get ticket() {
|
|
|
|
return this._ticket;
|
2018-08-30 06:50:03 +00:00
|
|
|
}
|
|
|
|
|
2018-09-04 09:49:00 +00:00
|
|
|
set ticket(value) {
|
|
|
|
this._ticket = value;
|
|
|
|
|
|
|
|
if (!value) return;
|
|
|
|
|
|
|
|
this._quicklinks = {
|
|
|
|
btnOne: {
|
|
|
|
icon: 'person',
|
|
|
|
state: `client.card.summary({id: ${value.clientFk}})`,
|
|
|
|
tooltip: 'Client card'
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
set quicklinks(value = {}) {
|
|
|
|
this._quicklinks = Object.assign(value, this._quicklinks);
|
|
|
|
}
|
|
|
|
|
|
|
|
get quicklinks() {
|
|
|
|
return this._quicklinks;
|
|
|
|
}
|
2018-08-30 06:50:03 +00:00
|
|
|
}
|
|
|
|
|
2018-09-04 09:49:00 +00:00
|
|
|
Controller.$inject = ['$state', '$scope'];
|
2018-08-30 06:50:03 +00:00
|
|
|
|
|
|
|
ngModule.component('vnTicketDescriptor', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
bindings: {
|
|
|
|
ticket: '<'
|
|
|
|
},
|
|
|
|
controller: Controller
|
|
|
|
});
|