# HG changeset patch # User Thomas Junk # Date 1560872668 -7200 # Node ID 3138836bf84027f39257f224bacb29f34b063d7f # Parent afc8ac7001ee8f9f08c5d311207df123cdda3ba7 import_soundingresults: bottlenecks grouped by countrycode diff -r afc8ac7001ee -r 3138836bf840 client/src/components/importconfiguration/types/Soundingresults.vue --- a/client/src/components/importconfiguration/types/Soundingresults.vue Tue Jun 18 17:04:45 2019 +0200 +++ b/client/src/components/importconfiguration/types/Soundingresults.vue Tue Jun 18 17:44:28 2019 +0200 @@ -13,14 +13,21 @@ Bottleneck - @@ -356,6 +363,30 @@ availableBottlenecks() { return this.bottlenecks; }, + placeholder() { + return this.$gettext("Select bottleneck"); + }, + orderedBottlenecks() { + let groupedBottlenecks = {}, + orderedGroups = {}; + + // group bottlenecks by cc + this.availableBottlenecks.forEach(bn => { + let cc = bn.properties.responsible_country; + if (groupedBottlenecks.hasOwnProperty(cc)) { + groupedBottlenecks[cc].push(bn); + } else { + groupedBottlenecks[cc] = [bn]; + } + }); + + // order groups by cc + Object.keys(groupedBottlenecks) + .sort() + .forEach(cc => (orderedGroups[cc] = groupedBottlenecks[cc])); + + return orderedGroups; + }, editState() { return this.importState === IMPORTSTATE.EDIT; }, diff -r afc8ac7001ee -r 3138836bf840 client/src/store/bottlenecks.js --- a/client/src/store/bottlenecks.js Tue Jun 18 17:04:45 2019 +0200 +++ b/client/src/store/bottlenecks.js Tue Jun 18 17:44:28 2019 +0200 @@ -175,7 +175,12 @@ featurePrefix: "gemma", featureTypes: ["bottlenecks_geoserver"], outputFormat: "application/json", - propertyNames: ["objnam", "limiting", "reference_water_levels"] + propertyNames: [ + "objnam", + "responsible_country", + "limiting", + "reference_water_levels" + ] }); HTTP.post( "/internal/wfs",