From 2e1c1db0c9f667fb5e2ae3c91291c043cc2d7b17 Mon Sep 17 00:00:00 2001 From: Pablo Marco del Pont Date: Wed, 17 Oct 2018 14:14:36 -0300 Subject: [PATCH] =?UTF-8?q?-=20Correcciones=20para=20que=20funcione=20el?= =?UTF-8?q?=20m=C3=B3dulo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 12 +++++++++--- package.json | 41 +++++++++++++++++++++-------------------- src/js/app.js | 13 ++++++------- src/js/controller.js | 12 ++++++++++-- src/js/service.js | 2 +- 5 files changed, 47 insertions(+), 33 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 07757ae..cd9bf30 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,4 +1,5 @@ const templateCache = require('gulp-angular-templatecache'); +const clean = require('gulp-clean'); const concat = require('gulp-concat'); const htmlmin = require('gulp-htmlmin'); const rename = require('gulp-rename'); @@ -16,11 +17,10 @@ var paths = { dist: 'dist/' }; -gulp.task('templates', function() { +gulp.task('templates', ['clean'], function() { return pump( [ gulp.src(paths.srcViews), - replace('views/', ''), htmlmin(), templateCache('views.js', { module: 'focaCrearNotaPedido', @@ -39,6 +39,7 @@ gulp.task('uglify', ['templates'], function() { 'tmp/views.js' ]), concat('foca-crear-nota-pedido.js'), + replace('src/views/', ''), gulp.dest(paths.tmp), rename('foca-crear-nota-pedido.min.js'), uglify(), @@ -47,6 +48,11 @@ gulp.task('uglify', ['templates'], function() { ); }); +gulp.task('clean', function(){ + return gulp.src(['tmp', 'dist'], {read: false}) + .pipe(clean()); +}); + gulp.task('pre-commit', function() { return pump( [ @@ -66,4 +72,4 @@ gulp.task('webserver', function() { ] }); -gulp.task('default', ['webserver']); \ No newline at end of file +gulp.task('default', ['webserver']); diff --git a/package.json b/package.json index 9698d2a..88e11c8 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,9 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "compile": "gulp uglify", - "postinstall": "npm run compile && rm -R src && rm index.html && rm .jshintrc && rm gulpfile.js" + "compile": "gulp uglify", + "postinstall": "npm run compile && rm -R src && rm index.html && rm .jshintrc && rm gulpfile.js", + "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es jquery jshint pump" }, "repository": { "type": "git", @@ -15,33 +16,33 @@ "author": "Foca Software", "license": "ISC", "dependencies": { - "angular": "^1.7.x", - "angular-route": "^1.7.4", - "bootstrap": "^4.1.x", "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas.git", "foca-modal-busqueda-productos": "git+https://192.168.0.11/nguarnieri/foca-modal-busqueda-productos", "foca-modal-petroleras": "git+https://192.168.0.11/modulos-npm/foca-modal-petroleras.git", "foca-modal-vendedores": "git+https://192.168.0.11/modulos-npm/foca-modal-vendedores.git", - "font-awesome": "^4.7.x", - "gulp": "^3.9.x", - "gulp-angular-templatecache": "^2.2.1", - "gulp-clean": "^0.4.0", - "gulp-concat": "2.6.x", - "gulp-jshint": "^2.1.x", - "gulp-rename": "^1.4.x", - "gulp-replace": "^1.0.x", - "gulp-uglify-es": "^1.0.x", - "jquery": "^3.3.x", - "jshint": "^2.9.x", - "pump": "^3.0.x", - "ui-bootstrap4": "^3.0.5" + "jquery": "^3.3.x" }, "devDependencies": { + "angular": "^1.7.5", + "angular-route": "^1.7.5", + "bootstrap": "^4.1.3", "foca-busqueda-cliente": "git+https://192.168.0.11/modulos-npm/foca-busqueda-cliente", + "font-awesome": "^4.7.0", + "gulp": "^3.9.1", + "gulp-angular-templatecache": "^2.2.2", + "gulp-clean": "^0.4.0", + "gulp-concat": "^2.6.1", "gulp-connect": "^5.6.1", "gulp-htmlmin": "^5.0.1", + "gulp-jshint": "^2.1.0", + "gulp-rename": "^1.4.0", + "gulp-replace": "^1.0.0", "gulp-uglify": "^3.0.1", - "jasmine-core": "3.2.1", - "pre-commit": "^1.2.2" + "gulp-uglify-es": "^1.0.4", + "jasmine-core": "^3.2.1", + "jshint": "^2.9.6", + "pre-commit": "^1.2.2", + "pump": "^3.0.0", + "ui-bootstrap4": "^3.0.5" } } diff --git a/src/js/app.js b/src/js/app.js index 5a59fd2..da01dc8 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1,9 +1,8 @@ angular.module('focaCrearNotaPedido', [ - 'ngRoute', - 'ui.bootstrap', - 'focaModalVendedores', - 'focaBusquedaProductos', - 'focaModalPetroleras', - 'focaBusquedaCliente' + 'ngRoute', + 'ui.bootstrap', + 'focaModalVendedores', + 'focaBusquedaProductos', + 'focaModalPetroleras', + 'focaBusquedaCliente' ]); - \ No newline at end of file diff --git a/src/js/controller.js b/src/js/controller.js index 45fe208..0d011f6 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -48,7 +48,11 @@ angular.module('focaCrearNotaPedido') } $scope.removeNewChoice = function(choice) { if ($scope.notaPedido.domicilio.length > 1) { - $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex(c => c.$$hashKey == choice.$$hashKey), 1) + $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex( + function(c) { + return c.$$hashKey == choice.$$hashKey; + } + ), 1) } } $scope.crearNotaPedido = function() { @@ -180,7 +184,11 @@ angular.module('focaCrearNotaPedido') } $scope.getSubTotal = function(item) { var subTotal = 0; - var array = $scope.articulosTabla.filter(a => a.item <= item); + var array = $scope.articulosTabla.filter( + function(a) { + return a.item <= item; + } + ); for (var i = 0; i < array.length; i++) { subTotal += array[i].precio * array[i].cantidad } diff --git a/src/js/service.js b/src/js/service.js index 810e692..57755d7 100644 --- a/src/js/service.js +++ b/src/js/service.js @@ -22,7 +22,7 @@ angular.module('focaCrearNotaPedido') return $http.get(route+'/articulos/nota-pedido/'+id); }, crearArticulosParaNotaPedido: function(articuloNotaPedido) { - return $http.post(route + '/articulos/nota-pedido', {articuloNotaPedido}); + return $http.post(route + '/articulos/nota-pedido', {articuloNotaPedido: articuloNotaPedido}); }, getDomiciliosByIdNotaPedido: function(id) { return $http.get(route +'/nota-pedido/'+id+'/domicilios'); -- 1.9.1