changeset 3231:2dab20bed284

show_statistics: refac to fairwayavailability
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 10 May 2019 10:28:37 +0200
parents 128d686c3950
children 86231e847762
files client/src/components/Statistics.vue client/src/components/map/MapPopup.vue client/src/components/toolbar/Statistics.vue client/src/store/application.js
diffstat 4 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/Statistics.vue	Fri May 10 10:13:32 2019 +0200
+++ b/client/src/components/Statistics.vue	Fri May 10 10:28:37 2019 +0200
@@ -2,7 +2,7 @@
   <div
     :class="[
       'box ui-element rounded bg-white text-nowrap',
-      { expanded: showStatistics }
+      { expanded: showFairwayDepth }
     ]"
   >
     <div style="width: 18rem">
@@ -170,7 +170,7 @@
         });
     },
     close() {
-      this.$store.commit("application/showStatistics", false);
+      this.$store.commit("application/showFairwayDepth", false);
     },
     entrySelected() {
       if (this.type === this.$options.BOTTLENECKS) {
@@ -208,7 +208,11 @@
     }
   },
   computed: {
-    ...mapState("application", ["showStatistics", "paneSetup", "showProfiles"]),
+    ...mapState("application", [
+      "showFairwayDepth",
+      "paneSetup",
+      "showProfiles"
+    ]),
     ...mapState("fairwayavailability", [
       "selectedFairwayAvailabilityFeature",
       "from",
--- a/client/src/components/map/MapPopup.vue	Fri May 10 10:13:32 2019 +0200
+++ b/client/src/components/map/MapPopup.vue	Fri May 10 10:28:37 2019 +0200
@@ -199,7 +199,7 @@
       this.close();
     },
     openFairwayAvailability() {
-      this.$store.commit("application/showStatistics", true);
+      this.$store.commit("application/showFairwayDepth", true);
       this.close();
     },
     openFairwayAvailabilityForBottleneck(bottleneck) {
--- a/client/src/components/toolbar/Statistics.vue	Fri May 10 10:13:32 2019 +0200
+++ b/client/src/components/toolbar/Statistics.vue	Fri May 10 10:28:37 2019 +0200
@@ -1,9 +1,9 @@
 <template>
   <div class="toolbar-button" v-tooltip.right="label">
     <font-awesome-icon
-      @click="$store.commit('application/showStatistics', !showStatistics)"
+      @click="$store.commit('application/showFairwayDepth', !showFairwayDepth)"
       icon="chart-line"
-      :class="{ 'text-info': showStatistics }"
+      :class="{ 'text-info': showFairwayDepth }"
     />
   </div>
 </template>
@@ -27,9 +27,9 @@
 
 export default {
   computed: {
-    ...mapState("application", ["showStatistics"]),
+    ...mapState("application", ["showFairwayDepth"]),
     label() {
-      return this.$gettext("Statistics");
+      return this.$gettext("Available fairway depth");
     }
   }
 };
--- a/client/src/store/application.js	Fri May 10 10:13:32 2019 +0200
+++ b/client/src/store/application.js	Fri May 10 10:28:37 2019 +0200
@@ -35,7 +35,7 @@
     showContextBox: false,
     showProfiles: false,
     showGauges: false,
-    showStatistics: false,
+    showFairwayDepth: false,
     contextBoxContent: null, // bottlenecks, imports, staging
     expandToolbar: false,
     countries: ["AT", "SK", "HU", "HR", "RS", "BiH", "BG", "RO", "UA"],
@@ -114,8 +114,8 @@
     showGauges: (state, show) => {
       state.showGauges = show;
     },
-    showStatistics: (state, show) => {
-      state.showStatistics = show;
+    showFairwayDepth: (state, show) => {
+      state.showFairwayDepth = show;
     },
     contextBoxContent: (state, context) => {
       state.contextBoxContent = context;