import ngModule from '../module'; export default class Controller { constructor($scope) { this.$ = $scope; this.ticketSelected = null; } stateColor(claim) { switch (claim.description) { case 'Pendiente': return 'warning'; case 'Gestionado': return 'notice'; case 'Resuelto': return 'success'; } } showClientDescriptor(event, clientFk) { this.$.clientDescriptor.clientFk = clientFk; this.$.clientDescriptor.parent = event.target; this.$.clientDescriptor.show(); event.preventDefault(); event.stopImmediatePropagation(); } showWorkerDescriptor(event, userId) { event.preventDefault(); event.stopImmediatePropagation(); this.selectedWorker = userId; this.$.workerDescriptor.parent = event.target; this.$.workerDescriptor.show(); } preview(event, claim) { this.claimSelected = claim; this.$.dialogSummaryClaim.show(); event.preventDefault(); event.stopImmediatePropagation(); } onDescriptorLoad() { this.$.popover.relocate(); } onSearch(params) { if (params) this.$.model.applyFilter(null, params); else this.$.model.clear(); } } Controller.$inject = ['$scope']; ngModule.component('vnClaimIndex', { template: require('./index.html'), controller: Controller });