Commit b8454e14141fb23a48b41239c2316fb5b370777b

Authored by Eric Fernandez
Exists in master and in 2 other branches develop, lab

Merge branch 'master' into 'develop'

Master(efernandez)

See merge request !23
... ... @@ -69,7 +69,7 @@ gulp.task('clean', function() {
69 69 });
70 70  
71 71 gulp.task('pre-commit', function() {
72   - pump(
  72 + return pump(
73 73 [
74 74 gulp.src([paths.srcJS, paths.specs]),
75 75 jshint('.jshintrc'),
src/js/controller.js
... ... @@ -2,9 +2,9 @@ angular.module('focaAbmChofer')
2 2 .controller('focaAbmChoferesController', [
3 3 '$scope', 'focaAbmChoferService', '$location', '$uibModal',
4 4 'focaModalService', 'focaBotoneraLateralService', '$timeout', '$localStorage',
5   - '$routeParams', '$filter',
  5 + '$routeParams',
6 6 function($scope, focaAbmChoferService, $location, $uibModal, focaModalService,
7   - focaBotoneraLateralService, $timeout, $localStorage, $routeParams, $filter) {
  7 + focaBotoneraLateralService, $timeout, $localStorage, $routeParams) {
8 8  
9 9 $scope.focused = 1;
10 10 $scope.now = new Date();
... ... @@ -45,6 +45,7 @@ angular.module('focaAbmChofer')
45 45 nombre: '',
46 46 telefono: '',
47 47 editando: true,
  48 + desactivado: false
48 49 };
49 50 $scope.choferes.unshift(chofer);
50 51 $scope.crear = false;
... ... @@ -110,7 +111,13 @@ angular.module('focaAbmChofer')
110 111 delete chofer.transportista;
111 112 delete chofer.editando;
112 113 });
113   - focaAbmChoferService.guardarChoferes($scope.choferes);
  114 + focaAbmChoferService
  115 + .guardarChoferes($scope.choferes)
  116 + .then(salir)
  117 + .catch(e => {
  118 + console.error(e);
  119 + focaModalService.alert('Hubo un error al guardar');
  120 + });
114 121 };
115 122  
116 123 $scope.solicitarConfirmacion = function(chofer) {
... ... @@ -194,7 +201,8 @@ angular.module('focaAbmChofer')
194 201 }
195 202 })
196 203 .then(function() {
197   - chofer.idTransportista = focaAbmChoferService.transportistaSeleccionado.COD;
  204 + chofer.idTransportista = focaAbmChoferService
  205 + .transportistaSeleccionado.COD;
198 206 delete chofer.transportista;
199 207 }, function() {
200 208 focaModalService.alert('Dni existente');