changeset 3867:d37f44c4d531

client: configuration: moved default values to separate file
author Markus Kottlaender <markus@intevation.de>
date Tue, 09 Jul 2019 16:11:42 +0200
parents 42cd1978b504
children 91b4ca03174e
files client/src/components/systemconfiguration/DataAccuracy.vue client/src/components/systemconfiguration/MorphologyClassbreaks.vue
diffstat 2 files changed, 13 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/systemconfiguration/DataAccuracy.vue	Tue Jul 09 15:42:31 2019 +0200
+++ b/client/src/components/systemconfiguration/DataAccuracy.vue	Tue Jul 09 16:11:42 2019 +0200
@@ -326,6 +326,7 @@
  */
 
 import { mapState } from "vuex";
+import defaults from "./defaults";
 
 export default {
   computed: {
@@ -333,13 +334,15 @@
   },
   methods: {
     reset() {
-      this.config.bn_revtime_multiplier = "1.5";
-      this.config.gm_min_values_14d = "1224";
-      this.config.gm_latest_hours = "24";
-      this.config.gm_forecast_offset_24h = "15";
-      this.config.gm_forecast_offset_72h = "15";
-      this.config.gm_forecast_vs_reality_nsc_24h = "-12.5";
-      this.config.gm_forecast_vs_reality_nsc_72h = "-12.5";
+      this.config.bn_revtime_multiplier = defaults.bn_revtime_multiplier;
+      this.config.gm_min_values_14d = defaults.gm_min_values_14d;
+      this.config.gm_latest_hours = defaults.gm_latest_hours;
+      this.config.gm_forecast_offset_24h = defaults.gm_forecast_offset_24h;
+      this.config.gm_forecast_offset_72h = defaults.gm_forecast_offset_72h;
+      this.config.gm_forecast_vs_reality_nsc_24h =
+        defaults.gm_forecast_vs_reality_nsc_24h;
+      this.config.gm_forecast_vs_reality_nsc_72h =
+        defaults.gm_forecast_vs_reality_nsc_72h;
     },
     submit() {
       this.$store.dispatch("application/saveConfig", {
--- a/client/src/components/systemconfiguration/MorphologyClassbreaks.vue	Tue Jul 09 15:42:31 2019 +0200
+++ b/client/src/components/systemconfiguration/MorphologyClassbreaks.vue	Tue Jul 09 16:11:42 2019 +0200
@@ -258,11 +258,7 @@
  */
 import { mapState } from "vuex";
 import { Chrome } from "vue-color";
-
-const DEFAULT_CLASSBREAKS =
-  "1:#ff00dd,1.5,1.7,1.9,2.1,2.3,2.5:#f25f20,2.7,2.9,3.1:#f7e40e,3.3,3.5,4:#8ad51a,4.5,5,5.5,6,6.5,7:#1414ff";
-const DEFAULT_CLASSBREAKS_COMPARE =
-  "-2:#06b100,-1.9,-1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,-1:#1cc68e,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0:#c2c2c2,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1:#fff01a,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2:#f80012";
+import defaults from "./defaults";
 
 export default {
   components: {
@@ -315,12 +311,12 @@
     },
     resetClassbreaks() {
       this.morphologyClassbreaks = this.parseClassbreakString(
-        DEFAULT_CLASSBREAKS
+        defaults.morphology_classbreaks
       );
     },
     resetClassbreaksCompare() {
       this.morphologyClassbreaksCompare = this.parseClassbreakString(
-        DEFAULT_CLASSBREAKS_COMPARE
+        defaults.morphology_classbreaks_compare
       );
     },
     parseClassbreakString(str) {