Commit fa2b9b3092154567d7777015a30c65a855af1fb9

Authored by Jose Pinto
1 parent 51f6ddcb15
Exists in master

Primera version

... ... @@ -0,0 +1,6 @@
  1 +/node_modules
  2 +/dist
  3 +package-lock\.json
  4 +/src/etc/develop.js
  5 +
  6 +tmp/
... ... @@ -0,0 +1,64 @@
  1 +{
  2 + /*
  3 + * ENVIRONMENTS
  4 + * =================
  5 + */
  6 +
  7 + // Define globals exposed by modern browsers.
  8 + "browser": true,
  9 +
  10 + // Define globals exposed by jQuery.
  11 + "jquery": true,
  12 +
  13 + // Define globals exposed by Node.js.
  14 + "node": true,
  15 +
  16 + // Allow ES6.
  17 + "esversion": 6,
  18 +
  19 + /*
  20 + * ENFORCING OPTIONS
  21 + * =================
  22 + */
  23 +
  24 + // Force all variable names to use either camelCase style or UPPER_CASE
  25 + // with underscores.
  26 + "camelcase": true,
  27 +
  28 + // Prohibit use of == and != in favor of === and !==.
  29 + "eqeqeq": true,
  30 +
  31 + // Enforce tab width of 2 spaces.
  32 + "indent": 4,
  33 +
  34 + // Prohibit use of a variable before it is defined.
  35 + "latedef": false,
  36 +
  37 + // Enforce line length to 100 characters
  38 + "maxlen": 100,
  39 +
  40 + // Require capitalized names for constructor functions.
  41 + "newcap": true,
  42 +
  43 + // Enforce use of single quotation marks for strings.
  44 + "quotmark": "single",
  45 +
  46 + // Enforce placing 'use strict' at the top function scope
  47 + "strict": false,
  48 +
  49 + // Prohibit use of explicitly undeclared variables.
  50 + "undef": true,
  51 +
  52 + // Warn when variables are defined but never used.
  53 + "unused": true,
  54 +
  55 + // Para que funcione en angular
  56 + "predef": ["angular", "alert", "spyOn", "expect", "it", "inject", "beforeEach", "describe"],
  57 + /*
  58 + * RELAXING OPTIONS
  59 + * =================
  60 + */
  61 +
  62 + // Suppress warnings about == null comparisons.
  63 + "eqnull": true
  64 +}
