changeset 4262:45802eac155b

styles-config: fix sending of values to backend for WMS-Layers * send values only if they changed.
author Fadi Abbud <fadi.abbud@intevation.de>
date Mon, 26 Aug 2019 17:21:26 +0200
parents ac99e13e9ca9
children f9c620cf0dd3
files client/src/components/systemconfiguration/ColorSettings.vue
diffstat 1 files changed, 18 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/systemconfiguration/ColorSettings.vue	Mon Aug 26 16:18:11 2019 +0200
+++ b/client/src/components/systemconfiguration/ColorSettings.vue	Mon Aug 26 17:21:26 2019 +0200
@@ -243,6 +243,12 @@
         fillC = feature.fillColor
           ? feature.fillColor.hex8 || feature.fillColor
           : initFColor;
+      // Now we do not handle alpha-color value for WMS-Layers
+      // ToDo: implementation in front-backend.
+      let strokeCForWMS = feature.strokeColor.hex || feature.strokeColor,
+        fillCForWMS = feature.fillColor
+          ? feature.fillColor.hex || feature.fillColor
+          : initFColor;
       let noChangeMsg = name => {
         displayInfo({
           title: name + ":",
@@ -362,11 +368,10 @@
           break;
         }
         case "Waterway Axis": {
-          if (strokeC !== this.config.waterway_axis_stroke) {
+          if (strokeCForWMS !== this.config.waterway_axis_stroke) {
             this.$store
               .dispatch("application/saveConfig", {
-                waterway_axis_stroke:
-                  feature.strokeColor.hex || feature.strokeColor
+                waterway_axis_stroke: strokeCForWMS
               })
               .finally(() => {
                 this.$store.dispatch("application/loadConfig");
@@ -377,11 +382,10 @@
           break;
         }
         case "Waterway Area": {
-          if (strokeC !== this.config.waterway_area_stroke) {
+          if (strokeCForWMS !== this.config.waterway_area_stroke) {
             this.$store
               .dispatch("application/saveConfig", {
-                waterway_area_stroke:
-                  feature.strokeColor.hex || feature.strokeColor
+                waterway_area_stroke: strokeCForWMS
               })
               .finally(() => {
                 this.$store.dispatch("application/loadConfig");
@@ -393,14 +397,13 @@
         }
         case "Distance Marks, Axis": {
           if (
-            strokeC !== this.config.distance_marks_stroke ||
-            fillC !== this.config.distance_marks_fill
+            strokeCForWMS !== this.config.distance_marks_stroke ||
+            fillCForWMS !== this.config.distance_marks_fill
           ) {
             this.$store
               .dispatch("application/saveConfig", {
-                distance_marks_stroke:
-                  feature.strokeColor.hex || feature.strokeColor,
-                distance_marks_fill: feature.fillColor.hex || feature.fillColor
+                distance_marks_stroke: strokeCForWMS,
+                distance_marks_fill: fillCForWMS
               })
               .finally(() => this.$store.dispatch("application/loadConfig"));
           } else {
@@ -410,15 +413,13 @@
         }
         case "Distance Marks": {
           if (
-            strokeC !== this.config.distance_marks_ashore_stroke ||
-            fillC !== this.config.distance_marks_ashore_fill
+            strokeCForWMS !== this.config.distance_marks_ashore_stroke ||
+            fillCForWMS !== this.config.distance_marks_ashore_fill
           ) {
             this.$store
               .dispatch("application/saveConfig", {
-                distance_marks_ashore_stroke:
-                  feature.strokeColor.hex || feature.strokeColor,
-                distance_marks_ashore_fill:
-                  feature.fillColor.hex || feature.fillColor
+                distance_marks_ashore_stroke: strokeCForWMS,
+                distance_marks_ashore_fill: fillCForWMS
               })
               .finally(() => this.$store.dispatch("application/loadConfig"));
           } else {