Blacked and isorted the python files

Prettied and eslinted the typescript/html files
This commit is contained in:
2020-10-11 10:56:29 +05:30
parent b31db593c2
commit d677cfb1ea
505 changed files with 7560 additions and 5650 deletions

View File

@ -1,18 +1,17 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot } from '@angular/router';
import { ActivatedRouteSnapshot, Resolve, Router } from '@angular/router';
import { Observable } from 'rxjs';
import { Product } from '../../core/product';
import { ProductService } from '../../product/product.service';
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class ProductsResolver implements Resolve<Product[]> {
constructor(private ser: ProductService, private router: Router) {}
constructor(private ser: ProductService, private router: Router) {
}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Product[]> {
resolve(route: ActivatedRouteSnapshot): Observable<Product[]> {
const id = route.paramMap.get('id');
return this.ser.listIsActiveOfCategory(id);
}

View File

@ -1,12 +1,24 @@
<mat-card>
<mat-card-content fxLayout="row wrap" fxLayoutGap="grid 20px">
<mat-card fxLayout="column" class="square-button" matRipple *ngFor="let item of list" (click)="addProduct(item)"
[class.yellow300]="item.hasHappyHour" [class.grey800]="item.isNotAvailable">
<h3 class="item-name">{{item.name}}</h3>
<mat-card-subtitle class="center">{{item.price | currency:'INR'}}</mat-card-subtitle>
<mat-card
fxLayout="column"
class="square-button"
matRipple
*ngFor="let item of list"
(click)="addProduct(item)"
[class.yellow300]="item.hasHappyHour"
[class.grey800]="item.isNotAvailable"
>
<h3 class="item-name">{{ item.name }}</h3>
<mat-card-subtitle class="center">{{ item.price | currency: 'INR' }}</mat-card-subtitle>
</mat-card>
<mat-card fxLayout="column" class="square-button red700" matRipple [routerLink]="['../../menu-categories']"
queryParamsHandling="preserve">
<mat-card
fxLayout="column"
class="square-button red700"
matRipple
[routerLink]="['../../menu-categories']"
queryParamsHandling="preserve"
>
<h3 class="item-name">Back</h3>
</mat-card>
</mat-card-content>

View File

@ -8,9 +8,8 @@ describe('ProductsComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ProductsComponent ]
})
.compileComponents();
declarations: [ProductsComponent],
}).compileComponents();
}));
beforeEach(() => {

View File

@ -1,28 +1,26 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Product } from '../../core/product';
import { BillService } from '../bill.service';
@Component({
selector: 'app-products',
templateUrl: './products.component.html',
styleUrls: ['./products.component.css']
styleUrls: ['./products.component.css'],
})
export class ProductsComponent implements OnInit {
list: Product[];
constructor(private route: ActivatedRoute, private bs: BillService) {
}
constructor(private route: ActivatedRoute, private bs: BillService) {}
ngOnInit() {
this.route.data
.subscribe((data: { list: Product[] }) => {
this.list = data.list;
});
this.route.data.subscribe((data: { list: Product[] }) => {
this.list = data.list;
});
}
addProduct(product: Product): void {
this.bs.addProduct(product);
}
}