Mercurial > gemma
annotate client/src/components/systemconfiguration/MorphologyClassbreaks.vue @ 5560:f2204f91d286
Join the log lines of imports to the log exports to recover data from them.
Used in SR export to extract information that where in the meta json
but now are only found in the log.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 09 Feb 2022 18:34:40 +0100 |
parents | 2e19ed576c68 |
children | 84d01a536bec |
rev | line source |
---|---|
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
3889
851c0ccba59b
client: configuration: separated sections in tabs
Markus Kottlaender <markus@intevation.de>
parents:
3867
diff
changeset
|
2 <div class="d-flex flex-column py-4"> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
3 <div class="px-3"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
4 <h6 class="font-weight-bold"><translate>Sounding Result</translate></h6> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
5 <div class="d-flex flex-wrap"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
6 <div |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
7 class="input-group mb-3 mr-2 classbreak" |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
8 v-for="(value, i) in morphologyClassbreaks" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
9 :key="i" |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
10 > |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
11 <div class="input-group-prepend"> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
12 <button |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
13 :class="[ |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
14 'btn btn-sm btn-outline-secondary', |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
15 { hasColor: morphologyClassbreaks[i][1] !== '#ffffff' } |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
16 ]" |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
17 :style=" |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
18 'width: 28px; background-color: ' + |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
19 (morphologyClassbreaks[i][1] || 'transparent') |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
20 " |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
21 type="button" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
22 @click="showColorPicker('sounding-' + i)" |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
23 > |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
24 <font-awesome-icon icon="tint" /> |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
25 </button> |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
26 <div |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
27 class="color-picker card shadow-sm" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
28 v-if="activeColorPicker === 'sounding-' + i" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
29 > |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
30 <UIBoxHeader |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
31 :title="colorPickerTitle" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
32 icon="paint-brush" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
33 :actions="[ |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
34 { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
35 callback: () => { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
36 morphologyClassbreaks[i][1] = '#ffffff'; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
37 activeColorPicker = null; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
38 }, |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
39 icon: 'trash' |
3859
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
40 }, |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
41 { |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
42 callback: () => { |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
43 activeColorPicker = null; |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
44 }, |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
45 icon: 'check' |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
46 } |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
47 ]" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
48 /> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
49 <chrome-picker |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
50 v-model="morphologyClassbreaks[i][1]" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
51 @input="color => (morphologyClassbreaks[i][1] = color.hex)" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
52 /> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
53 </div> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
54 </div> |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
55 <form id="novalidatedform" /> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
56 <input |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
57 v-model.number="morphologyClassbreaks[i][0]" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
58 type="number" |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
59 min="0" |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
60 step="0.01" |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
61 class="form-control form-control-sm numfield" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
62 /> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
63 <div class="input-group-append"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
64 <button |
3612
c48b1e0fccd0
client: configuration: morphology: changed delete button color, to be less flashy
Markus Kottlaender <markus@intevation.de>
parents:
3611
diff
changeset
|
65 class="btn btn-sm btn-outline-secondary" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
66 type="button" |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
67 @click="morphologyClassbreaks.splice(i, 1)" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
68 > |
3614
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
69 <font-awesome-icon icon="times" /> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
70 </button> |
3855
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
71 <button |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
72 class="btn btn-sm btn-outline-secondary" |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
73 @click="addClassbreak(morphologyClassbreaks, i)" |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
74 > |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
75 <font-awesome-icon icon="plus" /> |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
76 </button> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
77 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
78 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
79 <button |
3855
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
80 v-if="!morphologyClassbreaks.length" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
81 class="btn btn-sm btn-success mb-3" |
3855
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
82 @click="addClassbreak(morphologyClassbreaks, 0)" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
83 > |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
84 <font-awesome-icon icon="plus" /> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
85 </button> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
86 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
87 </div> |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
88 <div class="mb-4 px-3"> |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
89 <a |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
90 @click.prevent="submitClassbreaks" |
4298
10bbaa57227c
client: disable send button with same values for bottleneck Morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4287
diff
changeset
|
91 :class="[ |
10bbaa57227c
client: disable send button with same values for bottleneck Morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4287
diff
changeset
|
92 'btn btn-info btn-sm text-white', |
4302
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
93 { disabled: !checkClassbreaks } |
4298
10bbaa57227c
client: disable send button with same values for bottleneck Morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4287
diff
changeset
|
94 ]" |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
95 > |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
96 <translate>Send</translate> |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
97 </a> |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
98 <a |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
99 @click.prevent="resetClassbreaks" |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
100 class="btn btn-outline-info btn-sm ml-2" |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
101 > |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
102 <translate>Reset to defaults</translate> |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
103 </a> |
4302
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
104 <span class="text-danger" v-if="!checkClassbreaks"> |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
105 {{ validationMessage }} |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
106 </span> |
4372
4e6b4fd68979
clients: improve systemconfig classbreaks
Bernhard Reiter <bernhard@intevation.de>
parents:
4370
diff
changeset
|
107 <span class="text-secondary fix-trans-space" v-translate> |
4e6b4fd68979
clients: improve systemconfig classbreaks
Bernhard Reiter <bernhard@intevation.de>
parents:
4370
diff
changeset
|
108 Changes need a map reload. Consider informing your users. |
4e6b4fd68979
clients: improve systemconfig classbreaks
Bernhard Reiter <bernhard@intevation.de>
parents:
4370
diff
changeset
|
109 </span> |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
110 </div> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
111 <div class="px-3"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
112 <h6 class="font-weight-bold"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
113 <translate>Sounding Result Comparison</translate> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
114 </h6> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
115 <div class="d-flex flex-wrap"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
116 <div |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
117 class="input-group mb-3 mr-2 classbreak" |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
118 v-for="(value, i) in morphologyClassbreaksCompare" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
119 :key="i" |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
120 > |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
121 <div class="input-group-prepend"> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
122 <button |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
123 :class="[ |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
124 'btn btn-sm btn-outline-secondary', |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
125 { hasColor: morphologyClassbreaksCompare[i][1] !== '#ffffff' } |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
126 ]" |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
127 :style=" |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
128 'width: 28px; background-color: ' + |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
129 (morphologyClassbreaksCompare[i][1] || 'transparent') |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
130 " |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
131 type="button" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
132 @click="showColorPicker('compare-' + i)" |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
133 > |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
134 <font-awesome-icon icon="tint" /> |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
135 </button> |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
136 <div |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
137 class="color-picker card shadow-sm" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
138 v-if="activeColorPicker === 'compare-' + i" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
139 > |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
140 <UIBoxHeader |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
141 :title="colorPickerTitle" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
142 icon="paint-brush" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
143 :actions="[ |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
144 { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
145 callback: () => { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
146 morphologyClassbreaksCompare[i][1] = '#ffffff'; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
147 activeColorPicker = null; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
148 }, |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
149 icon: 'trash' |
3859
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
150 }, |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
151 { |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
152 callback: () => { |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
153 activeColorPicker = null; |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
154 }, |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
155 icon: 'check' |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
156 } |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
157 ]" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
158 /> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
159 <chrome-picker |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
160 v-model="morphologyClassbreaksCompare[i][1]" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
161 @input=" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
162 color => (morphologyClassbreaksCompare[i][1] = color.hex) |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
163 " |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
164 /> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
165 </div> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
166 </div> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
167 <input |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
168 v-model.number="morphologyClassbreaksCompare[i][0]" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
169 type="number" |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
170 step="0.01" |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
171 class="form-control form-control-sm numfield" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
172 /> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
173 <div class="input-group-append"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
174 <button |
3612
c48b1e0fccd0
client: configuration: morphology: changed delete button color, to be less flashy
Markus Kottlaender <markus@intevation.de>
parents:
3611
diff
changeset
|
175 class="btn btn-sm btn-outline-secondary" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
176 type="button" |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
177 @click="morphologyClassbreaksCompare.splice(i, 1)" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
178 > |
3614
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
179 <font-awesome-icon icon="times" /> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
180 </button> |
3855
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
181 <button |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
182 class="btn btn-sm btn-outline-secondary" |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
183 @click="addClassbreak(morphologyClassbreaksCompare, i)" |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
184 > |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
185 <font-awesome-icon icon="plus" /> |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
186 </button> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
187 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
188 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
189 <button |
3855
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
190 v-if="!morphologyClassbreaksCompare.length" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
191 class="btn btn-sm btn-success mb-3" |
3855
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
192 @click="addClassbreak(morphologyClassbreaksCompare, 0)" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
193 > |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
194 <font-awesome-icon icon="plus" /> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
195 </button> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
196 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
197 </div> |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
198 <div class="px-3"> |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
199 <a |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
200 @click.prevent="submitClassbreaksCompare" |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
201 :class="[ |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
202 'btn btn-info btn-sm text-white', |
4302
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
203 { disabled: !checkClassbreaksCompare } |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
204 ]" |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
205 > |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
206 <translate>Send</translate> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
207 </a> |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
208 <a |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
209 @click.prevent="resetClassbreaksCompare" |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
210 class="btn btn-outline-info btn-sm ml-2" |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
211 > |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
212 <translate>Reset to defaults</translate> |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
213 </a> |
4302
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
214 <span class="text-danger" v-if="!checkClassbreaksCompare"> |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
215 {{ validationMessageForCompare }} |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
216 </span> |
4372
4e6b4fd68979
clients: improve systemconfig classbreaks
Bernhard Reiter <bernhard@intevation.de>
parents:
4370
diff
changeset
|
217 <span class="text-secondary fix-trans-space" v-translate> |
4373
aa249a25f0ec
client: silence a code layout warning
Bernhard Reiter <bernhard@intevation.de>
parents:
4372
diff
changeset
|
218 Colour changes need a map reload. Value changes need a de- and re-select |
aa249a25f0ec
client: silence a code layout warning
Bernhard Reiter <bernhard@intevation.de>
parents:
4372
diff
changeset
|
219 of a difference calculation. Inform your users! |
4372
4e6b4fd68979
clients: improve systemconfig classbreaks
Bernhard Reiter <bernhard@intevation.de>
parents:
4370
diff
changeset
|
220 </span> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
221 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
222 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
223 </template> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
224 |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
225 <style lang="sass" scoped> |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
226 .numfield:invalid |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
227 border: 2px solid |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
228 border-color: #ff0000 |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
229 |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
230 .classbreak |
4370
1e0d5c40b3f1
client: improve systemconfiguration classbreaks
Bernhard Reiter <bernhard@intevation.de>
parents:
4369
diff
changeset
|
231 width: 154px |
3614
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
232 .btn-outline-secondary |
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
233 border-color: #ccc |
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
234 color: #ccc |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
235 &:hover:not(.hasColor) |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
236 background: #eee !important |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
237 .input-group-prepend |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
238 .btn-outline-secondary.hasColor |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
239 color: rgba(255, 255, 255, 0.5) |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
240 .input-group-append |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
241 .btn-outline-secondary |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
242 &:hover |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
243 color: #dc3545 |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
244 &:last-child:hover |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
245 color: #28a745 |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
246 .color-picker |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
247 position: absolute |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
248 top: -4px |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
249 left: 19px |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
250 z-index: 9 |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
251 overflow: hidden |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
252 border-top-left-radius: 0 !important |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
253 .btn |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
254 border-radius: 0 !important |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
255 .vc-chrome |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
256 box-shadow: none |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
257 /deep/ |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
258 .vc-chrome-alpha-wrap |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
259 display: none !important |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
260 .vc-chrome-hue-wrap |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
261 margin-top: 10px |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
262 .vc-chrome-saturation-wrap |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
263 border-radius: 0 |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
264 </style> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
265 |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
266 <script> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
267 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
268 * without warranty, see README.md and license for details. |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
269 * |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
270 * SPDX-License-Identifier: AGPL-3.0-or-later |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
271 * License-Filename: LICENSES/AGPL-3.0.txt |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
272 * |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
273 * Copyright (C) 2018 by via donau |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
274 * – Österreichische Wasserstraßen-Gesellschaft mbH |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
275 * Software engineering by Intevation GmbH |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
276 * |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
277 * Author(s): |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
278 * Markus Kottländer <markus@intevation.de> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
279 */ |
3622
30a9fdac70f0
client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents:
3614
diff
changeset
|
280 import { mapState } from "vuex"; |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
281 import { Chrome } from "vue-color"; |
3867
d37f44c4d531
client: configuration: moved default values to separate file
Markus Kottlaender <markus@intevation.de>
parents:
3861
diff
changeset
|
282 import defaults from "./defaults"; |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
283 |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
284 export default { |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
285 components: { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
286 "chrome-picker": Chrome |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
287 }, |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
288 data() { |
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
289 return { |
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
290 morphologyClassbreaks: [], |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
291 morphologyClassbreaksCompare: [], |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
292 activeColorPicker: null, |
4302
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
293 closeColorPickerListener: null, |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
294 validationMessage: "", |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
295 validationMessageForCompare: "" |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
296 }; |
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
297 }, |
3622
30a9fdac70f0
client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents:
3614
diff
changeset
|
298 computed: { |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
299 ...mapState("application", ["config"]), |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
300 colorPickerTitle() { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
301 return this.$gettext("Choose color"); |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
302 }, |
4302
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
303 checkClassbreaks() { |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
304 return ( |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
305 this.valuesAreValid(this.morphologyClassbreaks) && |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
306 !this.hasDoublettes(this.morphologyClassbreaks) |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
307 ); |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
308 }, |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
309 checkClassbreaksCompare() { |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
310 return ( |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
311 this.valuesAreValid(this.morphologyClassbreaksCompare, "compare") && |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
312 !this.hasDoublettes(this.morphologyClassbreaksCompare, "compare") |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
313 ); |
4302
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
314 } |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
315 }, |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
316 methods: { |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
317 // check if the same value is used for more than one field. |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
318 hasDoublettes(m, compare) { |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
319 const errorMessage = this.$gettext( |
4370
1e0d5c40b3f1
client: improve systemconfiguration classbreaks
Bernhard Reiter <bernhard@intevation.de>
parents:
4369
diff
changeset
|
320 "Same value is used in multiple fields." |
4302
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
321 ); |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
322 let values = []; |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
323 for (let i = 0; i < m.length; i++) { |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
324 values[i] = Number(m[i][0]); |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
325 } |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
326 if (new Set(values).size !== values.length) { |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
327 // determine which message to change |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
328 if (compare !== "compare") { |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
329 this.validationMessage = errorMessage; |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
330 } else { |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
331 this.validationMessageForCompare = errorMessage; |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
332 } |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
333 return true; |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
334 } |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
335 return false; |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
336 }, |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
337 valuesAreValid(m, compare) { |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
338 const errorMessage = this.$gettext( |
4370
1e0d5c40b3f1
client: improve systemconfiguration classbreaks
Bernhard Reiter <bernhard@intevation.de>
parents:
4369
diff
changeset
|
339 "There are invalid classbreak values." |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
340 ); |
4302
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
341 let values = m.map(e => { |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
342 const element = e[0]; |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
343 if (!isNaN(element)) { |
4302
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
344 if (element === "") return false; // check if the field is empty |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
345 if (!isNaN(element)) { |
4302
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
346 const numberParts = String(element).split("."); // check number of decimal places |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
347 return numberParts.length == 2 ? numberParts[1].length < 3 : true; |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
348 } |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
349 } |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
350 return false; |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
351 }); |
4302
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
352 if (values.every(e => e === true)) { |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
353 return true; |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
354 } |
4302
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
355 if (compare !== "compare") { |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
356 this.validationMessage = errorMessage; |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
357 } else { |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
358 this.validationMessageForCompare = errorMessage; |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
359 } |
b86f828df7d6
client: improve validation for morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4299
diff
changeset
|
360 return false; |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
361 }, |
3855
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
362 addClassbreak(classbreaks, i) { |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
363 classbreaks.splice( |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
364 i, |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
365 0, |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
366 classbreaks.length > i |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
367 ? [classbreaks[i][0], classbreaks[i][1]] // create new array! |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
368 : [1, "#ffffff"] |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
369 ); |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
370 }, |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
371 showColorPicker(id) { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
372 this.activeColorPicker = this.activeColorPicker === id ? null : id; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
373 }, |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
374 submitClassbreaks() { |
3850
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
375 this.$store |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
376 .dispatch("application/saveConfig", { |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
377 morphology_classbreaks: this.morphologyClassbreaks |
4638
2e19ed576c68
client: sys-config: sort class breaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4373
diff
changeset
|
378 .sort((a, b) => (a[0] < b[0] ? -1 : 1)) |
3850
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
379 .map(cb => (cb[1] === "#ffffff" ? cb[0] : cb.join(":"))) |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
380 .join(",") |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
381 }) |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
382 .finally(() => this.$store.dispatch("application/loadConfig")); |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
383 }, |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
384 submitClassbreaksCompare() { |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
385 this.$store |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
386 .dispatch("application/saveConfig", { |
3850
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
387 morphology_classbreaks_compare: this.morphologyClassbreaksCompare |
4638
2e19ed576c68
client: sys-config: sort class breaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4373
diff
changeset
|
388 .sort((a, b) => (a[0] < b[0] ? -1 : 1)) |
3850
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
389 .map(cb => (cb[1] === "#ffffff" ? cb[0] : cb.join(":"))) |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
390 .join(",") |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
391 }) |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
392 .finally(() => this.$store.dispatch("application/loadConfig")); |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
393 }, |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
394 resetClassbreaks() { |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
395 this.morphologyClassbreaks = this.parseClassbreakString( |
3867
d37f44c4d531
client: configuration: moved default values to separate file
Markus Kottlaender <markus@intevation.de>
parents:
3861
diff
changeset
|
396 defaults.morphology_classbreaks |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
397 ); |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
398 }, |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
399 resetClassbreaksCompare() { |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
400 this.morphologyClassbreaksCompare = this.parseClassbreakString( |
3867
d37f44c4d531
client: configuration: moved default values to separate file
Markus Kottlaender <markus@intevation.de>
parents:
3861
diff
changeset
|
401 defaults.morphology_classbreaks_compare |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
402 ); |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
403 }, |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
404 parseClassbreakString(str) { |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
405 return str |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
406 .split(",") |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
407 .map(cb => cb.split(":")) |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
408 .map(cb => { |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
409 cb[0] = Number(cb[0]); |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
410 cb[1] = cb[1] || "#ffffff"; |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
411 return cb; |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
412 }); |
3622
30a9fdac70f0
client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents:
3614
diff
changeset
|
413 } |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
414 }, |
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
415 mounted() { |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
416 this.morphologyClassbreaks = this.parseClassbreakString( |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
417 this.config.morphology_classbreaks |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
418 ); |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
419 this.morphologyClassbreaksCompare = this.parseClassbreakString( |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
420 this.config.morphology_classbreaks_compare |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
421 ); |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
422 |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
423 this.closeColorPickerListener = e => { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
424 // Escape |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
425 if (e.keyCode === 27) { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
426 this.activeColorPicker = null; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
427 } |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
428 }; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
429 window.addEventListener("keydown", this.closeColorPickerListener); |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
430 }, |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
431 destroyed() { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
432 window.removeEventListener("keydown", this.closeColorPickerListener); |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
433 } |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
434 }; |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
435 </script> |