changeset 5313:1b4cb1545a44 zpg-exception

Allow ZPG as available depth-reference under stricter rules LDC is present but no ZPG => add ZPG to the list LDC is not present and no ZPG but BN is BG or RO => add ZPG to the list
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 16 Jun 2021 14:08:39 +0200
parents 11e013b8b1a9
children 0e8fd0e5bf36
files client/src/components/importconfiguration/types/Soundingresults.vue
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/importconfiguration/types/Soundingresults.vue	Thu Jun 03 12:14:12 2021 +0200
+++ b/client/src/components/importconfiguration/types/Soundingresults.vue	Wed Jun 16 14:08:39 2021 +0200
@@ -469,11 +469,15 @@
     },
     depthReferenceOptions() {
       if (this.bottleneck) {
+        const bnProperties =this.bottleneck.properties;
         const referenceLevels = JSON.parse(
-          this.bottleneck.properties.reference_water_levels
-        );
+          bnProperties.reference_water_levels
+        )||{};
         const result = Object.keys(referenceLevels);
-        if (!referenceLevels["ZPG"]) result.push("ZPG"); // ZPG should always be available
+        const bottleneckBGorRO = bnProperties.responsible_country=="BG" || bnProperties.responsible_country=="RO";
+        const hasLDC = referenceLevels.hasOwnProperty("LDC");
+        const hasZPG = referenceLevels.hasOwnProperty("ZPG");
+        if (((hasLDC  && !hasZPG) || (!hasLDC && !hasZPG && bottleneckBGorRO)) ) result.push("ZPG");
         return result;
       }
       return [];