Merge branch 'SI-3105-Spannungsebene-Pflichtfeld' of ssh://git.eclipse.org:29418/openk-usermodules/org.eclipse.openk-usermodules.gridFailureInformation.frontend into DEVELOP
diff --git a/projects/grid-failure-information-app/src/app/shared/store/effects/grid-failures.effect.ts b/projects/grid-failure-information-app/src/app/shared/store/effects/grid-failures.effect.ts
index c5c50dc..ca6a198 100644
--- a/projects/grid-failure-information-app/src/app/shared/store/effects/grid-failures.effect.ts
+++ b/projects/grid-failure-information-app/src/app/shared/store/effects/grid-failures.effect.ts
@@ -12,13 +12,13 @@
********************************************************************************/
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
-import 'rxjs/add/operator/switchMap';
+import 'rxjs/add/operator/exhaustMap';
import { Injectable } from '@angular/core';
import { createEffect, Actions, ofType } from '@ngrx/effects';
import { of } from 'rxjs/observable/of';
import * as gridFailureActions from '@grid-failure-information-app/shared/store/actions/grid-failures.action';
import { GridFailureApiClient } from '@grid-failure-information-app/pages/grid-failure/grid-failure-api-client';
-import { catchError, map, switchMap, exhaustMap } from 'rxjs/operators';
+import { catchError, map, exhaustMap } from 'rxjs/operators';
import {
GridFailure,
FailureClassification,
@@ -34,14 +34,14 @@
} from '@grid-failure-information-app/shared/models';
import { Store } from '@ngrx/store';
import { Observable } from 'rxjs/internal/Observable';
-import { sortItems} from '@grid-failure-information-app/shared/utility';
+import { sortItems } from '@grid-failure-information-app/shared/utility';
@Injectable()
export class GridFailuresEffects {
getGridFailures$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadGridFailures),
- switchMap(() => {
+ exhaustMap(() => {
return this._apiClient.getGridFailures().pipe(
map(item => gridFailureActions.loadGridFailuresSuccess({ payload: item })),
catchError(error => of(gridFailureActions.loadGridFailuresFail({ payload: error })))
@@ -53,7 +53,7 @@
getGridFailureDetails$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadGridFailureDetail),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getGridFailureDetails(action.payload)
.map((gridFailureDetails: GridFailure) => gridFailureActions.loadGridFailureDetailSuccess({ payload: gridFailureDetails }))
@@ -83,7 +83,7 @@
deleteGridFailure$: any = createEffect(() => {
return this._actions$.pipe(
ofType(gridFailureActions.deleteGridFailure),
- switchMap(action => {
+ exhaustMap(action => {
const httpResult$ = this._apiClient.deleteGridFailure(action.gridFailureId);
const error$ = error => of(gridFailureActions.deleteGridFailureFail({ error: error }));
return httpResult$.pipe(
@@ -97,7 +97,7 @@
getGridFailureVersions$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadGridFailureVersions),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getGridFailureVersions(action.payload)
.map((gridFailureVersions: GridFailure[]) => gridFailureActions.loadGridFailureVersionsSuccess({ payload: gridFailureVersions }))
@@ -109,7 +109,7 @@
getGridFailureVersion$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadGridFailureVersion),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getGridFailureVersion(action.gridFailureId, action.versionNumber)
.map((gridFailureVersion: GridFailure) => {
@@ -124,7 +124,7 @@
getGridFailureBranches$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadGridFailureBranches),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getGridFailureBranches()
.map((branches: FailureBranch[]) => gridFailureActions.loadGridFailureBranchesSuccess({ payload: branches }))
@@ -136,7 +136,7 @@
getGridFailureClassifications$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadGridFailureClassifications),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getGridFailureClassifications()
.map((classifications: FailureClassification[]) => gridFailureActions.loadGridFailureClassificationsSuccess({ payload: classifications }))
@@ -148,7 +148,7 @@
getGridFailureStates$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadGridFailureStates),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getGridFailureStates()
.map((states: FailureState[]) => gridFailureActions.loadGridFailureStatesSuccess({ payload: states }))
@@ -160,7 +160,7 @@
getGridFailureRadii$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadGridFailureRadii),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getGridFailureRadii()
.map((response: FailureRadius[]) => gridFailureActions.loadGridFailureRadiiSuccess({ payload: response }))
@@ -172,7 +172,7 @@
getGridFailureExpectedReasons$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadGridFailureExpectedReasons),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getGridFailureExpectedReasons(action.payload)
.map((response: FailureExpectedReason[]) => gridFailureActions.loadGridFailureExpectedReasonsSuccess({ payload: response }))
@@ -200,7 +200,7 @@
getCondensedGridFailures$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadCondensedGridFailures),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient.getCondensedGridFailures(action.payload).pipe(
map(item => gridFailureActions.loadCondensedGridFailuresSuccess({ payload: item })),
catchError(error => of(gridFailureActions.loadCondensedGridFailuresFail({ payload: error })))
@@ -212,7 +212,7 @@
putGridFailuresCondensation$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.putGridFailuresCondensation),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient.putGridFailuresCondensation(action.gridFailureId, action.payload).pipe(
map((items: GridFailure[]) => {
this._store.dispatch(gridFailureActions.loadGridFailures());
@@ -227,7 +227,7 @@
getStations$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadStations),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getStations()
.map((response: FailureStation[]) => gridFailureActions.loadStationsSuccess({ payload: response }))
@@ -239,7 +239,7 @@
getGridFailurePolygon$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadGridFailurePolygon),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getGridFailurePolygon(action.payload)
.map((gridFailurePolygon: Array<[number, number]>) => gridFailureActions.loadGridFailurePolygonSuccess({ payload: gridFailurePolygon }))
@@ -251,7 +251,7 @@
getGridFailureStations$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadGridFailureStations),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getGridFailureStations(action.payload)
.map((response: FailureStation[]) => gridFailureActions.loadGridFailureStationsSuccess({ payload: response }))
@@ -263,7 +263,7 @@
getHistGridFailureStations$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadHistGridFailureStations),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getHistGridFailureStations(action.failureId, action.versionNumber)
.map((response: FailureStation[]) => gridFailureActions.loadHistGridFailureStationsSuccess({ payload: response }))
@@ -276,7 +276,7 @@
let gridFailureId: string = '';
return this._actions$.pipe(
ofType(gridFailureActions.postGridFailureStation),
- switchMap(action => {
+ exhaustMap(action => {
gridFailureId = action.gridFailureDetailId;
return this._apiClient.postGridFailureStation(action.gridFailureDetailId, action.station).pipe(
map(() => {
@@ -293,7 +293,7 @@
let gridFailureId: string = '';
return this._actions$.pipe(
ofType(gridFailureActions.deleteGridFailureStation),
- switchMap(action => {
+ exhaustMap(action => {
gridFailureId = action.gridFailureDetailId;
return this._apiClient.deleteGridFailureStation(action.gridFailureDetailId, action.stationId).pipe(
map(() => {
@@ -309,7 +309,7 @@
getAddressPostalcodes$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadAddressPostalcodes),
- switchMap(action => {
+ exhaustMap(action => {
if (!action.community || !action.district) {
return of(gridFailureActions.loadAddressPostalcodesSuccess({ payload: [] }));
}
@@ -324,7 +324,7 @@
getAllAddressCommunities$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadAllAddressCommunities),
- switchMap(action => {
+ exhaustMap(action => {
const allAdressCommunities: Observable<string[]> = this._apiClient.getAllAddressCommunities(action.branch);
return allAdressCommunities
.map((response: string[]) => sortItems(gridFailureActions.loadAllAddressCommunitiesSuccess({ payload: response })))
@@ -336,7 +336,7 @@
getAddressDistricts$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadAddressDistrictsOfCommunity),
- switchMap(action => {
+ exhaustMap(action => {
if (!action.community) {
return of(gridFailureActions.loadAddressDistrictsOfCommunitySuccess({ payload: [] }));
}
@@ -351,7 +351,7 @@
getAddressStreets$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadAddressStreets),
- switchMap(action => {
+ exhaustMap(action => {
if (!action.postcode || !action.community || !action.district) {
return of(gridFailureActions.loadAddressStreetsSuccess({ payload: [] }));
}
@@ -366,7 +366,7 @@
getAddressHousenumbers$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadAddressHouseNumbers),
- switchMap(action => {
+ exhaustMap(action => {
if (!action.postcode || !action.community || !action.street) {
return of(gridFailureActions.loadAddressHouseNumbersSuccess({ payload: [] }));
}
@@ -381,7 +381,7 @@
getGridFailureAddress$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadGridFailureAddress),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getAddress(action.payload)
.map((gridFailureAddress: FailureAddress) => gridFailureActions.loadGridFailureAddressSuccess({ payload: gridFailureAddress }))
@@ -393,7 +393,7 @@
getGridFailureDistributionGroups$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadGridFailureDistributionGroups),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getGridFailureDistributionGroups(action.payload)
.map((distributionGroups: DistributionGroup[]) => gridFailureActions.loadGridFailureDistributionGroupsSuccess({ payload: distributionGroups }))
@@ -405,7 +405,7 @@
createDistributionGroupAssignment$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.createDistributionGroupAssignment),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient.postDistributionGroupAssignment(action.gridFailureId, action.newGroup).pipe(
map(item => {
this._store.dispatch(gridFailureActions.loadGridFailureDistributionGroups({ payload: action.gridFailureId }));
@@ -420,7 +420,7 @@
deleteDistributionGroupAssignment$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.deleteDistributionGroupAssignment),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient.deleteDistributionGroupAssignment(action.gridFailureId, action.groupId).pipe(
map(item => {
this._store.dispatch(gridFailureActions.loadGridFailureDistributionGroups({ payload: action.gridFailureId }));
@@ -435,7 +435,7 @@
getGridFailurePublicationChannels$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadGridFailurePublicationChannels),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getGridFailurePublicationChannels(action.payload)
.map((publicationChannels: PublicationChannel[]) => gridFailureActions.loadGridFailurePublicationChannelsSuccess({ payload: publicationChannels }))
@@ -447,7 +447,7 @@
createPublicationChannelAssignment$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.createPublicationChannelAssignment),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient.postPublicationChannelAssignment(action.gridFailureId, action.channel).pipe(
map(item => {
this._store.dispatch(gridFailureActions.loadGridFailurePublicationChannels({ payload: action.gridFailureId }));
@@ -462,7 +462,7 @@
deletePublicationChannelAssignment$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.deletePublicationChannelAssignment),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient.deletePublicationChannelAssignment(action.gridFailureId, action.channel).pipe(
map(item => {
this._store.dispatch(gridFailureActions.loadGridFailurePublicationChannels({ payload: action.gridFailureId }));
@@ -477,7 +477,7 @@
getFailureReminder$: any = createEffect(() =>
this._actions$.pipe(
ofType(gridFailureActions.loadFailureReminder),
- switchMap(action => {
+ exhaustMap(action => {
return this._apiClient
.getFailureReminder()
.map((isReminderActive: boolean) => gridFailureActions.loadFailureReminderSuccess({ payload: isReminderActive }))
diff --git a/projects/openk/grid-failure-information-map/src/lib/grid-failure-information-map.component.ts b/projects/openk/grid-failure-information-map/src/lib/grid-failure-information-map.component.ts
index b2b0afa..9bd7343 100644
--- a/projects/openk/grid-failure-information-map/src/lib/grid-failure-information-map.component.ts
+++ b/projects/openk/grid-failure-information-map/src/lib/grid-failure-information-map.component.ts
@@ -151,7 +151,7 @@
determineDetailFieldVisibility(this._mapOptions.visibilityConfiguration, 'mapExternTooltipVisibility', 'postcode');
let postcodeString = postcodeVisibility
? ` ${Globals.BREAK_TAG}${Globals.STRONG_BEGIN_TAG}${Globals.GRID_FAILURE_ZIP}${Globals.STRONG_END_TAG} ${
- !!gridFailure.postcode ? gridFailure.postcode : ''
+ !!gridFailure.postcode ? gridFailure.postcode : !!gridFailure.freetextPostcode ? gridFailure.freetextPostcode : ''
}`
: '';
let cityVisibility =
@@ -159,7 +159,7 @@
determineDetailFieldVisibility(this._mapOptions.visibilityConfiguration, 'mapExternTooltipVisibility', 'city');
let cityString = cityVisibility
? ` ${Globals.BREAK_TAG}${Globals.STRONG_BEGIN_TAG}${Globals.GRID_FAILURE_CITY}${Globals.STRONG_END_TAG} ${
- !!gridFailure.city ? gridFailure.city : ''
+ !!gridFailure.city ? gridFailure.city : !!gridFailure.freetextCity ? gridFailure.freetextCity : ''
}`
: '';
let districtVisibility =
@@ -167,7 +167,7 @@
determineDetailFieldVisibility(this._mapOptions.visibilityConfiguration, 'mapExternTooltipVisibility', 'district');
let districtString = districtVisibility
? ` ${Globals.BREAK_TAG}${Globals.STRONG_BEGIN_TAG}${Globals.GRID_FAILURE_DISTRICT}${Globals.STRONG_END_TAG} ${
- !!gridFailure.district ? gridFailure.district : ''
+ !!gridFailure.district ? gridFailure.district : !!gridFailure.freetextDistrict ? gridFailure.freetextDistrict : ''
}`
: '';
/* tooltip assembly */
diff --git a/projects/openk/grid-failure-information-map/src/shared/models/grid-failure-coordinates.model.ts b/projects/openk/grid-failure-information-map/src/shared/models/grid-failure-coordinates.model.ts
index 118b5f5..1a40bdc 100644
--- a/projects/openk/grid-failure-information-map/src/shared/models/grid-failure-coordinates.model.ts
+++ b/projects/openk/grid-failure-information-map/src/shared/models/grid-failure-coordinates.model.ts
@@ -26,6 +26,9 @@
public postcode: string = null;
public city: string = null;
public district: string = null;
+ public freetextPostcode: string = null;
+ public freetextCity: string = null;
+ public freetextDistrict: string = null;
public constructor(data: any = null) {
Object.keys(data || {})