# HG changeset patch # User Fadi Abbud # Date 1566832886 -7200 # Node ID 45802eac155b4e9eac54096e952ac4316d6fc0f8 # Parent ac99e13e9ca96164186cb956bf827e491e984899 styles-config: fix sending of values to backend for WMS-Layers * send values only if they changed. diff -r ac99e13e9ca9 -r 45802eac155b client/src/components/systemconfiguration/ColorSettings.vue --- 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 {