This commit is contained in:
parent
7a44a5aab8
commit
217b08cd0a
|
@ -108,7 +108,7 @@ describe('Route basic Data path', () => {
|
|||
.waitToClick(selectors.routeTickets.confirmButton)
|
||||
.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Ticket deleted from route');
|
||||
expect(result).toEqual('Ticket removed from route');
|
||||
});
|
||||
|
||||
it('should now count how many tickets are in route to find one less', async() => {
|
||||
|
|
|
@ -110,5 +110,5 @@
|
|||
<vn-confirm
|
||||
vn-id="confirm"
|
||||
question="Delete ticket from route?"
|
||||
on-response="$ctrl.deleteFromRoute(response)">
|
||||
on-response="$ctrl.removeTicketFromRoute(response)">
|
||||
</vn-confirm>
|
|
@ -69,17 +69,25 @@ class Controller {
|
|||
this.$.confirm.show();
|
||||
}
|
||||
|
||||
deleteFromRoute(response) {
|
||||
removeTicketFromRoute(response) {
|
||||
if (response === 'ACCEPT') {
|
||||
let params = {routeFk: null};
|
||||
let query = `/api/Tickets/${this.selectedTicket}/`;
|
||||
this.$http.patch(query, params).then(() => {
|
||||
this.vnApp.showSuccess(this.$translate.instant('Ticket deleted from route'));
|
||||
this.$.model.refresh();
|
||||
this.vnApp.showSuccess(this.$translate.instant('Ticket removed from route'));
|
||||
this.updateVolume();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
updateVolume() {
|
||||
let url = `/route/api/Routes/${this.$stateParams.id}/updateVolume`;
|
||||
this.$http.post(url).then(() => {
|
||||
this.card.reload();
|
||||
this.$.model.refresh();
|
||||
});
|
||||
}
|
||||
|
||||
guessPriority() {
|
||||
let query = `/api/Routes/${this.$stateParams.id}/guessPriority/`;
|
||||
this.$http.get(query).then(() => {
|
||||
|
@ -107,5 +115,8 @@ Controller.$inject = ['$stateParams', '$scope', '$translate', '$http', 'vnApp'];
|
|||
|
||||
ngModule.component('vnRouteTickets', {
|
||||
template: require('./index.html'),
|
||||
require: {
|
||||
card: '^vnRouteCard'
|
||||
},
|
||||
controller: Controller
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Remove ticket: Borrar ticket
|
||||
Open buscaman: Abrir buscaman
|
||||
Ticket deleted from route: Ticket borrado de la ruta
|
||||
Ticket removed from route: Ticket borrado de la ruta
|
||||
Order changed: Orden cambiado
|
||||
Delete ticket from route?: ¿Borrar ticket de la ruta?
|
||||
Sort routes: Ordenar rutas
|
Loading…
Reference in New Issue