fix: select actions button was mapping to enitity[0].actions

This commit is contained in:
Pushpendra Kumar
2024-01-08 10:02:59 +01:00
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.
*/
constructor(public dialogRef: MatDialogRef<AddEventDialogComponent>,
public formBuilder: UntypedFormBuilder,
@Inject(MAT_DIALOG_DATA) public data: any) {
public formBuilder: UntypedFormBuilder,
@Inject(MAT_DIALOG_DATA) public data: any) {
}
/**
@@ -59,7 +59,7 @@ export class AddEventDialogComponent implements OnInit {
setEntityListener() {
this.eventForm.get('entity').valueChanges
.subscribe(changedEntity => {
this.actionData = this.entityData[0].actions;
this.actionData = this.entityData.find((entity: any) => entity.name === changedEntity).actions;
});
}