... ... @@ -0,0 +1,94 @@
  1 +const templateCache = require('gulp-angular-templatecache');
  2 +const clean = require('gulp-clean');
  3 +const concat = require('gulp-concat');
  4 +const htmlmin = require('gulp-htmlmin');
  5 +const rename = require('gulp-rename');
  6 +const uglify = require('gulp-uglify');
  7 +const gulp = require('gulp');
  8 +const pump = require('pump');
  9 +const jshint = require('gulp-jshint');
  10 +const replace = require('gulp-replace');
  11 +const connect = require('gulp-connect');
  12 +
  13 +var paths = {
  14 + srcJS: 'src/js/*.js',
  15 + srcViews: 'src/views/*.html',
  16 + tmp: 'tmp',
  17 + dist: 'dist/'
  18 +};
  19 +
  20 +gulp.task('templates', ['clean'], function() {
  21 + return pump(
  22 + [
  23 + gulp.src(paths.srcViews),
  24 + htmlmin(),
  25 + templateCache('views.js', {
  26 + module: 'focaInformes',
  27 + root: ''
  28 + }),
  29 + gulp.dest(paths.tmp)
  30 + ]
  31 + );
  32 +});
  33 +
  34 +gulp.task('uglify', ['templates'], function() {
  35 + return pump(
  36 + [
  37 + gulp.src([
  38 + paths.srcJS,
  39 + 'tmp/views.js'
  40 + ]),
  41 + concat('foca-informes.js'),
  42 + replace('src/views/', ''),
  43 + gulp.dest(paths.tmp),
  44 + rename('foca-informes.min.js'),
  45 + uglify(),
  46 + gulp.dest(paths.dist)
  47 + ]
  48 + );
  49 +});
  50 +
  51 +gulp.task('clean', function() {
  52 + return gulp.src(['tmp', 'dist'], {read: false})
  53 + .pipe(clean());
  54 +});
  55 +
  56 +gulp.task('pre-commit', function() {
  57 + return pump(
  58 + [
  59 + gulp.src(paths.srcJS),
  60 + jshint('.jshintrc'),
  61 + jshint.reporter('default'),
  62 + jshint.reporter('fail')
  63 + ]
  64 + );
  65 +
  66 + gulp.start('uglify');
  67 +});
  68 +
  69 +gulp.task('webserver', function() {
  70 + pump [
  71 + connect.server({port: 3300, host: '0.0.0.0'})
  72 + ]
  73 +});
  74 +
  75 +gulp.task('clean-post-install', function() {
  76 + return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js',
  77 + 'index.html'], {read: false})
  78 + .pipe(clean());
  79 +});
  80 +
  81 +gulp.task('default', ['webserver']);
  82 +
  83 +gulp.task('watch', function() {
  84 + gulp.watch([paths.srcJS, paths.srcViews], ['uglify']);
  85 +});
  86 +
  87 +gulp.task('copy', ['uglify'], function() {
  88 + return gulp.src('dist/*.js')
  89 + .pipe(gulp.dest('../../wrapper-demo/node_modules/foca-crear-nota-pedido/dist/'));
  90 +});
  91 +
  92 +gulp.task('watchAndCopy', function() {
  93 + return gulp.watch([paths.srcJS], ['copy']);
  94 +});
... ... @@ -0,0 +1,48 @@
  1 +{
  2 + "name": "foca-informes",
  3 + "version": "0.0.1",
  4 + "description": "Botonera para generar distintos informes",
  5 + "main": "index.js",
  6 + "scripts": {
  7 + "test": "echo \"Error: no test specified\" && exit 1",
  8 + "compile": "gulp uglify",
  9 + "gulp-pre-commit": "gulp pre-commit",
  10 + "postinstall": "npm run compile && gulp clean-post-install",
  11 + "install-dev": "npm install -D jasmine-core pre-commit angular angular-ladda ladda@1.0.6 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 gulp-uglify jquery jshint pump git+http://git.focasoftware.com/npm/foca-directivas.git git+http://git.focasoftware.com/npm/foca-modal-vendedores.git git+http://git.focasoftware.com/npm/foca-modal-proveedor.git git+http://git.focasoftware.com/npm/foca-modal-busqueda-productos.git git+http://git.focasoftware.com/npm/foca-busqueda-cliente.git git+http://git.focasoftware.com/npm/foca-modal-precio-condiciones.git git+http://git.focasoftware.com/npm/foca-modal-flete.git git+http://git.focasoftware.com/npm/foca-modal.git git+http://git.focasoftware.com/npm/foca-modal-domicilio.git git+http://git.focasoftware.com/npm/foca-seguimiento.git git+http://git.focasoftware.com/npm/foca-modal-moneda.git git+http://git.focasoftware.com/npm/foca-modal-cotizacion.git"
  12 + },
  13 + "pre-commit": [
  14 + "gulp-pre-commit"
  15 + ],
  16 + "repository": {
  17 + "type": "git",
  18 + "url": "https://debo.suite.repo/modulos-npm/foca-informes.git"
  19 + },
  20 + "author": "Foca Software",
  21 + "license": "ISC",
  22 + "devDependencies": {
  23 + "angular": "^1.7.5",
  24 + "angular-ladda": "^0.4.3",
  25 + "angular-route": "^1.7.5",
  26 + "bootstrap": "^4.1.3",
  27 + "font-awesome": "^4.7.0",
  28 + "gulp": "^3.9.1",
  29 + "gulp-angular-templatecache": "^2.2.5",
  30 + "gulp-clean": "^0.4.0",
  31 + "gulp-concat": "^2.6.1",
  32 + "gulp-connect": "^5.6.1",
  33 + "gulp-htmlmin": "^5.0.1",
  34 + "gulp-jshint": "^2.1.0",
  35 + "gulp-rename": "^1.4.0",
  36 + "gulp-replace": "^1.0.0",
  37 + "gulp-sequence": "^1.0.0",
  38 + "gulp-uglify": "^3.0.1",
  39 + "gulp-uglify-es": "^1.0.4",
  40 + "jasmine-core": "^3.3.0",
  41 + "jquery": "^3.3.1",
  42 + "jshint": "^2.9.6",
  43 + "ladda": "1.0.6",
  44 + "pre-commit": "^1.2.2",
  45 + "pump": "^3.0.0",
  46 + "ui-bootstrap4": "^3.0.5"
  47 + }
  48 +}
