Commit 059e351254b7ad817ff03f03e20fa548b55f399d
1 parent
6f9ee97e73
Exists in
master
arreglos url, uso factory, fuera inyeccion modulos
Showing
5 changed files
with
4 additions
and
40 deletions
Show diff stats
gulpfile.js
1 | const templateCache = require('gulp-angular-templatecache'); | 1 | const templateCache = require('gulp-angular-templatecache'); |
2 | const concat = require('gulp-concat'); | 2 | const concat = require('gulp-concat'); |
3 | const htmlmin = require('gulp-htmlmin'); | 3 | const htmlmin = require('gulp-htmlmin'); |
4 | const rename = require('gulp-rename'); | 4 | const rename = require('gulp-rename'); |
5 | const uglify = require('gulp-uglify'); | 5 | const uglify = require('gulp-uglify'); |
6 | const gulp = require('gulp'); | 6 | const gulp = require('gulp'); |
7 | const pump = require('pump'); | 7 | const pump = require('pump'); |
8 | const jshint = require('gulp-jshint'); | 8 | const jshint = require('gulp-jshint'); |
9 | const replace = require('gulp-replace'); | 9 | const replace = require('gulp-replace'); |
10 | const connect = require('gulp-connect'); | 10 | const connect = require('gulp-connect'); |
11 | const clean = require('gulp-clean'); | 11 | const clean = require('gulp-clean'); |
12 | 12 | ||
13 | var paths = { | 13 | var paths = { |
14 | srcJS: 'src/js/*.js', | 14 | srcJS: 'src/js/*.js', |
15 | srcViews: 'src/views/*.html', | 15 | srcViews: 'src/views/*.html', |
16 | tmp: 'tmp', | 16 | tmp: 'tmp', |
17 | dist: 'dist/' | 17 | dist: 'dist/' |
18 | }; | 18 | }; |
19 | 19 | ||
20 | gulp.task('clean', function() { | 20 | gulp.task('clean', function() { |
21 | return gulp.src(['tmp', 'dist'], {read: false}) | 21 | return gulp.src(['tmp', 'dist'], {read: false}) |
22 | .pipe(clean()); | 22 | .pipe(clean()); |
23 | }); | 23 | }); |
24 | 24 | ||
25 | gulp.task('templates', ['clean'], function() { | 25 | gulp.task('templates', ['clean'], function() { |
26 | return pump( | 26 | return pump( |
27 | [ | 27 | [ |
28 | gulp.src(paths.srcViews), | 28 | gulp.src(paths.srcViews), |
29 | htmlmin(), | 29 | htmlmin(), |
30 | templateCache('views.js', { | 30 | templateCache('views.js', { |
31 | module: 'focaModalInformeHojaRuta', | 31 | module: 'focaModalInformeHojaRuta', |
32 | root: '' | 32 | root: '' |
33 | }), | 33 | }), |
34 | gulp.dest(paths.tmp) | 34 | gulp.dest(paths.tmp) |
35 | ] | 35 | ] |
36 | ); | 36 | ); |
37 | }); | 37 | }); |
38 | 38 | ||
39 | gulp.task('uglify', ['templates'], function() { | 39 | gulp.task('uglify', ['templates'], function() { |
40 | return pump( | 40 | return pump( |
41 | [ | 41 | [ |
42 | gulp.src([ | 42 | gulp.src([ |
43 | paths.srcJS, | 43 | paths.srcJS, |
44 | 'tmp/views.js' | 44 | 'tmp/views.js' |
45 | ]), | 45 | ]), |
46 | concat('foca-modal-informe-hoja-ruta.js'), | 46 | concat('foca-modal-informe-hoja-ruta.js'), |
47 | replace('src/views/', ''), | 47 | replace('src/views/', ''), |
48 | replace("['ui.bootstrap']", '[]'), | ||
49 | gulp.dest(paths.tmp), | 48 | gulp.dest(paths.tmp), |
50 | rename('foca-modal-informe-hoja-ruta.min.js'), | 49 | rename('foca-modal-informe-hoja-ruta.min.js'), |
51 | uglify(), | 50 | uglify(), |
52 | gulp.dest(paths.dist) | 51 | gulp.dest(paths.dist) |
53 | ] | 52 | ] |
54 | ); | 53 | ); |
55 | }); | 54 | }); |
56 | 55 | ||
57 | gulp.task('pre-commit', function() { | 56 | gulp.task('pre-commit', function() { |
58 | return pump( | 57 | return pump( |
59 | [ | 58 | [ |
60 | gulp.src(paths.srcJS), | 59 | gulp.src(paths.srcJS), |
61 | jshint('.jshintrc'), | 60 | jshint('.jshintrc'), |
62 | jshint.reporter('default'), | 61 | jshint.reporter('default'), |
63 | jshint.reporter('fail') | 62 | jshint.reporter('fail') |
64 | ] | 63 | ] |
65 | ); | 64 | ); |
66 | 65 | ||
67 | gulp.start('uglify'); | 66 | gulp.start('uglify'); |
68 | }); | 67 | }); |
69 | 68 | ||
70 | gulp.task('webserver', function() { | 69 | gulp.task('webserver', function() { |
71 | pump [ | 70 | pump [ |
72 | connect.server({port: 3000}) | 71 | connect.server({port: 3000}) |
73 | ] | 72 | ] |
74 | }); | 73 | }); |
75 | 74 | ||
76 | gulp.task('clean-post-install', function() { | 75 | gulp.task('clean-post-install', function() { |
77 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 76 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
78 | 'index.html'], {read: false}) | 77 | 'index.html'], {read: false}) |
79 | .pipe(clean()); | 78 | .pipe(clean()); |
80 | }); | 79 | }); |
81 | 80 | ||
82 | gulp.task('default', ['webserver']); | 81 | gulp.task('default', ['webserver']); |
83 | 82 | ||
84 | gulp.task('watch', function() { | 83 | gulp.task('watch', function() { |
85 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']) | 84 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']) |
86 | }); | 85 | }); |
87 | 86 | ||
88 | gulp.task('copy', ['uglify'], function() { | 87 | gulp.task('copy', ['uglify'], function() { |
89 | gulp.src('dist/*.js') | 88 | gulp.src('dist/*.js') |
90 | .pipe(gulp.dest('../../wrapper-demo/node_modules/foca-modal-nota-pedido/dist')); | 89 | .pipe(gulp.dest('../../wrapper-demo/node_modules/foca-modal-nota-pedido/dist')); |
91 | }); | 90 | }); |
92 | 91 | ||
93 | gulp.task('watchAndCopy', function() { | 92 | gulp.task('watchAndCopy', function() { |
94 | return gulp.watch([paths.srcJS, paths.srcViews], ['copy']); | 93 | return gulp.watch([paths.srcJS, paths.srcViews], ['copy']); |
95 | }); | 94 | }); |
96 | 95 |
index.html
1 | <html ng-app="focaModalInformeHojaRuta"> | File was deleted | |
2 | <head> | ||
3 | <meta charset="UTF-8"/> | ||
4 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
5 | |||
6 | <!--CSS--> | ||
7 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/> | ||
8 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet"/> | ||
9 | <link href="node_modules/ladda/dist/ladda-themeless.min.css" rel="stylesheet"> | ||
10 | |||
11 | <!--VENDOR JS--> | ||
12 | <script src="node_modules/jquery/dist/jquery.min.js"></script> | ||
13 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> | ||
14 | <script src="node_modules/angular/angular.min.js"></script> | ||
15 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> | ||
16 | <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script> | ||
17 | <script src="node_modules/ladda/dist/spin.min.js"></script> | ||
18 | <script src="node_modules/ladda/dist/ladda.min.js"></script> | ||
19 | <script src="node_modules/angular-ladda/dist/angular-ladda.min.js"></script> | ||
20 | |||
21 | <!-- BUILD --> | ||
22 | <script src="src/js/app.js"></script> | ||
23 | <script src="src/js/controller.js"></script> | ||
24 | <script src="src/js/service.js"></script> | ||
25 | |||
26 | <!-- /BUILD --> | ||
27 | |||
28 | <!-- CONFIG PARA DEVELOP --> | ||
29 | <script src="src/etc/develop.js"></script> | ||
30 | </head> | ||
31 | <body ng-controller="controller"> | ||
32 | </body> | ||
33 | </html> | ||
34 | 1 | <html ng-app="focaModalInformeHojaRuta"> |
package.json
1 | { | 1 | { |
2 | "name": "foca-modal-infrorme-hoja-ruta", | 2 | "name": "foca-modal-informe-hoja-ruta", |
3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
4 | "description": "Modal para generar informes de correlatividad de hojas de ruta", | 4 | "description": "Modal para generar informes de correlatividad de hojas de ruta", |
5 | "scripts": { | 5 | "scripts": { |
6 | "test": "echo \"Error: no test specified\" && exit 1", | 6 | "test": "echo \"Error: no test specified\" && exit 1", |
7 | "gulp-pre-commit": "gulp pre-commit", | 7 | "gulp-pre-commit": "gulp pre-commit", |
8 | "compile": "gulp uglify", | 8 | "compile": "gulp uglify", |
9 | "postinstall": "npm run compile && gulp clean-post-install", | 9 | "postinstall": "npm run compile && gulp clean-post-install", |
10 | "install-dev": "npm install -D angular angular-ladda ladda@1.0.6 bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify gulp-clean jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+http://git.focasoftware.com/npm/foca-directivas.git" | 10 | "install-dev": "npm install -D angular angular-ladda ladda@1.0.6 bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify gulp-clean jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+http://git.focasoftware.com/npm/foca-directivas.git" |
11 | }, | 11 | }, |
12 | "pre-commit": [ | 12 | "pre-commit": [ |
13 | "gulp-pre-commit" | 13 | "gulp-pre-commit" |
14 | ], | 14 | ], |
15 | "repository": { | 15 | "repository": { |
16 | "type": "git", | 16 | "type": "git", |
17 | "url": "https://debo.suite.repo/modulos-npm/foca-modal-infrorme-hoja-ruta" | 17 | "url": "https://debo.suite.repo/modulos-npm/foca-modal-informe-hoja-ruta" |
18 | }, | 18 | }, |
19 | "author": "Nicolás Guarnieri", | 19 | "author": "Nicolás Guarnieri", |
20 | "license": "ISC", | 20 | "license": "ISC", |
21 | "peerDependencies": { | 21 | "peerDependencies": { |
22 | "angular": "^1.7.4", | 22 | "angular": "^1.7.4", |
23 | "bootstrap": "^4.1.3", | 23 | "bootstrap": "^4.1.3", |
24 | "font-awesome": "^4.7.0", | 24 | "font-awesome": "^4.7.0", |
25 | "ui-bootstrap4": "^3.0.4", | 25 | "ui-bootstrap4": "^3.0.4", |
26 | "gulp": "^3.9.1", | 26 | "gulp": "^3.9.1", |
27 | "gulp-angular-templatecache": "^2.2.1", | 27 | "gulp-angular-templatecache": "^2.2.1", |
28 | "gulp-concat": "^2.6.1", | 28 | "gulp-concat": "^2.6.1", |
29 | "gulp-connect": "^5.6.1", | 29 | "gulp-connect": "^5.6.1", |
30 | "gulp-htmlmin": "^5.0.1", | 30 | "gulp-htmlmin": "^5.0.1", |
31 | "gulp-rename": "^1.4.0", | 31 | "gulp-rename": "^1.4.0", |
32 | "gulp-replace": "^1.0.0", | 32 | "gulp-replace": "^1.0.0", |
33 | "gulp-uglify": "^3.0.1", | 33 | "gulp-uglify": "^3.0.1", |
34 | "jquery": "^3.3.1", | 34 | "jquery": "^3.3.1", |
35 | "pump": "^3.0.0", | 35 | "pump": "^3.0.0", |
36 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git" | 36 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git" |
37 | }, | 37 | }, |
38 | "devDependencies": { | 38 | "devDependencies": { |
39 | "angular": "^1.7.5", | 39 | "angular": "^1.7.5", |
40 | "angular-ladda": "^0.4.3", | 40 | "angular-ladda": "^0.4.3", |
41 | "bootstrap": "^4.1.3", | 41 | "bootstrap": "^4.1.3", |
42 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", | 42 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", |
43 | "font-awesome": "^4.7.0", | 43 | "font-awesome": "^4.7.0", |
44 | "gulp": "^3.9.1", | 44 | "gulp": "^3.9.1", |
45 | "gulp-angular-templatecache": "^2.2.3", | 45 | "gulp-angular-templatecache": "^2.2.3", |
46 | "gulp-clean": "^0.4.0", | 46 | "gulp-clean": "^0.4.0", |
47 | "gulp-concat": "^2.6.1", | 47 | "gulp-concat": "^2.6.1", |
48 | "gulp-connect": "^5.6.1", | 48 | "gulp-connect": "^5.6.1", |
49 | "gulp-htmlmin": "^5.0.1", | 49 | "gulp-htmlmin": "^5.0.1", |
50 | "gulp-jshint": "^2.1.0", | 50 | "gulp-jshint": "^2.1.0", |
51 | "gulp-rename": "^1.4.0", | 51 | "gulp-rename": "^1.4.0", |
52 | "gulp-replace": "^1.0.0", | 52 | "gulp-replace": "^1.0.0", |
53 | "gulp-uglify": "^3.0.1", | 53 | "gulp-uglify": "^3.0.1", |
54 | "jasmine-core": "^3.3.0", | 54 | "jasmine-core": "^3.3.0", |
55 | "jquery": "^3.3.1", | 55 | "jquery": "^3.3.1", |
56 | "jshint": "^2.9.6", | 56 | "jshint": "^2.9.6", |
57 | "ladda": "1.0.6", | 57 | "ladda": "1.0.6", |
58 | "pre-commit": "^1.2.2", | 58 | "pre-commit": "^1.2.2", |
59 | "pump": "^3.0.0", | 59 | "pump": "^3.0.0", |
60 | "ui-bootstrap4": "^3.0.5" | 60 | "ui-bootstrap4": "^3.0.5" |
61 | } | 61 | } |
62 | } | 62 | } |
63 | 63 |
src/js/app.js
1 | angular.module('focaModalInformeHojaRuta', [ | 1 | angular.module('focaModalInformeHojaRuta', []); |
2 | 'ui.bootstrap' | ||
3 | ]); | ||
4 | 2 |
src/js/service.js
1 | angular.module('focaModalInformeHojaRuta') | 1 | angular.module('focaModalInformeHojaRuta') |
2 | .service('focaModalInformeHojaRutaService', [ | 2 | .factory('focaModalInformeHojaRutaService', [ |
3 | '$http', | 3 | '$http', |
4 | 'API_ENDPOINT', | 4 | 'API_ENDPOINT', |
5 | function($http, API_ENDPOINT) { | 5 | function($http, API_ENDPOINT) { |
6 | return { | 6 | return { |
7 | getHojasRuta: function(fechaDesde, fechaHasta) { | 7 | getHojasRuta: function(fechaDesde, fechaHasta) { |
8 | return $http.get(API_ENDPOINT.URL + '/hoja-ruta/listar/' + | 8 | return $http.get(API_ENDPOINT.URL + '/hoja-ruta/listar/' + |
9 | fechaDesde + '/' + fechaHasta); | 9 | fechaDesde + '/' + fechaHasta); |
10 | }, | 10 | }, |
11 | getEmpresa: function(id) { | 11 | getEmpresa: function(id) { |
12 | return $http.get(API_ENDPOINT.URL + '/empresa/' + id); | 12 | return $http.get(API_ENDPOINT.URL + '/empresa/' + id); |
13 | } | 13 | } |
14 | }; | 14 | }; |
15 | } | 15 | } |
16 | ]); | 16 | ]); |
17 | 17 |