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

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

View File

@ -12,13 +12,7 @@
<div class="flex flex-row justify-around content-start items-start sm:max-lg:flex-col">
<mat-form-field class="flex-auto basis-2/5 mr-5">
<mat-label>Date</mat-label>
<input
matInput
[matDatepicker]="date"
(focus)="date.open()"
formControlName="date"
autocomplete="off"
/>
<input matInput [matDatepicker]="date" (focus)="date.open()" formControlName="date" autocomplete="off" />
<mat-datepicker-toggle matSuffix [for]="date"></mat-datepicker-toggle>
<mat-datepicker #date></mat-datepicker>
</mat-form-field>
@ -30,9 +24,7 @@
</mat-option>
</mat-select>
</mat-form-field>
<button mat-raised-button class="flex-auto basis-1/5" color="primary" (click)="show()">
Show
</button>
<button mat-raised-button class="flex-auto basis-1/5" color="primary" (click)="show()">Show</button>
</div>
<mat-table #table [dataSource]="dataSource" aria-label="Elements" formArrayName="prices">
<!-- Name Column -->
@ -44,9 +36,7 @@
<!-- Old Price Column -->
<ng-container matColumnDef="oldPrice">
<mat-header-cell *matHeaderCellDef class="right">Old Price</mat-header-cell>
<mat-cell *matCellDef="let row" class="right">{{
row.oldPrice | currency : 'INR'
}}</mat-cell>
<mat-cell *matCellDef="let row" class="right">{{ row.oldPrice | currency : 'INR' }}</mat-cell>
</ng-container>
<!-- New Price Column -->

View File

@ -59,9 +59,7 @@ export class UpdateProductPricesComponent implements OnInit {
.pipe(
map((value) => {
const data = value as { menuCategories: MenuCategory[]; info: UpdateProductPrices };
data.menuCategories.unshift(
new MenuCategory({ id: undefined, name: '-- All Categories --' }),
);
data.menuCategories.unshift(new MenuCategory({ id: undefined, name: '-- All Categories --' }));
return data;
}),
)
@ -74,9 +72,7 @@ export class UpdateProductPricesComponent implements OnInit {
loadData(info: UpdateProductPrices) {
this.info = info;
this.form.controls.date.setValue(moment(this.info.date, 'DD-MMM-YYYY').toDate());
this.form.controls.menuCategory.setValue(
this.info.menuCategoryId !== undefined ? this.info.menuCategoryId : '',
);
this.form.controls.menuCategory.setValue(this.info.menuCategoryId !== undefined ? this.info.menuCategoryId : '');
this.form.controls.prices.clear();
this.info.items.forEach((x) =>

View File

@ -6,12 +6,7 @@ import { ReactiveFormsModule } from '@angular/forms';
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import {
DateAdapter,
MAT_DATE_FORMATS,
MAT_DATE_LOCALE,
MatNativeDateModule,
} from '@angular/material/core';
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, MatNativeDateModule } from '@angular/material/core';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';

View File

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

View File

@ -25,17 +25,13 @@ export class UpdateProductPricesService {
}
return this.http
.get<UpdateProductPrices>(getUrl, options)
.pipe(
catchError(this.log.handleError(serviceName, 'get')),
) as Observable<UpdateProductPrices>;
.pipe(catchError(this.log.handleError(serviceName, 'get'))) as Observable<UpdateProductPrices>;
}
save(item: UpdateProductPrices): Observable<UpdateProductPrices> {
const saveUrl: string = item.menuCategoryId === null ? url : `${url}/${item.menuCategoryId}`;
return this.http
.post<Product[]>(saveUrl, item)
.pipe(
catchError(this.log.handleError(serviceName, 'save')),
) as Observable<UpdateProductPrices>;
.pipe(catchError(this.log.handleError(serviceName, 'save'))) as Observable<UpdateProductPrices>;
}
}