Chore: Moved from css to sass, god knows what to do now.
Chore: Prettier line length changed to 120 from 100 Fix: Hard coded the face as the primary color to make the buttons stand out
This commit is contained in:
@ -95,17 +95,11 @@
|
||||
<!-- Quantity Column -->
|
||||
<ng-container matColumnDef="quantity">
|
||||
<mat-header-cell *matHeaderCellDef class="right">Quantity</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{
|
||||
row.quantity | number : '1.2-2'
|
||||
}}</mat-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{ row.quantity | number : '1.2-2' }}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row
|
||||
*matRowDef="let row; columns: displayedColumns"
|
||||
cdkDrag
|
||||
[cdkDragData]="row"
|
||||
></mat-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns" cdkDrag [cdkDragData]="row"></mat-row>
|
||||
</mat-table>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
@ -23,11 +23,7 @@ export class ProductListComponent implements OnInit {
|
||||
searchFilter: Observable<string> = new Observable();
|
||||
menuCategoryFilter: BehaviorSubject<string> = new BehaviorSubject('');
|
||||
data: BehaviorSubject<Product[]> = new BehaviorSubject<Product[]>([]);
|
||||
dataSource: ProductListDataSource = new ProductListDataSource(
|
||||
this.searchFilter,
|
||||
this.menuCategoryFilter,
|
||||
this.data,
|
||||
);
|
||||
dataSource: ProductListDataSource = new ProductListDataSource(this.searchFilter, this.menuCategoryFilter, this.data);
|
||||
|
||||
form: FormGroup<{
|
||||
menuCategory: FormControl<string | null>;
|
||||
@ -37,14 +33,7 @@ export class ProductListComponent implements OnInit {
|
||||
list: Product[] = [];
|
||||
menuCategories: MenuCategory[] = [];
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns: string[] = [
|
||||
'name',
|
||||
'price',
|
||||
'menuCategory',
|
||||
'saleCategory',
|
||||
'info',
|
||||
'quantity',
|
||||
];
|
||||
displayedColumns: string[] = ['name', 'price', 'menuCategory', 'saleCategory', 'info', 'quantity'];
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
@ -59,10 +48,7 @@ export class ProductListComponent implements OnInit {
|
||||
this.data.subscribe((data: Product[]) => {
|
||||
this.list = data;
|
||||
});
|
||||
this.searchFilter = this.form.controls.filter.valueChanges.pipe(
|
||||
debounceTime(150),
|
||||
distinctUntilChanged(),
|
||||
);
|
||||
this.searchFilter = this.form.controls.filter.valueChanges.pipe(debounceTime(150), distinctUntilChanged());
|
||||
}
|
||||
|
||||
filterOn(val: string) {
|
||||
@ -70,11 +56,7 @@ export class ProductListComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.dataSource = new ProductListDataSource(
|
||||
this.searchFilter,
|
||||
this.menuCategoryFilter,
|
||||
this.data,
|
||||
);
|
||||
this.dataSource = new ProductListDataSource(this.searchFilter, this.menuCategoryFilter, this.data);
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { list: Product[]; menuCategories: MenuCategory[] };
|
||||
this.loadData(data.list, data.menuCategories);
|
||||
|
||||
Reference in New Issue
Block a user