fix(recipe-list): 🐛 fix recipe not update
- add key alternative to feedParameter and feedPattern
This commit is contained in:
parent
eb8a770147
commit
1633197b92
1 changed files with 33 additions and 14 deletions
|
|
@ -43,6 +43,7 @@ import {
|
||||||
|
|
||||||
import { RecipeToppingComponent } from '../recipe-topping/recipe-topping.component';
|
import { RecipeToppingComponent } from '../recipe-topping/recipe-topping.component';
|
||||||
import Lang from 'src/app/shared/helpers/lang';
|
import Lang from 'src/app/shared/helpers/lang';
|
||||||
|
import { Debugger } from 'src/app/shared/helpers/debugger';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-recipe-list',
|
selector: 'app-recipe-list',
|
||||||
|
|
@ -333,9 +334,15 @@ export class RecipeListComponent implements OnInit, OnChanges {
|
||||||
// --------------- mapping missing data ---------------
|
// --------------- mapping missing data ---------------
|
||||||
|
|
||||||
// map name
|
// map name
|
||||||
console.log("use recipeList input; ", recipeDetailMat);
|
console.log('use recipeList input; ', recipeDetailMat);
|
||||||
console.log("test recipeDetailMat.feedPattern", recipeDetailMat.feedPattern);
|
console.log(
|
||||||
console.log("test recipeDetailMat.feedParameter", recipeDetailMat.feedParameter);
|
'test recipeDetailMat.feedPattern',
|
||||||
|
recipeDetailMat.feedPattern
|
||||||
|
);
|
||||||
|
console.log(
|
||||||
|
'test recipeDetailMat.feedParameter',
|
||||||
|
recipeDetailMat.feedParameter
|
||||||
|
);
|
||||||
|
|
||||||
this.recipeListData.push(
|
this.recipeListData.push(
|
||||||
this._formBuilder.group({
|
this._formBuilder.group({
|
||||||
|
|
@ -405,13 +412,17 @@ export class RecipeListComponent implements OnInit, OnChanges {
|
||||||
],
|
],
|
||||||
feedPattern: [
|
feedPattern: [
|
||||||
{
|
{
|
||||||
value: recipeDetailMat.feedPattern ?? (recipeDetailMat as any).FeedPattern,
|
value:
|
||||||
|
recipeDetailMat.feedPattern ??
|
||||||
|
(recipeDetailMat as any).FeedPattern,
|
||||||
disabled: !this.isEditable(),
|
disabled: !this.isEditable(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
feedParameter: [
|
feedParameter: [
|
||||||
{
|
{
|
||||||
value: recipeDetailMat.feedParameter ?? (recipeDetailMat as any).FeedParameter,
|
value:
|
||||||
|
recipeDetailMat.feedParameter ??
|
||||||
|
(recipeDetailMat as any).FeedParameter,
|
||||||
disabled: !this.isEditable(),
|
disabled: !this.isEditable(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
@ -546,7 +557,7 @@ export class RecipeListComponent implements OnInit, OnChanges {
|
||||||
|
|
||||||
this.stringParams[index] = stringParamList;
|
this.stringParams[index] = stringParamList;
|
||||||
|
|
||||||
console.log("string param debugr")
|
console.log('string param debugr');
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('string param debug change', this.stringParamData);
|
console.log('string param debug change', this.stringParamData);
|
||||||
|
|
@ -627,13 +638,17 @@ export class RecipeListComponent implements OnInit, OnChanges {
|
||||||
],
|
],
|
||||||
feedPattern: [
|
feedPattern: [
|
||||||
{
|
{
|
||||||
value: recipeDetailMat.feedPattern,
|
value:
|
||||||
|
recipeDetailMat.feedPattern ??
|
||||||
|
(recipeDetailMat as any).FeedPattern,
|
||||||
disabled: !this.isEditable(),
|
disabled: !this.isEditable(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
feedParameter: [
|
feedParameter: [
|
||||||
{
|
{
|
||||||
value: recipeDetailMat.feedParameter,
|
value:
|
||||||
|
recipeDetailMat.feedParameter ??
|
||||||
|
(recipeDetailMat as any).FeedParameter,
|
||||||
disabled: !this.isEditable(),
|
disabled: !this.isEditable(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
@ -768,7 +783,7 @@ export class RecipeListComponent implements OnInit, OnChanges {
|
||||||
this.selectedRecipeList.push(i);
|
this.selectedRecipeList.push(i);
|
||||||
console.log('selected recipe list', this.selectedRecipeList);
|
console.log('selected recipe list', this.selectedRecipeList);
|
||||||
|
|
||||||
if(this.displayOnly){
|
if (this.displayOnly) {
|
||||||
// ignore list
|
// ignore list
|
||||||
this.recipeListFormChange.emit(this.selectedRecipeList);
|
this.recipeListFormChange.emit(this.selectedRecipeList);
|
||||||
}
|
}
|
||||||
|
|
@ -1006,7 +1021,7 @@ export class RecipeListComponent implements OnInit, OnChanges {
|
||||||
async openRecipeListEditor(i: number) {
|
async openRecipeListEditor(i: number) {
|
||||||
await Promise.resolve();
|
await Promise.resolve();
|
||||||
if (this.timeoutHandler) {
|
if (this.timeoutHandler) {
|
||||||
console.log("timeout", this.timeout, "display only: ", this.displayOnly);
|
console.log('timeout', this.timeout, 'display only: ', this.displayOnly);
|
||||||
if (this.timeout >= 20 && !this.displayOnly) {
|
if (this.timeout >= 20 && !this.displayOnly) {
|
||||||
// alert("Opening Recipe List Editor in detail")
|
// alert("Opening Recipe List Editor in detail")
|
||||||
if (
|
if (
|
||||||
|
|
@ -1016,12 +1031,12 @@ export class RecipeListComponent implements OnInit, OnChanges {
|
||||||
} else {
|
} else {
|
||||||
this.showDetailRecipeList = false;
|
this.showDetailRecipeList = false;
|
||||||
}
|
}
|
||||||
} else if (this.timeout >= 0 && this.displayOnly){
|
} else if (this.timeout >= 0 && this.displayOnly) {
|
||||||
console.log("Activate add to selection",i)
|
console.log('Activate add to selection', i);
|
||||||
this.addToSelection(i);
|
this.addToSelection(i);
|
||||||
} else if (this.timeout < 10 && !this.displayOnly){
|
} else if (this.timeout < 10 && !this.displayOnly) {
|
||||||
// hayaina! taimu a-uto
|
// hayaina! taimu a-uto
|
||||||
console.log("早お腹(very fast)!タイムアウト(timeout)=", i);
|
console.log('早お腹(very fast)!タイムアウト(timeout)=', i);
|
||||||
this.addToSelection(i);
|
this.addToSelection(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1182,4 +1197,8 @@ export class RecipeListComponent implements OnInit, OnChanges {
|
||||||
this.recipeListData.at(index).get('name')?.setValue(mat_name);
|
this.recipeListData.at(index).get('name')?.setValue(mat_name);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// debugger
|
||||||
|
recipeListDebugger = new Debugger();
|
||||||
|
eval = () => this.recipeListDebugger.eval(this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue