Commit c8733ea3c8d335c37460a776e6ef8b19936b0b67

Authored by Luigi
1 parent 4068c63189
Exists in master

inicial

... ... @@ -0,0 +1,5 @@
  1 +/node_modules
  2 +/dist
  3 +/tmp
  4 +package-lock\.json
  5 +src/etc/develop.js
... ... @@ -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,102 @@
  1 +const templateCache = require('gulp-angular-templatecache');
  2 +const concat = require('gulp-concat');
  3 +const htmlmin = require('gulp-htmlmin');
  4 +const rename = require('gulp-rename');
  5 +const uglify = require('gulp-uglify-es').default;
  6 +const gulp = require('gulp');
  7 +const pump = require('pump');
  8 +const jshint = require('gulp-jshint');
  9 +const replace = require('gulp-replace');
  10 +const connect = require('gulp-connect');
  11 +const clean = require('gulp-clean');
  12 +const header = require('gulp-header');
  13 +const footer =require('gulp-footer');
  14 +
  15 +var paths = {
  16 + srcJS: 'src/js/*.js',
  17 + srcViews: 'src/views/*.html',
  18 + specs: 'spec/*.js',
  19 + tmp: 'tmp',
  20 + dist: 'dist/'
  21 +};
  22 +
  23 +gulp.task('templates', function() {
  24 + return pump(
  25 + [
  26 + gulp.src(paths.srcViews),
  27 + replace('views/', ''),
  28 + htmlmin(),
  29 + templateCache('views.js', {
  30 + module: 'focaAbmCliente',
  31 + root: ''
  32 + }),
  33 + gulp.dest(paths.tmp)
  34 + ]
  35 + );
  36 +});
  37 +
  38 +gulp.task('uglify', ['templates', 'uglify-spec'], function() {
  39 + return pump(
  40 + [
  41 + gulp.src([
  42 + paths.srcJS,
  43 + 'tmp/views.js'
  44 + ]),
  45 + concat('foca-abm-cliente.js'),
  46 + replace("src/views/", ''),
  47 + gulp.dest(paths.tmp),
  48 + rename('foca-abm-cliente.min.js'),
  49 + uglify(),
  50 + gulp.dest(paths.dist)
  51 + ]
  52 + );
  53 +});
  54 +
  55 +gulp.task('uglify-spec', function() {
  56 + return pump([
  57 + gulp.src(paths.specs),
  58 + concat('foca-abm-cliente.spec.js'),
  59 + replace("src/views/", ''),
  60 + header("describe('Mรณdulo foca-abm-cliente', function() { \n"),
  61 + footer("});"),
  62 + gulp.dest(paths.dist)
  63 + ]);
  64 +});
  65 +
  66 +gulp.task('clean', function() {
  67 + return gulp.src(['tmp', 'dist'], {read: false})
  68 + .pipe(clean());
  69 +});
  70 +
  71 +gulp.task('pre-commit', function() {
  72 + pump(
  73 + [
  74 + gulp.src([paths.srcJS, paths.specs]),
  75 + jshint('.jshintrc'),
  76 + jshint.reporter('default'),
  77 + jshint.reporter('fail')
  78 + ]
  79 + );
  80 +
  81 + gulp.start('uglify');
  82 +});
  83 +
  84 +gulp.task('clean-post-install', function() {
  85 + return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js',
  86 + 'index.html', 'spec', 'test.html'], {read: false})
  87 + .pipe(clean());
  88 +});
  89 +
  90 +gulp.task('compile', ['templates', 'uglify']);
  91 +
  92 +gulp.task('watch', function() {
  93 + gulp.watch([paths.srcJS, paths.srcViews], ['uglify']);
  94 +});
  95 +
  96 +gulp.task('webserver', function() {
  97 + pump [
  98 + connect.server({port: 3000})
  99 + ]
  100 +});
  101 +
  102 +gulp.task('default', ['webserver']);
