comparison client/src/components/importconfiguration/types/Soundingresults.vue @ 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 6b054b91d9b2
children 08dc7e5de1f5
comparison
equal deleted inserted replaced
5312:11e013b8b1a9 5313:1b4cb1545a44
467 ); 467 );
468 } 468 }
469 }, 469 },
470 depthReferenceOptions() { 470 depthReferenceOptions() {
471 if (this.bottleneck) { 471 if (this.bottleneck) {
472 const bnProperties =this.bottleneck.properties;
472 const referenceLevels = JSON.parse( 473 const referenceLevels = JSON.parse(
473 this.bottleneck.properties.reference_water_levels 474 bnProperties.reference_water_levels
474 ); 475 )||{};
475 const result = Object.keys(referenceLevels); 476 const result = Object.keys(referenceLevels);
476 if (!referenceLevels["ZPG"]) result.push("ZPG"); // ZPG should always be available 477 const bottleneckBGorRO = bnProperties.responsible_country=="BG" || bnProperties.responsible_country=="RO";
478 const hasLDC = referenceLevels.hasOwnProperty("LDC");
479 const hasZPG = referenceLevels.hasOwnProperty("ZPG");
480 if (((hasLDC && !hasZPG) || (!hasLDC && !hasZPG && bottleneckBGorRO)) ) result.push("ZPG");
477 return result; 481 return result;
478 } 482 }
479 return []; 483 return [];
480 } 484 }
481 }, 485 },