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:
2023-03-13 23:52:44 +05:30
parent b021861ba3
commit efa2af396d
123 changed files with 313 additions and 836 deletions

View File

@ -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>

View File

@ -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);