Commit b1698a5276566fc7eaa30ec41025e1975cf2b05c
Exists in
develop
and in
1 other branch
merge conflict
Showing
16 changed files
Show diff stats
src/app/modules/admin/admin.component.ts
src/app/modules/carrito/carrito.module.ts
1 | -import { NgModule } from "@angular/core"; | |
2 | -import { CommonModule } from "@angular/common"; | |
1 | +import { NgModule } from '@angular/core'; | |
2 | +import { CommonModule } from '@angular/common'; | |
3 | 3 | |
4 | -import { CarritoRoutingModule } from "./carrito-routing.module"; | |
5 | -import { CarritoComponent } from "./carrito.component"; | |
4 | +import { CarritoRoutingModule } from './carrito-routing.module'; | |
5 | +import { CarritoComponent } from './carrito.component'; | |
6 | 6 | import { SeleccionArticulosModule } from '../seleccion-articulos/seleccion-articulos.module'; |
7 | 7 | import { SharedModule } from '../shared/shared.module'; |
8 | 8 |
src/app/modules/info-formas-pago/info-formas-pago-routing.module.ts
1 | -import { NgModule } from "@angular/core"; | |
2 | -import { Routes, RouterModule } from "@angular/router"; | |
3 | -import { InfoFormasPagoComponent } from "./info-formas-pago.component"; | |
1 | +import { NgModule } from '@angular/core'; | |
2 | +import { Routes, RouterModule } from '@angular/router'; | |
3 | +import { InfoFormasPagoComponent } from './info-formas-pago.component'; | |
4 | 4 | |
5 | -const routes: Routes = [{ path: "", component: InfoFormasPagoComponent }]; | |
5 | +const routes: Routes = [{ path: '', component: InfoFormasPagoComponent }]; | |
6 | 6 | |
7 | 7 | @NgModule({ |
8 | 8 | imports: [RouterModule.forChild(routes)], |
src/app/modules/info-formas-pago/info-formas-pago.component.ts
1 | -import { Component, OnInit } from "@angular/core"; | |
1 | +import { Component, OnInit } from '@angular/core'; | |
2 | 2 | |
3 | 3 | @Component({ |
4 | - selector: "app-formas-pago", | |
5 | - templateUrl: "./info-formas-pago.component.html", | |
6 | - styleUrls: ["./info-formas-pago.component.scss"] | |
4 | + selector: 'app-formas-pago', | |
5 | + templateUrl: './info-formas-pago.component.html', | |
6 | + styleUrls: ['./info-formas-pago.component.scss'] | |
7 | 7 | }) |
8 | 8 | export class InfoFormasPagoComponent implements OnInit { |
9 | 9 | constructor() {} |
src/app/modules/mensaje-final/mensaje-final.component.ts
src/app/modules/opcion-pedido/opcion-pedido-routing.module.ts
1 | -import { NgModule } from "@angular/core"; | |
2 | -import { Routes, RouterModule } from "@angular/router"; | |
1 | +import { NgModule } from '@angular/core'; | |
2 | +import { Routes, RouterModule } from '@angular/router'; | |
3 | 3 | import { OpcionPedidoComponent } from './opcion-pedido.component'; |
4 | 4 | |
5 | -const routes: Routes = [{ path: "", component: OpcionPedidoComponent }]; | |
5 | +const routes: Routes = [{ path: '', component: OpcionPedidoComponent }]; | |
6 | 6 | |
7 | 7 | @NgModule({ |
8 | 8 | imports: [RouterModule.forChild(routes)], |
src/app/modules/opcion-pedido/opcion-pedido.component.ts
src/app/modules/opcion-pedido/opcion-pedido.module.ts
1 | -import { NgModule } from "@angular/core"; | |
2 | -import { CommonModule } from "@angular/common"; | |
3 | -import { OpcionPedidoRoutingModule } from "./opcion-pedido-routing.module"; | |
4 | -import { OpcionPedidoComponent } from "./opcion-pedido.component"; | |
1 | +import { NgModule } from '@angular/core'; | |
2 | +import { CommonModule } from '@angular/common'; | |
3 | +import { OpcionPedidoRoutingModule } from './opcion-pedido-routing.module'; | |
4 | +import { OpcionPedidoComponent } from './opcion-pedido.component'; | |
5 | 5 | |
6 | 6 | @NgModule({ |
7 | 7 | declarations: [OpcionPedidoComponent], |
src/app/modules/pago-electronico/pago-electronico.component.ts
... | ... | @@ -17,13 +17,14 @@ export class PagoElectronicoComponent implements OnInit { |
17 | 17 | ) { } |
18 | 18 | |
19 | 19 | ngOnInit() { |
20 | - // if (!this.articuloService.carrito.length) { | |
21 | - // this.router.navigate(['']); | |
22 | - // return; | |
23 | - // } | |
24 | - let dataPago = { | |
25 | - pedidoAnombreDe: '' | |
20 | + if (!this.articuloService.carrito.length) { | |
21 | + this.router.navigate(['']); | |
22 | + return; | |
26 | 23 | } |
24 | + const dataPago = { | |
25 | + pedidoAnombreDe: '' | |
26 | + }; | |
27 | + dataPago.pedidoAnombreDe = ''; | |
27 | 28 | this.articuloService.pay(dataPago) |
28 | 29 | .subscribe((res: any) => { |
29 | 30 | this.articuloService.idComanda = res.data; |
src/app/modules/pago-tarjeta/pago-tarjeta.component.ts
... | ... | @@ -19,9 +19,9 @@ export class PagoTarjetaComponent implements OnInit { |
19 | 19 | this.router.navigate(['']); |
20 | 20 | return; |
21 | 21 | } |
22 | - let dataPago = { | |
22 | + const dataPago = { | |
23 | 23 | pedidoAnombreDe: '' |
24 | - } | |
24 | + }; | |
25 | 25 | this.articuloService.pay(dataPago) |
26 | 26 | .subscribe((res: any) => { |
27 | 27 | this.articuloService.idComanda = res.data; |
src/app/modules/pedidos-salientes/pedidos-salientes.component.ts
src/app/modules/seleccion-articulos/seleccion-articulos.component.ts
1 | -import { Component, OnInit } from "@angular/core"; | |
1 | +import { Component, OnInit } from '@angular/core'; | |
2 | 2 | import { BsModalRef } from 'ngx-bootstrap/modal'; |
3 | 3 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; |
4 | 4 | import { IArticulo } from 'src/app/interfaces/IArticulo'; |
... | ... | @@ -7,9 +7,9 @@ import { ICategoria } from 'src/app/interfaces/ICategoria'; |
7 | 7 | import { CategoriaService } from 'src/app/services/categoria/categoria.service'; |
8 | 8 | |
9 | 9 | @Component({ |
10 | - selector: "app-seleccion-articulos", | |
11 | - templateUrl: "./seleccion-articulos.component.html", | |
12 | - styleUrls: ["./seleccion-articulos.component.scss"] | |
10 | + selector: 'app-seleccion-articulos', | |
11 | + templateUrl: './seleccion-articulos.component.html', | |
12 | + styleUrls: ['./seleccion-articulos.component.scss'] | |
13 | 13 | }) |
14 | 14 | export class SeleccionArticulosComponent implements OnInit { |
15 | 15 | showSpinner = true; |
... | ... | @@ -68,10 +68,10 @@ export class SeleccionArticulosComponent implements OnInit { |
68 | 68 | this.articuloService.getAll() |
69 | 69 | .subscribe((result: IArticulo[]) => { |
70 | 70 | this.articuloService.setArticulosSinImagen(result); |
71 | - if (this.queMostrar == 'ordenar') { | |
71 | + if (this.queMostrar === 'ordenar') { | |
72 | 72 | this.categorias.forEach((categoria: ICategoria) => { |
73 | - let tempArticulos = result.filter((articulo: IArticulo) => { | |
74 | - return articulo.categoria_selfservice == categoria.id; | |
73 | + const tempArticulos = result.filter((articulo: IArticulo) => { | |
74 | + return articulo.categoria_selfservice === categoria.id; | |
75 | 75 | }); |
76 | 76 | result = tempArticulos; |
77 | 77 | }); |
... | ... | @@ -90,7 +90,7 @@ export class SeleccionArticulosComponent implements OnInit { |
90 | 90 | } |
91 | 91 | |
92 | 92 | filterItems() { |
93 | - if (this.categoriaActive == 0) { | |
93 | + if (this.categoriaActive === 0) { | |
94 | 94 | this.auxArticulos = this.articulos; |
95 | 95 | return; |
96 | 96 | } |
... | ... | @@ -109,7 +109,7 @@ export class SeleccionArticulosComponent implements OnInit { |
109 | 109 | } |
110 | 110 | |
111 | 111 | selectCategoria(index: number, idCategoria?: number) { |
112 | - if (this.categoriaActive == idCategoria) return; | |
112 | + if (this.categoriaActive === idCategoria) return; | |
113 | 113 | this.categoriaActive = idCategoria; |
114 | 114 | this.allActive = idCategoria === 0 ? true : false; |
115 | 115 | this.categorias.forEach((categoria, i) => { |
... | ... | @@ -136,16 +136,16 @@ export class SeleccionArticulosComponent implements OnInit { |
136 | 136 | } |
137 | 137 | |
138 | 138 | scrollY(el: HTMLElement, value) { |
139 | - el.scroll({ behavior: "smooth", top: value + el.scrollTop }); | |
139 | + el.scroll({ behavior: 'smooth', top: value + el.scrollTop }); | |
140 | 140 | this.timeoutHandler = setInterval(() => { |
141 | - el.scroll({ behavior: "smooth", top: value + el.scrollTop }); | |
141 | + el.scroll({ behavior: 'smooth', top: value + el.scrollTop }); | |
142 | 142 | }, 500); |
143 | 143 | } |
144 | 144 | |
145 | 145 | scrollX(el: HTMLElement, value) { |
146 | - el.scroll({ behavior: "smooth", left: value + el.scrollLeft }); | |
146 | + el.scroll({ behavior: 'smooth', left: value + el.scrollLeft }); | |
147 | 147 | this.timeoutHandler = setInterval(() => { |
148 | - el.scroll({ behavior: "smooth", left: value + el.scrollLeft }); | |
148 | + el.scroll({ behavior: 'smooth', left: value + el.scrollLeft }); | |
149 | 149 | }, 500); |
150 | 150 | } |
151 | 151 | } |
src/app/services/articulo/articulo.service.ts
... | ... | @@ -11,7 +11,7 @@ export class ArticuloService { |
11 | 11 | articuloAcargar: IArticulo; |
12 | 12 | promoAcargar: IArticulo; |
13 | 13 | mostrar: string; |
14 | - esPromoPersonalizada: boolean = false; | |
14 | + esPromoPersonalizada = false; | |
15 | 15 | urlDeboSuite = APP_SETTINGS.apiDeboSuite; |
16 | 16 | medioPago: number; |
17 | 17 | idComanda: number; |
... | ... | @@ -34,10 +34,10 @@ export class ArticuloService { |
34 | 34 | } |
35 | 35 | |
36 | 36 | setArticulo(articulo: IArticulo) { |
37 | - for (let i = 0; i < this.carrito.length; i++) { | |
38 | - if (this.carrito[i].id === articulo.id) { | |
37 | + for (const articuloCarrito of this.carrito) { | |
38 | + if (articuloCarrito.id === articulo.id) { | |
39 | 39 | if (articulo.PRO) break; |
40 | - this.carrito[i].cantidad++; | |
40 | + articuloCarrito.cantidad++; | |
41 | 41 | return; |
42 | 42 | } |
43 | 43 | } |
... | ... | @@ -49,14 +49,13 @@ export class ArticuloService { |
49 | 49 | return new Observable((observer) => { |
50 | 50 | this.clienteService.getById(-1) |
51 | 51 | .subscribe(cliente => { |
52 | - let puntoVenta = APP_SETTINGS.puntoVenta; | |
53 | 52 | this.markArticuloInPromoAsRemoved(); |
54 | 53 | this.http.post(`${this.urlDeboSuite}/comprobante/guardar/${this.medioPago}`, { |
55 | 54 | productos: this.carrito, |
56 | - cliente: cliente, | |
55 | + cliente, | |
57 | 56 | origen: 'autoservicio', |
58 | 57 | codigoVendedor: 5, |
59 | - puntoVenta: puntoVenta, | |
58 | + puntoVenta: APP_SETTINGS.puntoVenta, | |
60 | 59 | pedidoAnombreDe: dataPago.pedidoAnombreDe, |
61 | 60 | numeroPlanilla: APP_SETTINGS.numeroPlanilla, |
62 | 61 | }) |
... | ... | @@ -82,9 +81,9 @@ export class ArticuloService { |
82 | 81 | } |
83 | 82 | |
84 | 83 | markArticuloInPromoAsRemoved() { |
85 | - this.carrito.forEach((articulo: IArticulo) => { | |
86 | - if (articulo.PRO) { | |
87 | - articulo.productos.forEach((articulo: IArticulo) => { | |
84 | + this.carrito.forEach((articuloCarrito: IArticulo) => { | |
85 | + if (articuloCarrito.PRO) { | |
86 | + articuloCarrito.productos.forEach((articulo: IArticulo) => { | |
88 | 87 | if (articulo.cantidadAdicionada === 0) { |
89 | 88 | articulo.cantidad = 0; |
90 | 89 | articulo.importeValorExtra = 0; |
src/app/services/cliente/cliente.service.ts
src/app/services/comanda/comanda.service.ts
1 | 1 | import { Injectable } from '@angular/core'; |
2 | -import { HttpClient } from "@angular/common/http"; | |
3 | -import { APP_SETTINGS } from "src/etc/AppSettings"; | |
2 | +import { HttpClient } from '@angular/common/http'; | |
3 | +import { APP_SETTINGS } from 'src/etc/AppSettings'; | |
4 | 4 | |
5 | 5 | @Injectable({ |
6 | 6 | providedIn: 'root' |
tslint.json
... | ... | @@ -8,6 +8,10 @@ |
8 | 8 | }, |
9 | 9 | "component-class-suffix": true, |
10 | 10 | "contextual-lifecycle": true, |
11 | + "curly": [ | |
12 | + true, | |
13 | + "ignore-same-line" | |
14 | + ], | |
11 | 15 | "directive-class-suffix": true, |
12 | 16 | "directive-selector": [ |
13 | 17 | true, |
... | ... | @@ -50,7 +54,8 @@ |
50 | 54 | "info", |
51 | 55 | "time", |
52 | 56 | "timeEnd", |
53 | - "trace" | |
57 | + "trace", | |
58 | + "log" | |
54 | 59 | ], |
55 | 60 | "no-empty": false, |
56 | 61 | "no-inferrable-types": [ |