Added formula editor (Fixes #12)
This commit is contained in:
parent
dbd269a995
commit
cf04bfc799
@ -51,6 +51,10 @@ export class FormulaManagerComponent {
|
||||
return cost;
|
||||
}
|
||||
|
||||
edit(formula) {
|
||||
this.dialog.open(NewFormulaComponent, {data: formula});
|
||||
}
|
||||
|
||||
delete(formula) {
|
||||
this.dialog.open(DeleteComponent, {data: formula});
|
||||
}
|
||||
|
@ -26,6 +26,14 @@ export class NewFormulaComponent {
|
||||
@Inject(MAT_DIALOG_DATA) public data
|
||||
) {
|
||||
this.store.components.subscribe(rows => (this.componentsList = rows));
|
||||
|
||||
if (this.data) {
|
||||
this.name = this.data.name;
|
||||
this.approved = this.data.approved;
|
||||
this.components = this.data.components.map(row => {
|
||||
return {component: row.component.id, name: row.component.name, quantity: row.quantity};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
add() {
|
||||
|
Loading…
Reference in New Issue
Block a user