src/etc/develop.js.ejemplo
... ... @@ -0,0 +1,4 @@
  1 +angular.module('focaInformes')
  2 + .constant("API_ENDPOINT", {
  3 + 'URL': '//127.0.0.1:9000'
  4 + });
... ... @@ -0,0 +1 @@
  1 +angular.module('focaInformes', []);
src/js/controller.js
... ... @@ -0,0 +1,29 @@
  1 +angular.module('focaInformes')
  2 + .controller('focaInformesController',
  3 + [
  4 + '$scope',
  5 + 'focaInformesService',
  6 + 'focaBotoneraLateralService',
  7 + '$uibModal',
  8 + function($scope, focaInformesService, focaBotoneraLateralService, $uibModal)
  9 + {
  10 + $scope.now = new Date();
  11 + $scope.botonera = focaInformesService.getBotonera();
  12 +
  13 + //SETEO BOTONERA LATERAL
  14 + focaBotoneraLateralService.showSalir(true);
  15 + focaBotoneraLateralService.showPausar(false);
  16 + focaBotoneraLateralService.showGuardar(false);
  17 +
  18 + $scope.seleccionarHojasDeRuta = function() {
  19 + $uibModal.open(
  20 + {
  21 + ariaLabelledBy: 'Informes de hojas de ruta',
  22 + templateUrl: 'modal-informe-hoja-ruta.html',
  23 + controller: 'focaModalInformeHojaRutaController',
  24 + size: 'lg'
  25 + }
  26 + );
  27 + };
  28 + }
  29 + ]);
... ... @@ -0,0 +1,7 @@
  1 +angular.module('focaInformes')
  2 + .config(['$routeProvider', function($routeProvider) {
  3 + $routeProvider.when('/informes', {
  4 + controller: 'focaInformesController',
  5 + templateUrl: 'src/views/informes.html'
  6 + });
  7 + }]);
... ... @@ -0,0 +1,14 @@
  1 +angular.module('focaInformes')
  2 + .factory('focaInformesService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) {
  3 + return {
  4 + getBotonera: function() {
  5 + var result = [
  6 + {
  7 + label: 'Hojas de ruta',
  8 + image: 'cliente.png'
  9 + }
  10 + ];
  11 + return result;
  12 + }
  13 + };
  14 + }]);
src/views/informes.html
... ... @@ -0,0 +1,18 @@
  1 +<div class="crear-nota-pedido foca-crear row">
  2 + <foca-cabecera-facturador
  3 + titulo="'Informes'"
  4 + fecha="now"
  5 + class="mb-0 col-lg-12"
  6 + ></foca-cabecera-facturador>
  7 + <div class="col-lg-12">
  8 + <div class="row">
  9 + <div class="col-12 col-md-10 col-lg-10 mt-4 border border-light rounded">
  10 + <div class="row py-2 botonera-secundaria">
  11 + <div class="col-12 foca-facturador-px">
  12 + <foca-botonera-facturador botones="botonera" max="6" class="row"></foca-botonera-facturador>
  13 + </div>
  14 + </div>
  15 + </div>
  16 + </div>
  17 + </div>
  18 +</div>