From 1d536309e17e8d24a9df861a9d8ee50cf3792110 Mon Sep 17 00:00:00 2001 From: "pakintada@gmail.com" Date: Tue, 6 Feb 2024 16:35:39 +0700 Subject: [PATCH] add warning & default init recipelist --- .../recipe-list/recipe-list.component.ts | 19 ++++++++----------- .../features/toppings/toppings.component.html | 6 ++++++ .../features/toppings/toppings.component.ts | 7 +++++++ 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/client/src/app/features/recipes/recipe-details/recipe-list/recipe-list.component.ts b/client/src/app/features/recipes/recipe-details/recipe-list/recipe-list.component.ts index 14ed12f..59c7129 100644 --- a/client/src/app/features/recipes/recipe-details/recipe-list/recipe-list.component.ts +++ b/client/src/app/features/recipes/recipe-details/recipe-list/recipe-list.component.ts @@ -121,6 +121,8 @@ export class RecipeListComponent implements OnInit { }); + // this do not fetch recipe list when initialized + // use when doing `topping` if(!this.noFetch){ (await this._recipeService .getRecipeDetailMat(this.productCode)) @@ -338,13 +340,13 @@ export class RecipeListComponent implements OnInit { materialPathId: [{ value: 0, disabled: !this.isEditable() }], name: [{ value: "", disabled: true }], mixOrder: [{ value: "", disabled: !this.isEditable() }], - stirTime: [{ value: 0 / 10, disabled: !this.isEditable() }], - powderGram: [{ value: 0, disabled: !this.isEditable() }], + stirTime: [{ value: 1, disabled: !this.isEditable() }], + powderGram: [{ value: 1, disabled: !this.isEditable() }], powderTime: [{ value: 0, disabled: !this.isEditable() }], - syrupGram: [{ value: 0, disabled: !this.isEditable() }], + syrupGram: [{ value: 1, disabled: !this.isEditable() }], syrupTime: [{ value: 0, disabled: !this.isEditable() }], - waterCold: [{ value: 0, disabled: !this.isEditable() }], - waterYield: [{ value: 0, disabled: !this.isEditable() }], + waterCold: [{ value: 1, disabled: !this.isEditable() }], + waterYield: [{ value: 1, disabled: !this.isEditable() }], feedPattern: [{ value: "", disabled: !this.isEditable() }], feedParameter: [{ value: "", disabled: !this.isEditable() }], StringParam: [{ value: "", disabled: !this.isEditable() }], @@ -572,11 +574,6 @@ export class RecipeListComponent implements OnInit { timeoutHandler: any; timeout: number = 0; initHoldEvent() { - // if(this.timeoutHandler){ - // clearInterval(this.timeoutHandler); - // this.timeoutHandler = undefined; - // } - // let timeout = 0; this.timeoutHandler = setInterval(() => { this.timeout += 1; }, 100); @@ -586,7 +583,7 @@ export class RecipeListComponent implements OnInit { await Promise.resolve(); if (this.timeoutHandler) { - // console.log("timeout get", this.timeout); + if (this.timeout >= 20) { // alert("Opening Recipe List Editor in detail") if (confirm("Are you sure you want to open Recipe List Editor in detail?")) { diff --git a/client/src/app/features/toppings/toppings.component.html b/client/src/app/features/toppings/toppings.component.html index ad55211..2a11b65 100644 --- a/client/src/app/features/toppings/toppings.component.html +++ b/client/src/app/features/toppings/toppings.component.html @@ -152,7 +152,13 @@ +
+

⚠️

+
+ + +
diff --git a/client/src/app/features/toppings/toppings.component.ts b/client/src/app/features/toppings/toppings.component.ts index 0a0a6c0..1a52683 100644 --- a/client/src/app/features/toppings/toppings.component.ts +++ b/client/src/app/features/toppings/toppings.component.ts @@ -212,4 +212,11 @@ export class ToppingsComponent implements OnInit { targetDefault?.setValue(member); }; + // boolean checking if default is within the member of set group + isDefaultInMember = (group: string, member: string) => { + // get member from group + // console.log('isDefaultInMember', group, member, this.getMemberByGroupId(group), this.getMemberByGroupId(group).includes(member.toString())); + return this.getMemberByGroupId(group).includes(member.toString()); + }; + }