Mercurial > gemma
annotate client/src/components/systemconfiguration/MorphologyClassbreaks.vue @ 4299:43f28ef473c7
validator for morpology classbreaks
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 02 Sep 2019 13:17:38 +0200 |
parents | 10bbaa57227c |
children | b86f828df7d6 |
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> |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
55 <!-- deactivate the built-in validation --> |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
56 <form id="novalidatedform" /> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
57 <input |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
58 v-model.number="morphologyClassbreaks[i][0]" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
59 type="number" |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
60 min="0" |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
61 step="0.01" |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
62 class="form-control form-control-sm numfield" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
63 /> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
64 <div class="input-group-append"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
65 <button |
3612
c48b1e0fccd0
client: configuration: morphology: changed delete button color, to be less flashy
Markus Kottlaender <markus@intevation.de>
parents:
3611
diff
changeset
|
66 class="btn btn-sm btn-outline-secondary" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
67 type="button" |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
68 @click="morphologyClassbreaks.splice(i, 1)" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
69 > |
3614
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
70 <font-awesome-icon icon="times" /> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
71 </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
|
72 <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
|
73 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
|
74 @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
|
75 > |
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 <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
|
77 </button> |
3606
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 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
80 <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
|
81 v-if="!morphologyClassbreaks.length" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
82 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
|
83 @click="addClassbreak(morphologyClassbreaks, 0)" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
84 > |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
85 <font-awesome-icon icon="plus" /> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
86 </button> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
87 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
88 </div> |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
89 <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
|
90 <a |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
91 @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
|
92 :class="[ |
10bbaa57227c
client: disable send button with same values for bottleneck Morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4287
diff
changeset
|
93 'btn btn-info btn-sm text-white', |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
94 { disabled: !classbreaksAreValid || hasDoublettes } |
4298
10bbaa57227c
client: disable send button with same values for bottleneck Morphology classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4287
diff
changeset
|
95 ]" |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
96 > |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
97 <translate>Send</translate> |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
98 </a> |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
99 <a |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
100 @click.prevent="resetClassbreaks" |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
101 class="btn btn-outline-info btn-sm ml-2" |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
102 > |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
103 <translate>Reset to defaults</translate> |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
104 </a> |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
105 <span class="text-danger" v-if="hasDoublettes || !classbreaksAreValid"> |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
106 {{ validationMessage }} |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
107 </span> |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
108 </div> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
109 <div class="px-3"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
110 <h6 class="font-weight-bold"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
111 <translate>Sounding Result Comparison</translate> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
112 </h6> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
113 <div class="d-flex flex-wrap"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
114 <div |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
115 class="input-group mb-3 mr-2 classbreak" |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
116 v-for="(value, i) in morphologyClassbreaksCompare" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
117 :key="i" |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
118 > |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
119 <div class="input-group-prepend"> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
120 <button |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
121 :class="[ |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
122 '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
|
123 { hasColor: morphologyClassbreaksCompare[i][1] !== '#ffffff' } |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
124 ]" |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
125 :style=" |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
126 'width: 28px; background-color: ' + |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
127 (morphologyClassbreaksCompare[i][1] || 'transparent') |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
128 " |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
129 type="button" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
130 @click="showColorPicker('compare-' + i)" |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
131 > |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
132 <font-awesome-icon icon="tint" /> |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
133 </button> |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
134 <div |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
135 class="color-picker card shadow-sm" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
136 v-if="activeColorPicker === 'compare-' + i" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
137 > |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
138 <UIBoxHeader |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
139 :title="colorPickerTitle" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
140 icon="paint-brush" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
141 :actions="[ |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
142 { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
143 callback: () => { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
144 morphologyClassbreaksCompare[i][1] = '#ffffff'; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
145 activeColorPicker = null; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
146 }, |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
147 icon: 'trash' |
3859
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
148 }, |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
149 { |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
150 callback: () => { |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
151 activeColorPicker = null; |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
152 }, |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
153 icon: 'check' |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
154 } |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
155 ]" |
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 <chrome-picker |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
158 v-model="morphologyClassbreaksCompare[i][1]" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
159 @input=" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
160 color => (morphologyClassbreaksCompare[i][1] = color.hex) |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
161 " |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
162 /> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
163 </div> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
164 </div> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
165 <input |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
166 v-model.number="morphologyClassbreaksCompare[i][0]" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
167 type="number" |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
168 step="0.01" |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
169 class="form-control form-control-sm numfield" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
170 /> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
171 <div class="input-group-append"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
172 <button |
3612
c48b1e0fccd0
client: configuration: morphology: changed delete button color, to be less flashy
Markus Kottlaender <markus@intevation.de>
parents:
3611
diff
changeset
|
173 class="btn btn-sm btn-outline-secondary" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
174 type="button" |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
175 @click="morphologyClassbreaksCompare.splice(i, 1)" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
176 > |
3614
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
177 <font-awesome-icon icon="times" /> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
178 </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
|
179 <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
|
180 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
|
181 @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
|
182 > |
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 <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
|
184 </button> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
185 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
186 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
187 <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
|
188 v-if="!morphologyClassbreaksCompare.length" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
189 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
|
190 @click="addClassbreak(morphologyClassbreaksCompare, 0)" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
191 > |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
192 <font-awesome-icon icon="plus" /> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
193 </button> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
194 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
195 </div> |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
196 <div class="px-3"> |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
197 <a |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
198 @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
|
199 :class="[ |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
200 'btn btn-info btn-sm text-white', |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
201 { disabled: !checkValidityForMCCompare } |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
202 ]" |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
203 > |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
204 <translate>Send</translate> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
205 </a> |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
206 <a |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
207 @click.prevent="resetClassbreaksCompare" |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
208 class="btn btn-outline-info btn-sm ml-2" |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
209 > |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
210 <translate>Reset to defaults</translate> |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
211 </a> |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
212 <span class="text-danger" v-if="!checkValidityForMCCompare"> |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
213 <translate>Same value is used in multiple fields.</translate> |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
214 </span> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
215 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
216 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
217 </template> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
218 |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
219 <style lang="sass" scoped> |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
220 .numfield:invalid |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
221 border: 2px solid |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
222 border-color: #ff0000 |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
223 |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
224 .classbreak |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
225 width: 142px |
3614
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
226 .btn-outline-secondary |
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
227 border-color: #ccc |
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
228 color: #ccc |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
229 &:hover:not(.hasColor) |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
230 background: #eee !important |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
231 .input-group-prepend |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
232 .btn-outline-secondary.hasColor |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
233 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
|
234 .input-group-append |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
235 .btn-outline-secondary |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
236 &:hover |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
237 color: #dc3545 |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
238 &:last-child:hover |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
239 color: #28a745 |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
240 .color-picker |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
241 position: absolute |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
242 top: -4px |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
243 left: 19px |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
244 z-index: 9 |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
245 overflow: hidden |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
246 border-top-left-radius: 0 !important |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
247 .btn |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
248 border-radius: 0 !important |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
249 .vc-chrome |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
250 box-shadow: none |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
251 /deep/ |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
252 .vc-chrome-alpha-wrap |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
253 display: none !important |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
254 .vc-chrome-hue-wrap |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
255 margin-top: 10px |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
256 .vc-chrome-saturation-wrap |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
257 border-radius: 0 |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
258 </style> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
259 |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
260 <script> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
261 /* 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
|
262 * without warranty, see README.md and license for details. |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
263 * |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
264 * SPDX-License-Identifier: AGPL-3.0-or-later |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
265 * License-Filename: LICENSES/AGPL-3.0.txt |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
266 * |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
267 * Copyright (C) 2018 by via donau |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
268 * – Österreichische Wasserstraßen-Gesellschaft mbH |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
269 * Software engineering by Intevation GmbH |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
270 * |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
271 * Author(s): |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
272 * Markus Kottländer <markus@intevation.de> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
273 */ |
3622
30a9fdac70f0
client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents:
3614
diff
changeset
|
274 import { mapState } from "vuex"; |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
275 import { Chrome } from "vue-color"; |
3867
d37f44c4d531
client: configuration: moved default values to separate file
Markus Kottlaender <markus@intevation.de>
parents:
3861
diff
changeset
|
276 import defaults from "./defaults"; |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
277 |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
278 export default { |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
279 components: { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
280 "chrome-picker": Chrome |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
281 }, |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
282 data() { |
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
283 return { |
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
284 morphologyClassbreaks: [], |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
285 morphologyClassbreaksCompare: [], |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
286 activeColorPicker: null, |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
287 closeColorPickerListener: null |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
288 }; |
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
289 }, |
3622
30a9fdac70f0
client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents:
3614
diff
changeset
|
290 computed: { |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
291 ...mapState("application", ["config"]), |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
292 colorPickerTitle() { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
293 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
|
294 }, |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
295 validationMessage() { |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
296 const doublettes = this.$gettext( |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
297 "Same value is used in multiple fields." |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
298 ); |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
299 const invalidForm = this.$gettext( |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
300 "There are invalid classbreak values. Please check" |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
301 ); |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
302 if (this.hasDoublettes && !this.classbreaksAreValid) |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
303 return `${doublettes} ${invalidForm}`; |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
304 if (this.hasDoublettes) return doublettes; |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
305 if (!this.classbreaksAreValid) return invalidForm; |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
306 return ""; |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
307 }, |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
308 classbreaksAreValid() { |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
309 let values = this.morphologyClassbreaks.map(e => { |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
310 const element = e[0]; |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
311 if (!isNaN(element)) { |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
312 if (element === "") return false; |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
313 if (!isNaN(element)) { |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
314 const numberParts = String(element).split("."); |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
315 return numberParts.length == 2 ? numberParts[1].length < 3 : true; |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
316 } |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
317 } |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
318 return false; |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
319 }); |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
320 return values.every(e => e === true); |
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
321 }, |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
322 // check if the same value is used for more than one field. |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
323 hasDoublettes() { |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
324 let values = []; |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
325 for (let i = 0; i < this.morphologyClassbreaks.length; i++) { |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
326 values[i] = Number(this.morphologyClassbreaks[i][0]); |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
327 } |
4299
43f28ef473c7
validator for morpology classbreaks
Thomas Junk <thomas.junk@intevation.de>
parents:
4298
diff
changeset
|
328 return new Set(values).size !== values.length; |
4282
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
329 }, |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
330 checkValidityForMCCompare() { |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
331 let values = []; |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
332 for (let i = 0; i < this.morphologyClassbreaksCompare.length; i++) { |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
333 values[i] = Number(this.morphologyClassbreaksCompare[i][0]); |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
334 } |
5d6a4dd3efa1
client: improve input validation in sys-config for Bottleneck Morphology Classbreaks
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3889
diff
changeset
|
335 return new Set(values).size === values.length; |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
336 } |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
337 }, |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
338 methods: { |
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
|
339 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
|
340 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
|
341 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
|
342 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
|
343 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
|
344 ? [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
|
345 : [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
|
346 ); |
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
|
347 }, |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
348 showColorPicker(id) { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
349 this.activeColorPicker = this.activeColorPicker === id ? null : id; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
350 }, |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
351 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
|
352 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
|
353 .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
|
354 morphology_classbreaks: this.morphologyClassbreaks |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
355 .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
|
356 .join(",") |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
357 }) |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
358 .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
|
359 }, |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
360 submitClassbreaksCompare() { |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
361 this.$store |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
362 .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
|
363 morphology_classbreaks_compare: this.morphologyClassbreaksCompare |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
364 .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
|
365 .join(",") |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
366 }) |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
367 .finally(() => this.$store.dispatch("application/loadConfig")); |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
368 }, |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
369 resetClassbreaks() { |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
370 this.morphologyClassbreaks = this.parseClassbreakString( |
3867
d37f44c4d531
client: configuration: moved default values to separate file
Markus Kottlaender <markus@intevation.de>
parents:
3861
diff
changeset
|
371 defaults.morphology_classbreaks |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
372 ); |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
373 }, |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
374 resetClassbreaksCompare() { |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
375 this.morphologyClassbreaksCompare = this.parseClassbreakString( |
3867
d37f44c4d531
client: configuration: moved default values to separate file
Markus Kottlaender <markus@intevation.de>
parents:
3861
diff
changeset
|
376 defaults.morphology_classbreaks_compare |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
377 ); |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
378 }, |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
379 parseClassbreakString(str) { |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
380 return str |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
381 .split(",") |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
382 .map(cb => cb.split(":")) |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
383 .map(cb => { |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
384 cb[0] = Number(cb[0]); |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
385 cb[1] = cb[1] || "#ffffff"; |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
386 return cb; |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
387 }); |
3622
30a9fdac70f0
client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents:
3614
diff
changeset
|
388 } |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
389 }, |
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
390 mounted() { |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
391 this.morphologyClassbreaks = this.parseClassbreakString( |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
392 this.config.morphology_classbreaks |
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 this.morphologyClassbreaksCompare = this.parseClassbreakString( |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
395 this.config.morphology_classbreaks_compare |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
396 ); |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
397 |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
398 this.closeColorPickerListener = e => { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
399 // Escape |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
400 if (e.keyCode === 27) { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
401 this.activeColorPicker = null; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
402 } |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
403 }; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
404 window.addEventListener("keydown", this.closeColorPickerListener); |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
405 }, |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
406 destroyed() { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
407 window.removeEventListener("keydown", this.closeColorPickerListener); |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
408 } |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
409 }; |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
410 </script> |