From 4bda3cebdf6e7f81fa24915f29e35b0efdf3a726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= Date: Mon, 5 Jun 2023 16:25:19 -0400 Subject: [PATCH] fix(regex): missing regexes for geoservice --- .../lib/feature/shared/strategies/geo-properties.ts | 13 +++++++------ .../propertyTypeDetector.service.ts | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/geo/src/lib/feature/shared/strategies/geo-properties.ts b/packages/geo/src/lib/feature/shared/strategies/geo-properties.ts index a3cf1bd879..8d74f214f5 100644 --- a/packages/geo/src/lib/feature/shared/strategies/geo-properties.ts +++ b/packages/geo/src/lib/feature/shared/strategies/geo-properties.ts @@ -140,12 +140,13 @@ export class GeoPropertiesStrategy extends EntityStoreStrategy { const [key, values] = entry; values.map(value => { const geoService = this.propertyTypeDetectorService.getGeoService(value, allKeys); - const propertiesForLayerName = allKeys.filter(p => geoService.propertiesForLayerName.includes(p)); - // providing the the first matching regex; - const propertyForLayerName = propertiesForLayerName.length ? propertiesForLayerName[0] : undefined; - if (propertyForLayerName) { - geoServiceAssociations.push({ url: value, urlProperty: key, layerNameProperty: propertyForLayerName, geoService }); - + if (geoService) { + const propertiesForLayerName = allKeys.filter(p => geoService.propertiesForLayerName.includes(p)); + // providing the the first matching regex; + const propertyForLayerName = propertiesForLayerName.length ? propertiesForLayerName[0] : undefined; + if (propertyForLayerName) { + geoServiceAssociations.push({ url: value, urlProperty: key, layerNameProperty: propertyForLayerName, geoService }); + } } }); }); diff --git a/packages/geo/src/lib/utils/propertyTypeDetector/propertyTypeDetector.service.ts b/packages/geo/src/lib/utils/propertyTypeDetector/propertyTypeDetector.service.ts index 14fe071d26..bb6cd4ad38 100644 --- a/packages/geo/src/lib/utils/propertyTypeDetector/propertyTypeDetector.service.ts +++ b/packages/geo/src/lib/utils/propertyTypeDetector/propertyTypeDetector.service.ts @@ -7,7 +7,7 @@ import { GeoServiceDefinition } from './propertyTypeDetector.interface'; }) export class PropertyTypeDetectorService { - public geoServiceRegexes: GeoServiceDefinition[]; + public geoServiceRegexes: GeoServiceDefinition[] = []; constructor( private regexService: RegexService