change display, add StringParam (WIP)
This commit is contained in:
parent
dd1c072201
commit
98341d2d80
11 changed files with 352 additions and 125 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { CommonModule, DatePipe } from '@angular/common';
|
||||
import { Component, EventEmitter, OnInit } from '@angular/core';
|
||||
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
||||
import { FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
||||
import {Observable, first, map} from 'rxjs';
|
||||
import { RecipeService } from 'src/app/core/services/recipe.service';
|
||||
|
|
@ -41,7 +41,8 @@ import { RecipeToppingsetComponent } from "./recipe-toppingset/recipe-toppingset
|
|||
ConfirmModal,
|
||||
DatePipe,
|
||||
RecipeListComponent,
|
||||
RecipeToppingsetComponent
|
||||
RecipeToppingsetComponent,
|
||||
FormsModule
|
||||
]
|
||||
})
|
||||
export class RecipeDetailsComponent implements OnInit {
|
||||
|
|
@ -71,7 +72,8 @@ export class RecipeDetailsComponent implements OnInit {
|
|||
private _userService: UserService
|
||||
) {}
|
||||
|
||||
productCode!: string;
|
||||
productCode!: any;
|
||||
changedProductCode: string | undefined = undefined;
|
||||
|
||||
recipeDetailForm = this._formBuilder.group({
|
||||
productCode: '',
|
||||
|
|
@ -111,7 +113,7 @@ export class RecipeDetailsComponent implements OnInit {
|
|||
|
||||
this._toppingService.getToppingsOfRecipe(this.department, this._recipeService.getCurrentFile(), this.productCode).subscribe((data) => {
|
||||
this.toppingSet = data;
|
||||
console.log('Toppings', data);
|
||||
// console.log('Toppings', data);
|
||||
})
|
||||
|
||||
// snap recipe detail form value
|
||||
|
|
@ -147,7 +149,7 @@ export class RecipeDetailsComponent implements OnInit {
|
|||
let to_send = {
|
||||
edit_by: username,
|
||||
commit_msg: this.commit_msg,
|
||||
productCode: this.productCode,
|
||||
productCode: this.changedProductCode == undefined ? this.productCode : this.changedProductCode,
|
||||
name: this.recipeDetailForm.getRawValue().name != this.recipeOriginalDetail.name ? this.recipeDetailForm.getRawValue().name : this.recipeOriginalDetail.name,
|
||||
otherName: this.recipeDetailForm.getRawValue().otherName != this.recipeOriginalDetail.otherName ? this.recipeDetailForm.getRawValue().otherName : this.recipeOriginalDetail.otherName,
|
||||
description: this.recipeDetailForm.getRawValue().description != this.recipeOriginalDetail.description ? this.recipeDetailForm.getRawValue().description : this.recipeOriginalDetail.description,
|
||||
|
|
@ -225,7 +227,7 @@ export class RecipeDetailsComponent implements OnInit {
|
|||
}
|
||||
|
||||
onToppingListChange(tpl: unknown[]) {
|
||||
console.log('Topping List Form Changed', tpl);
|
||||
// console.log('Topping List Form Changed', tpl);
|
||||
this.tpl = tpl as never[];
|
||||
this.isValueChanged ||= tpl != undefined;
|
||||
|
||||
|
|
@ -235,4 +237,10 @@ export class RecipeDetailsComponent implements OnInit {
|
|||
return this._userService.getCurrentUser()!.permissions.includes(UserPermissions.EDITOR);
|
||||
}
|
||||
|
||||
|
||||
onProductCodeChange(event: any) {
|
||||
if(event.target.value != ""){
|
||||
this.changedProductCode = event.target.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue