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

@ -55,23 +55,13 @@
<div class="flex flex-row justify-around content-start items-start">
<mat-form-field class="flex-auto basis-1/2 mr-5">
<mat-label>Valid From</mat-label>
<input
matInput
[matDatepicker]="validFrom"
formControlName="validFrom"
autocomplete="off"
/>
<input matInput [matDatepicker]="validFrom" formControlName="validFrom" autocomplete="off" />
<mat-datepicker-toggle matSuffix [for]="validFrom"></mat-datepicker-toggle>
<mat-datepicker #validFrom></mat-datepicker>
</mat-form-field>
<mat-form-field class="flex-auto basis-1/2">
<mat-label>Valid Till</mat-label>
<input
matInput
[matDatepicker]="validTill"
formControlName="validTill"
autocomplete="off"
/>
<input matInput [matDatepicker]="validTill" formControlName="validTill" autocomplete="off" />
<mat-datepicker-toggle matSuffix [for]="validTill"></mat-datepicker-toggle>
<mat-datepicker #validTill></mat-datepicker>
</mat-form-field>

View File

@ -84,10 +84,8 @@ export class TemporalProductDetailComponent implements OnInit, AfterViewInit {
hasHappyHour: this.item.hasHappyHour,
isNotAvailable: this.item.isNotAvailable,
quantity: this.item.quantity,
validFrom:
this.item.validFrom === null ? null : moment(this.item.validFrom, 'DD-MMM-YYYY').toDate(),
validTill:
this.item.validTill === null ? null : moment(this.item.validTill, 'DD-MMM-YYYY').toDate(),
validFrom: this.item.validFrom === null ? null : moment(this.item.validFrom, 'DD-MMM-YYYY').toDate(),
validTill: this.item.validTill === null ? null : moment(this.item.validTill, 'DD-MMM-YYYY').toDate(),
});
}
@ -153,13 +151,9 @@ export class TemporalProductDetailComponent implements OnInit, AfterViewInit {
this.item.hasHappyHour = formModel.hasHappyHour ?? false;
this.item.isNotAvailable = formModel.isNotAvailable ?? false;
this.item.quantity = formModel.quantity ?? 0;
this.item.validFrom = !formModel.validFrom
? null
: moment(formModel.validFrom).format('DD-MMM-YYYY');
this.item.validFrom = !formModel.validFrom ? null : moment(formModel.validFrom).format('DD-MMM-YYYY');
console.log(formModel.validTill);
this.item.validTill = !formModel.validTill
? null
: moment(formModel.validTill).format('DD-MMM-YYYY');
this.item.validTill = !formModel.validTill ? null : moment(formModel.validTill).format('DD-MMM-YYYY');
return this.item;
}

View File

@ -61,12 +61,7 @@ export class TemporalProductListDatasource extends DataSource<Product> {
disconnect() {}
private getFilteredData(
data: Product[][],
search: string,
menuCategory: string,
saleCategory: string,
): Product[][] {
private getFilteredData(data: Product[][], search: string, menuCategory: string, saleCategory: string): Product[][] {
return data.filter(
(o: Product[]) =>
o

View File

@ -36,9 +36,7 @@
<mat-cell *matCellDef="let row">
<ul>
<li>
<a [routerLink]="['/temporal-products', row.versionId]"
>{{ row.name }} ({{ row.units }})</a
>
<a [routerLink]="['/temporal-products', row.versionId]">{{ row.name }} ({{ row.units }})</a>
</li>
<li>
{{ row.id }}
@ -93,9 +91,7 @@
<!-- 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>

View File

@ -38,14 +38,7 @@ export class TemporalProductListComponent implements OnInit {
menuCategories: MenuCategory[] = [];
saleCategories: SaleCategory[] = [];
/** 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) {
this.form = new FormGroup({
@ -56,10 +49,7 @@ export class TemporalProductListComponent 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());
}
filterMcOn(val: string) {

View File

@ -9,10 +9,7 @@ describe('TemporalProductResolverService', () => {
});
});
it('should be created', inject(
[TemporalProductResolverService],
(service: TemporalProductResolverService) => {
expect(service).toBeTruthy();
},
));
it('should be created', inject([TemporalProductResolverService], (service: TemporalProductResolverService) => {
expect(service).toBeTruthy();
}));
});