From fb598a4469f95ab54bbd71daf586c0b27875cf20 Mon Sep 17 00:00:00 2001 From: Marcelo Puebla Date: Wed, 4 Mar 2020 11:01:04 -0300 Subject: [PATCH] Add Mensaje de error con articulos en carrito sin stock --- src/app/modules/carrito/carrito.component.html | 2 +- src/app/modules/carrito/carrito.component.ts | 19 +++++++++++++++- src/app/modules/carrito/carrito.module.ts | 9 ++++++-- src/app/services/articulo/articulo.service.ts | 11 ++++++++++ .../shared/error-stock/error-stock.component.html | 10 +++++++++ .../shared/error-stock/error-stock.component.scss | 0 .../error-stock/error-stock.component.spec.ts | 25 ++++++++++++++++++++++ .../shared/error-stock/error-stock.component.ts | 19 ++++++++++++++++ 8 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 src/app/shared/error-stock/error-stock.component.html create mode 100644 src/app/shared/error-stock/error-stock.component.scss create mode 100644 src/app/shared/error-stock/error-stock.component.spec.ts create mode 100644 src/app/shared/error-stock/error-stock.component.ts diff --git a/src/app/modules/carrito/carrito.component.html b/src/app/modules/carrito/carrito.component.html index ae8d1d2..40e121b 100644 --- a/src/app/modules/carrito/carrito.component.html +++ b/src/app/modules/carrito/carrito.component.html @@ -91,7 +91,7 @@ class="row mx-3 mt-4 h-auto justify-content-end">
+ (click)="validateCarrito()"> CONTINUAR + +
diff --git a/src/app/shared/error-stock/error-stock.component.scss b/src/app/shared/error-stock/error-stock.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/shared/error-stock/error-stock.component.spec.ts b/src/app/shared/error-stock/error-stock.component.spec.ts new file mode 100644 index 0000000..1d32c53 --- /dev/null +++ b/src/app/shared/error-stock/error-stock.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ErrorStockComponent } from './error-stock.component'; + +describe('ErrorStockComponent', () => { + let component: ErrorStockComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ErrorStockComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ErrorStockComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/error-stock/error-stock.component.ts b/src/app/shared/error-stock/error-stock.component.ts new file mode 100644 index 0000000..8650a1c --- /dev/null +++ b/src/app/shared/error-stock/error-stock.component.ts @@ -0,0 +1,19 @@ +import { Component, OnInit } from '@angular/core'; +import { BsModalRef } from 'ngx-bootstrap/modal'; +import { IArticulo } from 'src/app/interfaces/IArticulo'; + +@Component({ + selector: 'app-error-stock', + templateUrl: './error-stock.component.html', + styleUrls: ['./error-stock.component.scss'] +}) +export class ErrorStockComponent implements OnInit { + articulo: IArticulo; + + constructor( + private modalRef: BsModalRef, + ) { } + + ngOnInit() { } + +} -- 1.9.1