Commit 5e56b7f1df08f4e662e0de593e8be32dee0c129c
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
Master(efernandez) See merge request modulos-npm/foca-modal-busqueda-productos!8
Showing
4 changed files
Show diff stats
index.html
package.json
| ... | ... | @@ -7,14 +7,14 @@ |
| 7 | 7 | "gulp-pre-commit": "gulp pre-commit", |
| 8 | 8 | "compile": "gulp uglify", |
| 9 | 9 | "postinstall": "npm run compile && gulp clean-post-install", |
| 10 | - "install-dev": "npm install -D angular 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+https://192.168.0.11/modulos-npm/foca-directivas" | |
| 10 | + "install-dev": "npm install -D angular 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+https://debo.suite.repo/modulos-npm/foca-directivas" | |
| 11 | 11 | }, |
| 12 | 12 | "pre-commit": [ |
| 13 | 13 | "gulp-pre-commit" |
| 14 | 14 | ], |
| 15 | 15 | "repository": { |
| 16 | 16 | "type": "git", |
| 17 | - "url": "https://192.168.0.11/modulos-npm/foca-modal-busqueda-productos" | |
| 17 | + "url": "https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos" | |
| 18 | 18 | }, |
| 19 | 19 | "author": "Nicolás Guarnieri", |
| 20 | 20 | "license": "ISC", |
| ... | ... | @@ -33,12 +33,12 @@ |
| 33 | 33 | "gulp-uglify": "^3.0.1", |
| 34 | 34 | "jquery": "^3.3.1", |
| 35 | 35 | "pump": "^3.0.0", |
| 36 | - "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas" | |
| 36 | + "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas" | |
| 37 | 37 | }, |
| 38 | 38 | "devDependencies": { |
| 39 | 39 | "angular": "^1.7.4", |
| 40 | 40 | "bootstrap": "^4.1.3", |
| 41 | - "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas", | |
| 41 | + "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas", | |
| 42 | 42 | "font-awesome": "^4.7.0", |
| 43 | 43 | "gulp": "^3.9.1", |
| 44 | 44 | "gulp-angular-templatecache": "^2.2.1", |
src/js/controller.js
| ... | ... | @@ -7,12 +7,22 @@ angular.module('focaBusquedaProductos') |
| 7 | 7 | 'idLista', |
| 8 | 8 | 'focaBusquedaProductosService', |
| 9 | 9 | function($filter, $scope, $uibModalInstance, idLista, focaBusquedaProductosService) { |
| 10 | - focaBusquedaProductosService.getProductosByIdLista(idLista).then( | |
| 11 | - function(res) { | |
| 12 | - $scope.productos = res.data; | |
| 13 | - $scope.search(); | |
| 14 | - } | |
| 15 | - ); | |
| 10 | + if(idLista) { | |
| 11 | + focaBusquedaProductosService.getProductosByIdLista(idLista).then( | |
| 12 | + function(res) { | |
| 13 | + $scope.productos = res.data; | |
| 14 | + $scope.search(); | |
| 15 | + } | |
| 16 | + ); | |
| 17 | + } else { | |
| 18 | + focaBusquedaProductosService.getProductos().then( | |
| 19 | + function(res) { | |
| 20 | + $scope.productos = res.data; | |
| 21 | + $scope.search(); | |
| 22 | + } | |
| 23 | + ); | |
| 24 | + } | |
| 25 | + | |
| 16 | 26 | |
| 17 | 27 | // pagination |
| 18 | 28 | $scope.numPerPage = 10; |
src/views/modal-busqueda-productos.html
| ... | ... | @@ -25,20 +25,21 @@ |
| 25 | 25 | </tr> |
| 26 | 26 | </thead> |
| 27 | 27 | <tbody> |
| 28 | - <tr ng-repeat="(key,producto) in currentPageProductos"> | |
| 28 | + <tr class="selectable" | |
| 29 | + ng-repeat="(key,producto) in currentPageProductos" | |
| 30 | + ng-click="select(producto)"> | |
| 29 | 31 | <td ng-bind="producto.sector"></td> |
| 30 | 32 | <td ng-bind="producto.codigo"></td> |
| 31 | 33 | <td ng-bind="producto.descripcion"></td> |
| 32 | 34 | <td ng-bind="producto.precio | currency"></td> |
| 33 | 35 | <td> |
| 34 | 36 | <button |
| 35 | - type="button" | |
| 37 | + type="button" | |
| 36 | 38 | class="btn p-2 float-right" |
| 37 | - ng-class="{ | |
| 38 | - 'btn-secondary': selectedProducto != key, | |
| 39 | + ng-class="{ | |
| 40 | + 'btn-secondary': selectedProducto != key, | |
| 39 | 41 | 'btn-primary': selectedProducto == key |
| 40 | 42 | }" |
| 41 | - ng-click="select(producto)" | |
| 42 | 43 | foca-focus="selectedProducto == {{key}}" |
| 43 | 44 | ng-keydown="itemProducto($event.keyCode)" |
| 44 | 45 | > |