Skip to content
Snippets Groups Projects

SI-3234 fix loading of distribution groups

Files
3
@@ -67,7 +67,7 @@ export class GridFailureDetailsSandbox extends BaseFormSandbox<models.GridFailur
public stations$: Observable<models.FailureStation[]> = this.appState$.select(store.getStationsData);
public gridFailureStations$: Observable<models.FailureStation[]> = this.appState$.select(store.getGridFailureStationsData);
public histGridFailureStations$: Observable<models.FailureStation[]> = this.actionsSubject.pipe(
ofType(gridFailureActions.loadHistGridFailureStationsSuccess.type),
ofType(gridFailureActions.loadHistGridFailureStationsSuccess),
map(action => action['payload'])
);
public gridFailurePolygon$: Observable<Array<{ stationId: string; polygonCoordinatesList: Array<[Number, Number]> }>> = this.appState$.select(
@@ -196,7 +196,7 @@ export class GridFailureDetailsSandbox extends BaseFormSandbox<models.GridFailur
combineLatest([
this.actionsSubject
.pipe(
ofType(...[gridFailureActions.loadGridFailureDetailSuccess.type]),
ofType(gridFailureActions.loadGridFailureDetailSuccess),
map(action => action['payload'])
)
.pipe(map((formState: any) => formState.value)),
@@ -414,6 +414,16 @@ export class GridFailureDetailsSandbox extends BaseFormSandbox<models.GridFailur
this._assignedDistributionGroups = assignedGroups;
});
this.appState$.dispatch(distributionGroupActions.loadDistributionGroups());
this.actionsSubject
.pipe(
ofType(distributionGroupActions.loadDistributionGroupsSuccess),
take(1),
map(action => action.payload),
takeUntil(this._endSubscriptions$)
)
.subscribe((distributionGroups: Array<models.DistributionGroup>) => {
this.distributionGroups = distributionGroups;
});
}
public loadGridFailureVersion(versionNumber: string): void {
Loading