changeset 3632:943c454d5633 single-beam

Merged default into single-beam branch.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 11 Jun 2019 14:46:14 +0200
parents 1973fa69b2bb (current diff) 3012d0b3badc (diff)
children cfb4e01f2b7f
files
diffstat 8 files changed, 132 insertions(+), 88 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/systemconfiguration/MapLayers.vue	Wed Jun 05 18:17:01 2019 +0200
+++ b/client/src/components/systemconfiguration/MapLayers.vue	Tue Jun 11 14:46:14 2019 +0200
@@ -9,8 +9,8 @@
             <input
               type="url"
               class="form-control"
-              id="ecdis-url"
               placeholder="https://..."
+              v-model="config.ecdis_url"
             />
           </div>
         </div>
@@ -38,10 +38,16 @@
  * Author(s):
  * Markus Kottländer <markus@intevation.de>
  */
+import { mapState } from "vuex";
 
 export default {
+  computed: {
+    ...mapState("application", ["config"])
+  },
   methods: {
-    submit() {}
+    submit() {
+      this.$store.commit("application/config", this.config);
+    }
   }
 };
 </script>
--- a/client/src/components/systemconfiguration/MorphologyClassbreaks.vue	Wed Jun 05 18:17:01 2019 +0200
+++ b/client/src/components/systemconfiguration/MorphologyClassbreaks.vue	Tue Jun 11 14:46:14 2019 +0200
@@ -8,11 +8,11 @@
       <div class="d-flex flex-wrap">
         <div
           class="input-group mb-3 mr-2 classbreak"
-          v-for="(value, i) in classbreaks"
+          v-for="(value, i) in config.morphology_classbreaks"
           :key="i"
         >
           <input
-            v-model="classbreaks[i]"
+            v-model="config.morphology_classbreaks[i]"
             type="number"
             min="0"
             step="0.1"
@@ -22,7 +22,7 @@
             <button
               class="btn btn-sm btn-outline-secondary"
               type="button"
-              @click="classbreaks.splice(i, 1)"
+              @click="config.morphology_classbreaks.splice(i, 1)"
             >
               <font-awesome-icon icon="times" />
             </button>
@@ -31,8 +31,12 @@
         <button
           class="btn btn-sm btn-success mb-3"
           @click="
