Tarea #1509 route/ticket/delete ticket
gitea/salix/dev This commit looks good Details

This commit is contained in:
Bernat 2019-06-06 13:50:12 +02:00
parent 7a44a5aab8
commit 217b08cd0a
4 changed files with 17 additions and 6 deletions

View File

@ -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() => {

View File

@ -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>

View File

@ -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
});

View File

@ -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