[SI-2250] sonra budfixes Signed-off-by: Peter Buschmann <peter.buschmann@pta.de>
diff --git a/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-details/grid-failure-details.sandbox.ts b/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-details/grid-failure-details.sandbox.ts index 0484516..5aa749a 100644 --- a/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-details/grid-failure-details.sandbox.ts +++ b/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-details/grid-failure-details.sandbox.ts
@@ -1,4 +1,3 @@ -import { ConfigService } from '@grid-failure-information-app/app/app-config.service'; /******************************************************************************** * Copyright (c) 2020 Contributors to the Eclipse Foundation * @@ -11,6 +10,7 @@ * * SPDX-License-Identifier: EPL-2.0 ********************************************************************************/ +import { ConfigService } from '@grid-failure-information-app/app/app-config.service'; import { Injectable } from '@angular/core'; import { Router } from '@angular/router'; import { SafetyQueryDialogComponent } from '@grid-failure-information-app/shared/components/dialogs/safety-query-dialog/safety-query-dialog.component'; @@ -87,17 +87,26 @@ public addressCommunities$: Observable<Array<string>> = this.actionsSubject.pipe( ofType(gridFailureActions.loadAllAddressCommunitiesSuccess), - map(action => action.payload.sort()), + map(action => { + const stringArray = action.payload; + return stringArray.sort(); + }), takeUntil(this._endSubscriptions$) ); public addressDistricts$: Observable<Array<string>> = this.actionsSubject.pipe( ofType(gridFailureActions.loadAddressDistrictsOfCommunitySuccess), - map(action => action.payload.sort()), + map(action => { + const stringArray = action.payload; + return stringArray.sort(); + }), takeUntil(this._endSubscriptions$) ); public addressStreets$: Observable<Array<string>> = this.actionsSubject.pipe( ofType(gridFailureActions.loadAddressStreetsSuccess), - map(action => action.payload.sort()), + map(action => { + const stringArray = action.payload; + return stringArray.sort(); + }), takeUntil(this._endSubscriptions$) ); public addressHouseNumbers$: Observable<Array<string>> = this.actionsSubject.pipe( @@ -109,7 +118,10 @@ public addressPostCodes$: Observable<Array<string>> = this.actionsSubject.pipe( ofType(gridFailureActions.loadAddressPostalcodesSuccess), - map(action => action.payload.sort(sortAlphaNum)), + map(action => { + const stringArray = action.payload; + return stringArray.sort(sortAlphaNum); + }), takeUntil(this._endSubscriptions$) ); public addressHouseNumbers: Array<models.FailureHousenumber>; @@ -395,7 +407,10 @@ takeUntil(this._endSubscriptions$) ) .subscribe(hnr => { - this.addressHouseNumbers = hnr.length >= 0 && hnr.sort(sortAlphaNum); + if (hnr.length > 0) { + hnr.sort(sortAlphaNum); + this.addressHouseNumbers = hnr; + } }); this.gridFailureDetailsFormState$.pipe(takeUntil(this._endSubscriptions$)).subscribe((formState: FormGroupState<models.GridFailure>) => {