Removed IsModifierCompulsory from MenuCategory as it is now not needed and minimum in ModifierCategory set to non-zero to achieve the same.

Fix: DiscountLimit was not scaled to 100 in MenuCategory detail. So it is now chaled in the json and scaled back in the frontend for the list as that was not supposed to be scaled.
Feature: Modifier is now done
Fix: In product save, it was checking menu_category second time again instead of sale_category
This commit is contained in:
Amritanshu
2019-06-22 08:49:33 +05:30
parent e13ed38640
commit 20801afc8a
40 changed files with 821 additions and 144 deletions

View File

@ -22,7 +22,6 @@
</div>
<div fxLayout="row" fxLayoutAlign="space-around start" fxLayout.lt-md="column" fxLayoutGap="20px"
fxLayoutGap.lt-md="0px">
<mat-checkbox formControlName="isModifierCompulsory">Is Modifier Compulsory?</mat-checkbox>
<mat-checkbox formControlName="isActive">Is Active?</mat-checkbox>
</div>
</form>

View File

@ -33,7 +33,6 @@ export class MenuCategoryDetailComponent implements OnInit, AfterViewInit {
this.form = this.fb.group({
name: '',
discountLimit: '',
isModifierCompulsory: '',
isActive: ''
});
}
@ -50,7 +49,6 @@ export class MenuCategoryDetailComponent implements OnInit, AfterViewInit {
this.form.setValue({
name: this.item.name,
discountLimit: this.item.discountLimit,
isModifierCompulsory: this.item.isModifierCompulsory,
isActive: this.item.isActive
});
}
@ -104,7 +102,6 @@ export class MenuCategoryDetailComponent implements OnInit, AfterViewInit {
const formModel = this.form.value;
this.item.name = formModel.name;
this.item.discountLimit = +formModel.discountLimit;
this.item.isModifierCompulsory = formModel.isModifierCompulsory;
this.item.isActive = formModel.isActive;
return this.item;
}

View File

@ -24,12 +24,6 @@
<mat-cell *matCellDef="let row">{{row.discountLimit | percent:'1.2-2'}}</mat-cell>
</ng-container>
<!-- Is Modifier Compulsory Column -->
<ng-container matColumnDef="isModifierCompulsory">
<mat-header-cell *matHeaderCellDef>Modifier Compulsory?</mat-header-cell>
<mat-cell *matCellDef="let row">{{row.isModifierCompulsory}}</mat-cell>
</ng-container>
<!-- Is Active Column -->
<ng-container matColumnDef="isActive">
<mat-header-cell *matHeaderCellDef>Active?</mat-header-cell>

View File

@ -19,7 +19,7 @@ export class MenuCategoryListComponent implements OnInit {
list: MenuCategory[];
data: BehaviorSubject<MenuCategory[]>;
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['name', 'discountLimit', 'isModifierCompulsory', 'isActive', 'isFixture'];
displayedColumns = ['name', 'discountLimit', 'isActive', 'isFixture'];
constructor(
private route: ActivatedRoute,
@ -36,6 +36,7 @@ export class MenuCategoryListComponent implements OnInit {
ngOnInit() {
this.route.data
.subscribe((data: { list: MenuCategory[] }) => {
data.list.forEach(x=> x.discountLimit = x.discountLimit / 100);
this.data.next(data.list);
});
this.dataSource = new MenuCategoryListDatasource(this.data);