refactor
This commit is contained in:
parent
144cb3ee63
commit
26e95bfa56
|
@ -1,31 +0,0 @@
|
||||||
import ngModule from '../module';
|
|
||||||
|
|
||||||
class Controller {
|
|
||||||
constructor($scope, $element) {
|
|
||||||
this.$ = $scope;
|
|
||||||
this.ticket = {};
|
|
||||||
}
|
|
||||||
show() {
|
|
||||||
this.$.dialog.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
hide() {
|
|
||||||
this.$.dialog.hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
onResponse(response) {
|
|
||||||
this.$.ticketCreate.createTicket().then(res => {
|
|
||||||
this.callback({res});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Controller.$inject = ['$scope'];
|
|
||||||
|
|
||||||
ngModule.component('vnTicketCreateDialog', {
|
|
||||||
template: require('./create-dialog.html'),
|
|
||||||
controller: Controller,
|
|
||||||
bindings: {
|
|
||||||
ticket: '<?',
|
|
||||||
callback: '&'
|
|
||||||
}
|
|
||||||
});
|
|
|
@ -111,17 +111,15 @@ class Controller {
|
||||||
showDeleteTicketDialog() {
|
showDeleteTicketDialog() {
|
||||||
this.$.deleteConfirmation.show();
|
this.$.deleteConfirmation.show();
|
||||||
}
|
}
|
||||||
returnDeleteTicketDialog(response) {
|
deleteTicket(response) {
|
||||||
if (response === 'ACCEPT')
|
if (response === 'ACCEPT') {
|
||||||
this.deleteTicket();
|
|
||||||
}
|
|
||||||
deleteTicket() {
|
|
||||||
let params = {id: this.$state.params.id};
|
let params = {id: this.$state.params.id};
|
||||||
this.$http.post(`/ticket/api/Tickets/deleted`, params).then(() => {
|
this.$http.post(`/ticket/api/Tickets/deleted`, params).then(() => {
|
||||||
this.$state.go('ticket.index');
|
this.$state.go('ticket.index');
|
||||||
this.vnApp.showSuccess(this.translate.instant('Ticket deleted'));
|
this.vnApp.showSuccess(this.translate.instant('Ticket deleted'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Remove Lines
|
// Remove Lines
|
||||||
onRemoveLinesClick(response) {
|
onRemoveLinesClick(response) {
|
||||||
if (response === 'ACCEPT') {
|
if (response === 'ACCEPT') {
|
||||||
|
|
Loading…
Reference in New Issue