-            classbreaks.push(
-              classbreaks.length ? classbreaks[classbreaks.length - 1] : 1
+            config.morphology_classbreaks.push(
+              config.morphology_classbreaks.length
+                ? config.morphology_classbreaks[
+                    config.morphology_classbreaks.length - 1
+                  ]
+                : 1
             )
           "
         >
@@ -47,11 +51,11 @@
       <div class="d-flex flex-wrap">
         <div
           class="input-group mb-3 mr-2 classbreak"
-          v-for="(value, i) in compareClassbreaks"
+          v-for="(value, i) in config.morphology_classbreaks_compare"
           :key="i"
         >
           <input
-            v-model="compareClassbreaks[i]"
+            v-model="config.morphology_classbreaks_compare[i]"
             type="number"
             step="0.1"
             class="form-control form-control-sm"
@@ -60,7 +64,7 @@
             <button
               class="btn btn-sm btn-outline-secondary"
               type="button"
-              @click="classbreaks.splice(i, 1)"
+              @click="config.morphology_classbreaks_compare.splice(i, 1)"
             >
               <font-awesome-icon icon="times" />
             </button>
@@ -69,9 +73,11 @@
         <button
           class="btn btn-sm btn-success mb-3"
           @click="
-            compareClassbreaks.push(
-              compareClassbreaks.length
-                ? compareClassbreaks[compareClassbreaks.length - 1]
+            config.morphology_classbreaks_compare.push(
+              config.morphology_classbreaks_compare.length
+                ? config.morphology_classbreaks_compare[
+                    config.morphology_classbreaks_compare.length - 1
+                  ]
                 : 1
             )
           "
@@ -113,78 +119,16 @@
  * Author(s):
  * Markus Kottländer <markus@intevation.de>
  */
+import { mapState } from "vuex";
 
 export default {
-  data() {
-    return {
-      classbreaks: [
-        1,
-        1.5,
-        1.7,
-        1.9,
-        2.1,
-        2.3,
-        2.5,
-        2.7,
-        2.9,
-        3.1,
-        3.3,
-        3.5,
-        4.0,
-        4.5,
-        5,
-        5.5,
-        6,
-        6.5,
-        7
-      ],
-      compareClassbreaks: [
-        -2,
-        -1.9,
-        -1.8,
-        -1.7,
-        -1.6,
-        -1.5,
-        -1.4,
-        -1.3,
-        -1.2,
-        -1.1,
-        -1,
-        -0.9,
-        -0.8,
-        -0.7,
-        -0.6,
-        -0.5,
-        -0.4,
-        -0.3,
-        -0.2,
-        -0.1,
-        0,
-        0.1,
-        0.2,
-        0.3,
-        0.4,
-        0.5,
-        0.6,
-        0.7,
-        0.8,
-        0.9,
-        1,
-        1.1,
-        1.2,
-        1.3,
-        1.4,
-        1.5,
-        1.6,
-        1.7,
-        1.8,
-        1.9,
-        2
-      ]
-    };
+  computed: {
+    ...mapState("application", ["config"])
   },
   methods: {
-    submit() {}
+    submit() {
+      this.$store.commit("application/config", this.config);
+    }
   }
 };
 </script>
--- a/client/src/store/application.js	Wed Jun 05 18:17:01 2019 +0200
+++ b/client/src/store/application.js	Tue Jun 11 14:46:14 2019 +0200
@@ -144,13 +144,78 @@
       if (!Object.keys(state.config).length) {
         setTimeout(() => {
           commit("config", {
+            ecdis_url: "https://service.d4d-portal.info/wms/",
             bn_revtime_multiplier: 1.5,
             gm_min_values_14d: 1124,
             gm_latest_hours: 24,
             gm_forecast_offset_24h: 15,
             gm_forecast_offset_72h: 15,
             gm_forecast_vs_reality_nsc_24h: -12.5,
-            gm_forecast_vs_reality_nsc_72h: -12.5
+            gm_forecast_vs_reality_nsc_72h: -12.5,
+            morphology_classbreaks: [
+              1,
+              1.5,
+              1.7,
+              1.9,
+              2.1,
+              2.3,
+              2.5,
+              2.7,
+              2.9,
+              3.1,
+              3.3,
+              3.5,
+              4.0,
+              4.5,
+              5,
+              5.5,
+              6,
+              6.5,
+              7
+            ],
+            morphology_classbreaks_compare: [
+              -2,
+              -1.9,
+              -1.8,
+              -1.7,
+              -1.6,
+              -1.5,
+              -1.4,
+              -1.3,
+              -1.2,
+              -1.1,
+              -1,
+              -0.9,
+              -0.8,
+              -0.7,
+              -0.6,
+              -0.5,
+              -0.4,
+              -0.3,
+              -0.2,
+              -0.1,
+              0,
+              0.1,
+              0.2,
+              0.3,
+              0.4,
+              0.5,
+              0.6,
+              0.7,
+              0.8,
+              0.9,
+              1,
+              1.1,
+              1.2,
+              1.3,
+              1.4,
+              1.5,
+              1.6,
+              1.7,
+              1.8,
+              1.9,
+              2
+            ]
           });
         }, 1000);
       }
--- a/schema/demo-data/roles.sql	Wed Jun 05 18:17:01 2019 +0200
+++ b/schema/demo-data/roles.sql	Tue Jun 11 14:46:14 2019 +0200
@@ -29,6 +29,11 @@
     IN ROLE waterway_admin ROLE metamorph LOGIN PASSWORD 'ch2Ris3';
 CREATE ROLE "Andrej Kovačič"
     IN ROLE waterway_admin ROLE metamorph LOGIN PASSWORD 'an2Dre3';
+CREATE ROLE "Željko Popović"
+    IN ROLE waterway_admin ROLE metamorph LOGIN PASSWORD 'ze2Ljko4';
+CREATE ROLE "Boglárka Halász"
+    IN ROLE waterway_admin ROLE metamorph LOGIN PASSWORD 'bo2Glarka6';
+
 
 -- Water Way Users
 CREATE ROLE oana
--- a/schema/demo-data/users.sql	Wed Jun 05 18:17:01 2019 +0200
+++ b/schema/demo-data/users.sql	Tue Jun 11 14:46:14 2019 +0200
@@ -47,6 +47,8 @@
 Milana Božič	SK	bozic@example.com	BOX(16.8444804280001 47.7500064090001,22.5396366780001 49.601779684)
 Vladislav Zupančič	SK	zupancic@example.com	BOX(16.8444804280001 47.7500064090001,22.5396366780001 49.601779684)
 Zuzanna Korošec	SK	korosec@example.com	BOX(16.8444804280001 47.7500064090001,22.5396366780001 49.601779684)
+Željko Popović	RS	popovic@example.com	BOX(18.706318577915 42.9673653726122,21.6567548728357 46.2191909133314)
+Boglárka Halász	HU	halasz@example.com	BOX(16.0284203178465 45.6965827047519,22.9442370225955 48.6142125029487)
 \.
 
 COMMIT;
--- a/schema/gemma.sql	Wed Jun 05 18:17:01 2019 +0200
+++ b/schema/gemma.sql	Tue Jun 11 14:46:14 2019 +0200
@@ -537,7 +537,7 @@
             CHECK(ST_IsValid(CAST(area AS geometry))),
         surtyp varchar REFERENCES survey_types,
         coverage varchar REFERENCES coverage_types,
-        depth_reference varchar(4) NOT NULL, -- REFERENCES depth_references,
+        depth_reference varchar NOT NULL, -- REFERENCES depth_references,
         octree_checksum varchar,
         octree_index bytea,
         staging_done boolean NOT NULL DEFAULT false
--- a/schema/geonames-import/import-geonames.sh	Wed Jun 05 18:17:01 2019 +0200
+++ b/schema/geonames-import/import-geonames.sh	Tue Jun 11 14:46:14 2019 +0200
@@ -16,7 +16,7 @@
 
 ME=$(basename $0)
 MYHOME=$(realpath $(dirname $0))
-CCs="AT BG HR HU RO SK"
+CCs="AT BG HR HU RS RO SK"
 
 # Defaults:
 datadir=$(realpath "$MYHOME/data")
--- a/schema/geoserver_views.sql	Wed Jun 05 18:17:01 2019 +0200
+++ b/schema/geoserver_views.sql	Tue Jun 11 14:46:14 2019 +0200
@@ -1,4 +1,4 @@
-CREATE OR REPLACE VIEW waterway.gauges_geoserver AS
+CREATE OR REPLACE VIEW waterway.gauges_base_view AS
     SELECT
         g.location,
         isrs_asText(g.location) AS isrs_code,
@@ -11,6 +11,7 @@
         g.geodref,
         g.date_info,
         g.source_organization,
+        g.erased,
         r.rwls AS reference_water_levels,
         wl.measure_date AS gm_measuredate,
         wl.water_level AS gm_waterlevel,
@@ -50,8 +51,29 @@
                     BETWEEN current_timestamp
                         AND current_timestamp + '3 days'::interval
                 GROUP BY location) AS fca
-            USING (location)
-    WHERE NOT g.erased;
+            USING (location);
+
+CREATE OR REPLACE VIEW waterway.gauges_geoserver AS
+    SELECT
+        location,
+        isrs_code,
+        objname,
+        geom,
+        applicability_from_km,
+        applicability_to_km,
+        validity,
+        zero_point,
+        geodref,
+        date_info,
+        source_organization,
+        reference_water_levels,
+        gm_measuredate,
+        gm_waterlevel,
+        gm_n_14d,
+        forecast_accuracy_3d,
+        forecast_accuracy_1d
+    FROM waterway.gauges_base_view
+    WHERE NOT erased;
 
 CREATE OR REPLACE VIEW waterway.distance_marks_geoserver AS
     SELECT location_code,
@@ -108,7 +130,7 @@
         g.forecast_accuracy_3d,
         g.forecast_accuracy_1d
     FROM waterway.bottlenecks b
-        LEFT JOIN waterway.gauges_geoserver g
+        LEFT JOIN waterway.gauges_base_view g
             ON b.gauge_location = g.location AND b.gauge_validity = g.validity
         LEFT JOIN fairway_availability_latest fal
             ON b.id = fal.bottleneck_id