From d4dee96823017cdb04e016fc339eb7ad7becf973 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Thu, 13 Mar 2025 13:05:28 +0100 Subject: [PATCH] Geospatial maps: Angular control flow refactor --- .../browse-by-geospatial-data.component.html | 4 +-- .../geospatial-item-page-field.component.html | 22 ++++++++-------- .../metadata-field-wrapper.component.html | 10 +++++--- .../object-collection.component.html | 7 +++++- .../object-collection.component.ts | 3 ++- .../object-geospatial-map.component.html | 8 +++--- .../view-mode-switch.component.html | 25 +++++++++++-------- 7 files changed, 46 insertions(+), 33 deletions(-) diff --git a/src/app/browse-by/browse-by-geospatial-data/browse-by-geospatial-data.component.html b/src/app/browse-by/browse-by-geospatial-data/browse-by-geospatial-data.component.html index 66f160cac3..4d563f30b8 100644 --- a/src/app/browse-by/browse-by-geospatial-data/browse-by-geospatial-data.component.html +++ b/src/app/browse-by/browse-by-geospatial-data/browse-by-geospatial-data.component.html @@ -1,11 +1,11 @@

{{ 'browse.metadata.map' | translate }}

- + @if (isPlatformBrowser(platformId)) { - + }
diff --git a/src/app/item-page/simple/field-components/specific-field/geospatial/geospatial-item-page-field.component.html b/src/app/item-page/simple/field-components/specific-field/geospatial/geospatial-item-page-field.component.html index 32a6140eb0..8382fdcb36 100644 --- a/src/app/item-page/simple/field-components/specific-field/geospatial/geospatial-item-page-field.component.html +++ b/src/app/item-page/simple/field-components/specific-field/geospatial/geospatial-item-page-field.component.html @@ -1,10 +1,12 @@ -
- - - - -
+@if (isNotEmpty(points) || isNotEmpty(bboxes)) { +
+ + + + +
+} diff --git a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.html b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.html index 71ab7d375e..62abfc6219 100644 --- a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.html +++ b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.html @@ -1,6 +1,8 @@
-

{{ label }}

-
- -
+ @if (label) { +

{{ label }}

+
+ +
+ }
diff --git a/src/app/shared/object-collection/object-collection.component.html b/src/app/shared/object-collection/object-collection.component.html index efed2d968b..10378ba3f5 100644 --- a/src/app/shared/object-collection/object-collection.component.html +++ b/src/app/shared/object-collection/object-collection.component.html @@ -1,4 +1,9 @@ -@if ((currentMode$ | async) === viewModeEnum.ListElement) { +@if ((currentMode$ | async) === viewModeEnum.GeospatialMap) { + + +} + +@if ((currentMode$ | async) === viewModeEnum.ListElement || (currentMode$ | async) === viewModeEnum.GeospatialMap) { - - - - +@if (isPlatformBrowser(platformId)) { + +} diff --git a/src/app/shared/view-mode-switch/view-mode-switch.component.html b/src/app/shared/view-mode-switch/view-mode-switch.component.html index e2c9bc5321..7183130904 100644 --- a/src/app/shared/view-mode-switch/view-mode-switch.component.html +++ b/src/app/shared/view-mode-switch/view-mode-switch.component.html @@ -39,16 +39,21 @@ class="btn btn-secondary" [attr.data-test]="'detail-view' | dsBrowserOnly"> - + @if (isToShow(viewModeEnum.GeospatialMap)) { + + } }