diff --git a/.gitignore b/.gitignore index 7d22e37..31a0ef5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /dist /tmp package-lock\.json +/src/etc/develop.js diff --git a/gulpfile.js b/gulpfile.js index b0c8268..e058d7a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,21 +1,22 @@ -const templateCache = require('gulp-angular-templatecache'); -const concat = require('gulp-concat'); const clean = require('gulp-clean'); +const concat = require('gulp-concat'); +const connect = require('gulp-connect'); +const gulp = require('gulp'); const htmlmin = require('gulp-htmlmin'); +const jshint = require('gulp-jshint'); +const pump = require('pump'); const rename = require('gulp-rename'); +const templateCache = require('gulp-angular-templatecache'); const uglify = require('gulp-uglify-es').default; -const gulp = require('gulp'); -const pump = require('pump'); -const jshint = require('gulp-jshint'); var paths = { + dist: 'dist/', srcJS: 'src/js/*.js', srcViews: 'src/views/*.html', - tmp: 'tmp', - dist: 'dist/' + tmp: 'tmp' }; -gulp.task('templates', function() { +gulp.task('templates', ['clean'], function() { return pump( [ gulp.src(paths.srcViews), @@ -37,6 +38,8 @@ gulp.task('uglify', ['templates'], function() { 'tmp/views.js' ]), concat('foca-abm-plazo-pago.js'), + replace('src/views/', ''), + replace("['ngRoute', 'ui.bootstrap']", '[]'), gulp.dest(paths.tmp), rename('foca-abm-plazo-pago.min.js'), uglify(), @@ -60,3 +63,18 @@ gulp.task('pre-commit', function() { ] ); }); + +gulp.task('clean-post-install', function() { + return gulp.src([ + 'src', 'tmp', '.jshintrc', 'readme.md', '.gitignore', 'gulpfile.js', 'index.html' + ], {read: false}) + .pipe(clean()); +}); + +gulp.task('webserver', function() { + pump [ + connect.server({port: 3000}) + ] +}); + +gulp.task('default', ['webserver']); diff --git a/index.html b/index.html index e69de29..357c19a 100644 --- a/index.html +++ b/index.html @@ -0,0 +1,28 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/package.json b/package.json index c7505ee..26538a8 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,13 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "compile": "gulp uglify", - "pre-commit": [ - "gulp-pre-commit" - ], - "postinstall": "npm run compile && rm -R src && rm index.html && rm .jshintrc && rm gulpfile.js" + "gulp-pre-commit": "gulp pre-commit", + "postinstall": "npm run compile && gulp clean-post-install", + "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" }, + "pre-commit": [ + "gulp-pre-commit" + ], "repository": { "type": "git", "url": "https://192.168.0.11/modulos-npm/foca-abm-plazo-pago.git" @@ -32,24 +34,25 @@ "pump": "^3.0.x" }, "devDependencies": { + "angular": "^1.7.5", + "angular-route": "^1.7.5", + "bootstrap": "^4.1.3", + "font-awesome": "^4.7.0", + "gulp": "^3.9.1", + "gulp-angular-templatecache": "^2.2.2", + "gulp-clean": "^0.4.0", "gulp-connect": "^5.6.1", - "jasmine-core": "3.2.1", - "pre-commit": "^1.2.2" - }, - "dependencies": { - "angular": "1.7.4", - "bootstrap": "4.1.3", - "font-awesome": "4.7.0", - "gulp-angular-templatecache": "2.2.1", - "gulp-clean": "0.4.0", - "gulp-htmlmin": "5.0.1", - "gulp-jshint": "2.1.0", - "gulp-rename": "1.4.0", - "gulp-replace": "1.0.0", - "gulp-sequence": "1.0.0", - "gulp-uglify-es": "1.0.4", - "jquery": "3.3.1", - "jshint": "2.9.6", - "pump": "3.0.0" + "gulp-htmlmin": "^5.0.1", + "gulp-jshint": "^2.1.0", + "gulp-rename": "^1.4.0", + "gulp-replace": "^1.0.0", + "gulp-sequence": "^1.0.0", + "gulp-uglify-es": "^1.0.4", + "jasmine-core": "^3.2.1", + "jquery": "^3.3.1", + "jshint": "^2.9.6", + "pre-commit": "^1.2.2", + "pump": "^3.0.0", + "ui-bootstrap4": "^3.0.5" } } diff --git a/src/etc/develop.ejemplo.js b/src/etc/develop.ejemplo.js new file mode 100644 index 0000000..f31587e --- /dev/null +++ b/src/etc/develop.ejemplo.js @@ -0,0 +1,4 @@ +angular.module('focaAbmPlazoPago') + .constant("API_ENDPOINT", { + 'URL': '//127.0.0.1:9000' + }); diff --git a/src/js/app.js b/src/js/app.js index 449e551..a03af5e 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1 +1 @@ -angular.module('focaAbmPlazoPago', []); +angular.module('focaAbmPlazoPago', ['ngRoute', 'ui.bootstrap']); diff --git a/src/js/controller.js b/src/js/controller.js index b893619..9da1224 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -5,8 +5,8 @@ angular.module('focaAbmPlazoPago') focaAbmPlazoPagoService.obtenerPlazosPago().then(function(datos) { $scope.plazosPago = datos.data; }); - $scope.editar = function(id) { - $location.path('/plazo-pago/' + id); + $scope.editar = function(idPreciosCondiciones, id) { + $location.path('/precio-condicion/' + idPreciosCondiciones + '/plazo-pago/' + id); }; $scope.solicitarConfirmacion = function(plazoPago) { $uibModal.open({ diff --git a/src/js/route.js b/src/js/route.js index b48b52d..beea4d3 100644 --- a/src/js/route.js +++ b/src/js/route.js @@ -4,7 +4,7 @@ angular.module('focaAbmPlazoPago') function($routeProvider) { $routeProvider.when('/plazo-pago', { controller: 'focaAbmPlazosPagoController', - templateUrl: 'foca-abm-plazos-pago-listado.html' + templateUrl: 'src/views/foca-abm-plazos-pago-listado.html' }); } ]) @@ -13,7 +13,7 @@ angular.module('focaAbmPlazoPago') function($routeProvider) { $routeProvider.when('/precio-condicion/:idPreciosCondiciones/plazo-pago/:id', { controller: 'focaAbmPlazoPagoController', - templateUrl: 'foca-abm-plazos-pago-item.html' + templateUrl: 'src/views/foca-abm-plazos-pago-item.html' }); } ]); diff --git a/src/views/foca-abm-plazos-pago-listado.html b/src/views/foca-abm-plazos-pago-listado.html index 5157c8c..f46ee71 100644 --- a/src/views/foca-abm-plazos-pago-listado.html +++ b/src/views/foca-abm-plazos-pago-listado.html @@ -3,7 +3,7 @@