Big Chunk of updates on way to making the sales portion working

This commit is contained in:
Amritanshu
2019-07-06 13:46:18 +05:30
parent 87076d9c00
commit d69ab0063a
83 changed files with 1621 additions and 415 deletions

View File

@ -0,0 +1,18 @@
import {Injectable} from '@angular/core';
import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router';
import {Observable} from 'rxjs/internal/Observable';
import {Table} from "../../core/table";
import {TableService} from "../../tables/table.service";
@Injectable({
providedIn: 'root'
})
export class BillResolver implements Resolve<Table[]> {
constructor(private ser: TableService, private router: Router) {
}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Table[]> {
return this.ser.list();
}
}

View File

@ -0,0 +1,10 @@
.kot {
background-color: red;
font-weight: bold;
}
.square-button {
min-width: 150px;
max-width: 150px;
min-height: 150px;
}

View File

@ -0,0 +1,15 @@
<mat-card>
<mat-card-title-group>
<mat-card-title>Bill</mat-card-title>
</mat-card-title-group>
<mat-card-content fxLayout="row wrap" fxLayoutGap="grid 20px">
<mat-table #table [dataSource]="dataSource" aria-label="Elements">
<!-- Info Column -->
<ng-container matColumnDef="info">
<mat-cell *matCellDef="let row" [class.kot]="row.isKot">{{row.info}}</mat-cell>
</ng-container>
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
</mat-table>
</mat-card-content>
</mat-card>
<router-outlet></router-outlet>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BillsComponent } from './bills.component';
describe('BillsComponent', () => {
let component: BillsComponent;
let fixture: ComponentFixture<BillsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ BillsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(BillsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,22 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from "@angular/router";
import { Table } from "../../core/table";
@Component({
selector: 'app-bills',
templateUrl: './bills.component.html',
styleUrls: ['./bills.component.css']
})
export class BillsComponent implements OnInit {
list: Table[];
constructor(private route: ActivatedRoute) {
}
ngOnInit() {
this.route.data
.subscribe((data: { list: Table[] }) => {
this.list = data.list;
});
}
}