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