fix: select actions button was mapping to enitity[0].actions
This commit is contained in:
committed by
Adam Saghy
parent
0ea3eda488
commit
6edb262028
@@ -26,8 +26,8 @@ export class AddEventDialogComponent implements OnInit {
|
|||||||
* @param {any} data Provides grouping, entities and actions data to fill dropdowns.
|
* @param {any} data Provides grouping, entities and actions data to fill dropdowns.
|
||||||
*/
|
*/
|
||||||
constructor(public dialogRef: MatDialogRef<AddEventDialogComponent>,
|
constructor(public dialogRef: MatDialogRef<AddEventDialogComponent>,
|
||||||
public formBuilder: UntypedFormBuilder,
|
public formBuilder: UntypedFormBuilder,
|
||||||
@Inject(MAT_DIALOG_DATA) public data: any) {
|
@Inject(MAT_DIALOG_DATA) public data: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,7 +59,7 @@ export class AddEventDialogComponent implements OnInit {
|
|||||||
setEntityListener() {
|
setEntityListener() {
|
||||||
this.eventForm.get('entity').valueChanges
|
this.eventForm.get('entity').valueChanges
|
||||||
.subscribe(changedEntity => {
|
.subscribe(changedEntity => {
|
||||||
this.actionData = this.entityData[0].actions;
|
this.actionData = this.entityData.find((entity: any) => entity.name === changedEntity).actions;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user