... ... @@ -0,0 +1,63 @@
  1 +{
  2 + "name": "foca-abm-cliente",
  3 + "version": "0.0.1",
  4 + "description": "Abm de cliente",
  5 + "main": "index.html",
  6 + "scripts": {
  7 + "test": "test.html",
  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 angular bootstrap ui-bootstrap4 font-awesome jquery gulp gulp-connect jasmine-core pre-commit gulp-angular-templatecache gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify-es gulp-uglify gulp-clean jshint pump git+http://git.focasoftware.com/npm/foca-modal.git"
  12 + },
  13 + "pre-commit": [
  14 + "gulp-pre-commit"
  15 + ],
  16 + "repository": {
  17 + "type": "git",
  18 + "url": "http://git.focasoftware.com/npm/foca-abm-cliente.git"
  19 + },
  20 + "author": "Foca Software",
  21 + "license": "ISC",
  22 + "peerDependencies": {
  23 + "angular": "^1.7.x",
  24 + "angular-route": "^1.7.x",
  25 + "bootstrap": "^4.1.x",
  26 + "jquery": "^3.3.x",
  27 + "font-awesome": "^4.7.x",
  28 + "gulp": "^3.9.x",
  29 + "gulp-concat": "2.6.x",
  30 + "gulp-jshint": "^2.1.x",
  31 + "gulp-rename": "^1.4.x",
  32 + "gulp-replace": "^1.0.x",
  33 + "gulp-uglify-es": "^1.0.x",
  34 + "jshint": "^2.9.x",
  35 + "pump": "^3.0.x"
  36 + },
  37 + "devDependencies": {
  38 + "angular": "^1.7.8",
  39 + "angular-mocks": "^1.7.8",
  40 + "angular-route": "^1.7.8",
  41 + "bootstrap": "^4.2.1",
  42 + "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git",
  43 + "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git",
  44 + "font-awesome": "^4.7.0",
  45 + "gulp": "^3.9.1",
  46 + "gulp-angular-templatecache": "^2.2.7",
  47 + "gulp-clean": "^0.4.0",
  48 + "gulp-connect": "^5.7.0",
  49 + "gulp-header": "^2.0.7",
  50 + "gulp-htmlmin": "^5.0.1",
  51 + "gulp-jshint": "^2.1.0",
  52 + "gulp-rename": "^1.4.0",
  53 + "gulp-replace": "^1.0.0",
  54 + "gulp-uglify": "^3.0.1",
  55 + "gulp-uglify-es": "^1.0.4",
  56 + "jasmine-core": "^3.4.0",
  57 + "jquery": "^3.4.1",
  58 + "jshint": "^2.10.2",
  59 + "pre-commit": "^1.2.2",
  60 + "pump": "^3.0.0",
  61 + "ui-bootstrap4": "^3.0.6"
  62 + }
  63 +}
src/etc/develop.js.ejemplo
... ... @@ -0,0 +1,4 @@
  1 +angular.module('focaAbmCliente')
  2 + .constant("API_ENDPOINT", {
  3 + 'URL': '//127.0.0.1:9000'
  4 + });
... ... @@ -0,0 +1 @@
  1 +angular.module('focaAbmCliente', ['ngRoute']);
src/js/controller.js
... ... @@ -0,0 +1,18 @@
  1 +angular.module('focaAbmCliente')
  2 + .controller('focaAbmClienteController', [
  3 + '$scope', 'focaAbmClienteService', '$location', '$uibModal',
  4 + 'focaModalService', 'focaBotoneraLateralService', '$timeout', '$localStorage',
  5 + '$routeParams', '$filter',
  6 + function($scope, focaAbmClienteService, $location, $uibModal, focaModalService,
  7 + focaBotoneraLateralService, $timeout, $localStorage, $routeParams, $filter) {
  8 +
  9 + //SETEO BOTONERA LATERAL
  10 + $timeout(function() {
  11 + focaBotoneraLateralService.showSalir(false);
  12 + focaBotoneraLateralService.showPausar(false);
  13 + focaBotoneraLateralService.showCancelar(false);
  14 + focaBotoneraLateralService.showGuardar(true);
  15 + });
  16 +
  17 + }
  18 + ]);
... ... @@ -0,0 +1,11 @@
  1 +angular.module('focaAbmCliente')
  2 + .config([
  3 + '$routeProvider',
  4 + function($routeProvider) {
  5 + $routeProvider.when('/cliente', {
  6 + controller: 'focaAbmClienteController',
  7 + templateUrl: 'src/views/foca-abm-cliente.html'
  8 + });
  9 + }
  10 + ]);
  11 +
0 12 \ No newline at end of file
... ... @@ -0,0 +1,6 @@
  1 +angular.module('focaAbmCliente')
  2 + .factory('focaAbmCliente', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) {
  3 + return {
  4 +
  5 + };
  6 + }]);
src/views/foca-abm-cliente.html
... ... @@ -0,0 +1,17 @@
  1 +<div class="row">
  2 + <foca-cabecera-facturador
  3 + titulo="'Cliente'"
  4 + fecha="now"
  5 + class="mb-0 col-lg-12"
  6 + ></foca-cabecera-facturador>
  7 +</div>
  8 +<div class="row">
  9 + <div class="col-12 col-md-10 p-0 mt-4 border border-white rounded">
  10 + <div class="row px-5 py-2 botonera-secundaria">
  11 + <div class="col-12">
  12 + <foca-botonera-facturador botones="botonera" max="6" class="row"></foca-botonera-facturador>
  13 + </div>
  14 + </div>
  15 + </div>
  16 +</div>
  17 +
0 18 \ No newline at end of file