# HG changeset patch # User Thomas Junk # Date 1623845319 -7200 # Node ID 1b4cb1545a44be06841b15b06148aef82e25b722 # Parent 11e013b8b1a9bed91d729d27f1fcc09b27a96c94 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 diff -r 11e013b8b1a9 -r 1b4cb1545a44 client/src/components/importconfiguration/types/Soundingresults.vue --- 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 [];