Mercurial > gemma
annotate client/src/components/ImportStretches.vue @ 2909:5105f6ad0176
client: stretches: fixed highlighting of selected stretch
The vectorloader for each layer can now take a callback to postprocess the returned features.
For the stretches layer the selectedStretch (which is now stored in the vuex store) now gets
a 'highlighted' flag. The layer respects that flag to alter the styles.
A watcher on selectedStretch resets the styles when selectedStretch changes and sets the highlighted
flag for the new selectedStretch, if present, otherwise the vectorloader does this job.
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Tue, 02 Apr 2019 18:19:43 +0200 |
parents | 2821113846a9 |
children | c8c7122047a2 |
rev | line source |
---|---|
1610
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 <template> |
1803
975a7de89f05
define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
1797
diff
changeset
|
2 <div class="d-flex flex-column mb-3"> |
2387
f185503ef35a
client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents:
2384
diff
changeset
|
3 <UIBoxHeader |
f185503ef35a
client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents:
2384
diff
changeset
|
4 icon="road" |
2760
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2757
diff
changeset
|
5 :title="defineStretchesLabel" |
2387
f185503ef35a
client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents:
2384
diff
changeset
|
6 :closeCallback="$parent.close" |
f185503ef35a
client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents:
2384
diff
changeset
|
7 /> |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
8 <div class="position-relative"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
9 <UISpinnerOverlay v-if="loading" /> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
10 <div v-if="!edit" class="mb-3"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
11 <UITableHeader |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
12 :columns="[ |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
13 { id: 'properties.name', title: `${nameLabel}`, class: 'col-4' }, |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
14 { |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
15 id: 'properties.date_info', |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
16 title: `${dateLabel}`, |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
17 class: 'col-2' |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
18 }, |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
19 { |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
20 id: 'properties.source_organization', |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
21 title: `${sourceorganizationLabel}`, |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
22 class: 'col-3' |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
23 } |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
24 ]" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
25 /> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
26 <UITableBody |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
27 :data="filteredStretches() | sortTable(sortColumn, sortDirection)" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
28 > |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
29 <template v-slot:row="{ item: stretch }"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
30 <div class="py-1 col-4 "> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
31 <a |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
32 class="linkto text-info" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
33 v-if="isInStaging(stretch.properties.name)" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
34 @click="gotoStaging(getStagingLink(stretch.properties.name))" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
35 > |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
36 {{ stretch.properties.name |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
37 }}<font-awesome-icon |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
38 class="ml-1 text-danger" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
39 icon="exclamation-triangle" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
40 fixed-width |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
41 ></font-awesome-icon |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
42 ><small class="ml-1">review</small> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
43 </a> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
44 <a v-else @click="moveMapToStretch(stretch)" href="#">{{ |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
45 stretch.properties.name |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
46 }}</a> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
47 </div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
48 <div class="py-1 col-2"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
49 {{ stretch.properties.date_info | surveyDate }} |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
50 </div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
51 <div class="py-1 col-3"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
52 {{ stretch.properties.source_organization }} |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
53 </div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
54 <div class="py-1 col text-right"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
55 <button |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
56 class="btn btn-xs btn-dark mr-1" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
57 @click="editStretch(stretch)" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
58 > |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
59 <font-awesome-icon icon="pencil-alt" fixed-width /> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
60 </button> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
61 <button |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
62 class="btn btn-xs btn-dark" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
63 @click="deleteStretch(stretch)" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
64 > |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
65 <font-awesome-icon icon="trash" fixed-width /> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
66 </button> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
67 </div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
68 </template> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
69 </UITableBody> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
70 </div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
71 <div v-if="edit"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
72 <div class="ml-3 mr-3"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
73 <div class="d-flex flex-row justify-content-between"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
74 <div class="mt-2 w-50 mr-2 text-left"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
75 <small class="text-muted"> <translate>ID</translate> </small> |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
76 <input |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
77 id="id" |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
78 type="text" |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
79 class="form-control" |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
80 placeholder="AT_Section_12" |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
81 aria-label="id" |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
82 v-model="id" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
83 :disabled="editExistingStretch" |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
84 /> |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
85 <span class="text-left text-danger"> |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
86 <small v-if="idError && !id"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
87 <translate>Please enter an id</translate> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
88 </small> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
89 </span> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
90 </div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
91 <div class="mt-2 w-50 ml-2 text-left"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
92 <div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
93 <small class="text-muted"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
94 <translate>Countrycode</translate> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
95 </small> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
96 <input |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
97 id="countryCode" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
98 type="text" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
99 class="form-control" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
100 placeholder="AT" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
101 aria-label="id" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
102 v-model="countryCode" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
103 /> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
104 <span class="text-left text-danger"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
105 <small v-if="countryCodeError && !countryCode"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
106 <translate>Please enter a countrycode </translate> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
107 </small> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
108 </span> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
109 </div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
110 <div class="w-50 ml-2"></div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
111 </div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
112 </div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
113 <div class="d-flex flex-column justify-content-between"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
114 <div class="mt-2 text-left"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
115 <small class="text-muted"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
116 <translate>Start rhm</translate> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
117 </small> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
118 <div class="d-flex flex-row"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
119 <input |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
120 id="startrhm" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
121 type="text" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
122 class="form-control" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
123 placeholder="e.g. ATXXX000010000019900" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
124 aria-label="startrhm" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
125 v-model="startrhm" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
126 /> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
127 <span class="input-group-text"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
128 <font-awesome-icon |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
129 @click="togglePipette('start')" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
130 :class="{ 'text-info': pipetteStart }" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
131 icon="bullseye" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
132 ></font-awesome-icon> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
133 </span> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
134 </div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
135 <span class="text-left text-danger"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
136 <small v-if="startrhmError && !startrhm"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
137 <translate>Please enter a start point</translate> |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
138 </small> |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
139 </span> |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
140 </div> |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
141 <div class="mt-2 text-left"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
142 <small class="text-muted"> <translate>End rhm</translate> </small> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
143 <div class="d-flex flex-row"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
144 <input |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
145 id="endrhm" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
146 type="text" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
147 class="form-control" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
148 placeholder="e.g. ATXXX000010000019900" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
149 aria-label="endrhm" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
150 v-model="endrhm" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
151 /> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
152 <span class="input-group-text"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
153 <font-awesome-icon |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
154 @click="togglePipette('end')" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
155 :class="{ 'text-info': pipetteEnd }" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
156 icon="bullseye" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
157 ></font-awesome-icon> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
158 </span> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
159 </div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
160 <span class="text-left text-danger"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
161 <small v-if="endrhmError && !endrhm"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
162 <translate>Please enter an end point</translate> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
163 </small> |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
164 </span> |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
165 </div> |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
166 </div> |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
167 <div |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
168 v-if="!editExistingStretch" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
169 class="d-flex flex-row justify-content-between" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
170 > |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
171 <div class="mt-2 mr-2 w-50 text-left"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
172 <small class="text-muted"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
173 <translate |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
174 >Tolerance for snapping of waterway axis [m]</translate |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
175 > |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
176 </small> |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
177 <input |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
178 class="form-control" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
179 v-model.number="tolerance" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
180 placeholder="" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
181 type="number" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
182 min="0" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
183 step="any" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
184 aria-label="tolerance" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
185 id="tolerance" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
186 /> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
187 <span class="text-left text-danger"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
188 <small v-if="toleranceError && !tolerance"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
189 <translate>Please enter a tolerance value</translate> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
190 </small> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
191 </span> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
192 </div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
193 </div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
194 <div class="d-flex flex-row justify-content-between"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
195 <div class="mt-2 mr-2 w-50 text-left"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
196 <small class="text-muted"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
197 <translate>Object name</translate> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
198 </small> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
199 <input |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
200 id="objbn" |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
201 type="text" |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
202 class="form-control" |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
203 placeholder="" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
204 aria-label="objbn" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
205 v-model="objbn" |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
206 /> |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
207 <span class="text-left text-danger"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
208 <small v-if="objbnError && !objbn"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
209 <translate>Please enter an objectname</translate> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
210 </small> |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
211 </span> |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
212 </div> |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
213 <div class="mt-2 ml-2 w-50 text-left"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
214 <small class="text-muted"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
215 <translate>National Object name</translate> |
1870
3050d702913a
sections and stretches: only stretches. only sysadmin.
Thomas Junk <thomas.junk@intevation.de>
parents:
1827
diff
changeset
|
216 </small> |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
217 <input |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
218 id="nobjbn" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
219 type="text" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
220 class="form-control" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
221 placeholder="" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
222 aria-label="nobjbn" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
223 v-model="nobjbn" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
224 /> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
225 </div> |
1870
3050d702913a
sections and stretches: only stretches. only sysadmin.
Thomas Junk <thomas.junk@intevation.de>
parents:
1827
diff
changeset
|
226 </div> |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
227 <div class="d-flex flex-row justify-content-between"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
228 <div class="mt-2 mr-2 w-50 text-left"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
229 <small class="text-muted"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
230 <translate>Date info</translate> |
2563
dc4fae4bdb8f
Expose axis snapping tolerance to users
Tom Gottfried <tom@intevation.de>
parents:
2541
diff
changeset
|
231 </small> |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
232 <input |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
233 id="date_info" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
234 type="date" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
235 class="form-control" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
236 placeholder="date_info" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
237 aria-label="date_info" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
238 v-model="date_info" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
239 /> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
240 <span class="text-left text-danger"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
241 <small v-if="date_infoError && !date_info"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
242 <translate>Please enter a date</translate> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
243 </small> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
244 </span> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
245 </div> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
246 <div class="mt-2 ml-2 w-50 text-left"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
247 <small class="text-muted"> <translate>Source</translate> </small> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
248 <input |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
249 id="source" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
250 type="text" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
251 class="form-control" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
252 placeholder="source" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
253 aria-label="source" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
254 v-model="source" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
255 /> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
256 <span class="text-left text-danger"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
257 <small v-if="sourceError && !source"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
258 <translate>Please enter a source</translate> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
259 </small> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
260 </span> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
261 </div> |
2563
dc4fae4bdb8f
Expose axis snapping tolerance to users
Tom Gottfried <tom@intevation.de>
parents:
2541
diff
changeset
|
262 </div> |
dc4fae4bdb8f
Expose axis snapping tolerance to users
Tom Gottfried <tom@intevation.de>
parents:
2541
diff
changeset
|
263 </div> |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
264 <div class="text-right mt-2 mr-3 mb-3"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
265 <button @click="edit = false" class="btn btn-warning mr-2"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
266 Back |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
267 </button> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
268 <button |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
269 @click="save" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
270 type="submit" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
271 class="shadow-sm btn btn-info submit-button" |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
272 > |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
273 <translate>Submit</translate> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
274 </button> |
1803
975a7de89f05
define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
1797
diff
changeset
|
275 </div> |
975a7de89f05
define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
1797
diff
changeset
|
276 </div> |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
277 <div class="text-right mr-3"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
278 <button v-if="!edit" @click="startEdit()" class="btn btn-info"> |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
279 <translate>New stretch</translate> |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
280 </button> |
1803
975a7de89f05
define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
1797
diff
changeset
|
281 </div> |
1809
b16a6db0008f
feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents:
1803
diff
changeset
|
282 </div> |
1610
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
283 </div> |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
284 </template> |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
285 |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
286 <script> |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
287 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
288 * without warranty, see README.md and license for details. |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
289 * |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
290 * SPDX-License-Identifier: AGPL-3.0-or-later |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
291 * License-Filename: LICENSES/AGPL-3.0.txt |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
292 * |
2563
dc4fae4bdb8f
Expose axis snapping tolerance to users
Tom Gottfried <tom@intevation.de>
parents:
2541
diff
changeset
|
293 * Copyright (C) 2018, 2019 by via donau |
1610
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
294 * – Österreichische Wasserstraßen-Gesellschaft mbH |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
295 * Software engineering by Intevation GmbH |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
296 * |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
297 * Author(s): |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
298 * Thomas Junk <thomas.junk@intevation.de> |
2563
dc4fae4bdb8f
Expose axis snapping tolerance to users
Tom Gottfried <tom@intevation.de>
parents:
2541
diff
changeset
|
299 * Tom Gottfried <tom.gottfried@intevation.de> |
1610
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
300 */ |
1827
27c4effba5b1
stretches only for sysadmin plus country code
Thomas Junk <thomas.junk@intevation.de>
parents:
1823
diff
changeset
|
301 import { mapState, mapGetters } from "vuex"; |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
302 import { displayError, displayInfo } from "@/lib/errors"; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
303 import { LAYERS } from "@/store/map"; |
2651
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2640
diff
changeset
|
304 import { HTTP } from "@/lib/http"; |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
305 import { sortTable } from "@/lib/mixins"; |
1610
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
306 |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
307 export default { |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
308 name: "importstretches", |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
309 mixins: [sortTable], |
1610
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
310 data() { |
1803
975a7de89f05
define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
1797
diff
changeset
|
311 return { |
2651
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2640
diff
changeset
|
312 staging: [], |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
313 edit: false, |
2569
2d18b8d5b9db
define_stretch: tolerance only visible for new stretch definitions
Thomas Junk <thomas.junk@intevation.de>
parents:
2567
diff
changeset
|
314 editExistingStretch: false, |
1803
975a7de89f05
define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
1797
diff
changeset
|
315 id: "", |
1809
b16a6db0008f
feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents:
1803
diff
changeset
|
316 funktion: "", |
b16a6db0008f
feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents:
1803
diff
changeset
|
317 startrhm: "", |
b16a6db0008f
feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents:
1803
diff
changeset
|
318 endrhm: "", |
2567
1cac2e58ef7d
streches: tolerance added
Thomas Junk <thomas.junk@intevation.de>
parents:
2563
diff
changeset
|
319 tolerance: 5, |
1803
975a7de89f05
define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
1797
diff
changeset
|
320 objbn: "", |
975a7de89f05
define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
1797
diff
changeset
|
321 nobjbn: "", |
1827
27c4effba5b1
stretches only for sysadmin plus country code
Thomas Junk <thomas.junk@intevation.de>
parents:
1823
diff
changeset
|
322 countryCode: "", |
1809
b16a6db0008f
feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents:
1803
diff
changeset
|
323 date_info: new Date().toISOString().split("T")[0], |
b16a6db0008f
feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents:
1803
diff
changeset
|
324 source: "", |
b16a6db0008f
feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents:
1803
diff
changeset
|
325 pipetteStart: false, |
1816
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
326 pipetteEnd: false, |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
327 idError: false, |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
328 funktionError: false, |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
329 startrhmError: false, |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
330 endrhmError: false, |
2563
dc4fae4bdb8f
Expose axis snapping tolerance to users
Tom Gottfried <tom@intevation.de>
parents:
2541
diff
changeset
|
331 toleranceError: false, |
1816
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
332 objbnError: false, |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
333 nobjbnError: false, |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
334 date_infoError: false, |
1827
27c4effba5b1
stretches only for sysadmin plus country code
Thomas Junk <thomas.junk@intevation.de>
parents:
1823
diff
changeset
|
335 sourceError: false, |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
336 countryCodeError: false, |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
337 loading: false |
1803
975a7de89f05
define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
1797
diff
changeset
|
338 }; |
1610
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
339 }, |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
340 computed: { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
341 ...mapState("application", ["searchQuery"]), |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
342 ...mapState("map", ["identifiedFeatures", "currentMeasurement"]), |
2869
02f51054f648
Client: improv the selected stretch style
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2782
diff
changeset
|
343 ...mapGetters("map", ["getVSourceByName", "getLayerByName"]), |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
344 ...mapGetters("user", ["isSysAdmin"]), |
2909
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2908
diff
changeset
|
345 ...mapState("imports", ["stretches", "selectedStretch"]), |
2760
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2757
diff
changeset
|
346 defineStretchesLabel() { |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2757
diff
changeset
|
347 return this.$gettext("Define Stretches"); |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2757
diff
changeset
|
348 }, |
2782
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
349 nameLabel() { |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
350 return this.$gettext("Name"); |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
351 }, |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
352 dateLabel() { |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
353 return this.$gettext("Date"); |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
354 }, |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
355 sourceorganizationLabel() { |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
356 return this.$gettext("Source organization"); |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
357 }, |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
358 stretchesInStaging() { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
359 const result = []; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
360 for (let stretch of this.stretches) { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
361 for (let s of this.staging) { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
362 if (s.kind == "st" && s.summary.stretch == stretch.properties.name) { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
363 result.push({ name: s.summary.stretch, id: s.id }); |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
364 } |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
365 } |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
366 } |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
367 return result; |
2757 | 368 } |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
369 }, |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
370 watch: { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
371 identifiedFeatures() { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
372 const filterDistanceMarks = x => { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
373 return /^distance_marks/.test(x["id_"]); |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
374 }; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
375 const distanceMark = this.identifiedFeatures.filter(filterDistanceMarks); |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
376 if (distanceMark.length > 0) { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
377 const value = distanceMark[0].getProperties()["location"]; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
378 this.startrhm = this.pipetteStart ? value : this.startrhm; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
379 this.endrhm = this.pipetteEnd ? value : this.endrhm; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
380 this.pipetteStart = false; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
381 this.pipetteEnd = false; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
382 } |
2909
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2908
diff
changeset
|
383 }, |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2908
diff
changeset
|
384 selectedStretch(stretch) { |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2908
diff
changeset
|
385 this.getVSourceByName(LAYERS.STRETCHES) |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2908
diff
changeset
|
386 .getFeatures() |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2908
diff
changeset
|
387 .forEach(f => { |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2908
diff
changeset
|
388 f.set("highlighted", false); |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2908
diff
changeset
|
389 if (f.getId() === stretch.id) { |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2908
diff
changeset
|
390 f.set("highlighted", true); |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2908
diff
changeset
|
391 } |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2908
diff
changeset
|
392 }); |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
393 } |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
394 }, |
1809
b16a6db0008f
feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents:
1803
diff
changeset
|
395 methods: { |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
396 filteredStretches() { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
397 return this.stretches.filter(s => { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
398 return (s.properties.name + s.properties.source_organization) |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
399 .toLowerCase() |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
400 .includes(this.searchQuery.toLowerCase()); |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
401 }); |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
402 }, |
1980
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
403 gotoStaging(id) { |
2364
341010faf34c
import_stretch: fix false review link
Thomas Junk <thomas.junk@intevation.de>
parents:
2170
diff
changeset
|
404 this.$router.push("/review/" + id); |
1980
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
405 }, |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
406 isInStaging(stretchname) { |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
407 for (let s of this.stretchesInStaging) { |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
408 if (s.name == stretchname) return true; |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
409 } |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
410 return false; |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
411 }, |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
412 getStagingLink(stretchname) { |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
413 for (let s of this.stretchesInStaging) { |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
414 if (s.name == stretchname) return s.id; |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
415 } |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
416 }, |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
417 loadStagingData() { |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
418 return new Promise((resolve, reject) => { |
2651
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2640
diff
changeset
|
419 HTTP.get("/imports?states=pending", { |
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2640
diff
changeset
|
420 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2640
diff
changeset
|
421 }) |
1980
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
422 .then(response => { |
2651
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2640
diff
changeset
|
423 const { imports } = response.data; |
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2640
diff
changeset
|
424 this.staging = imports; |
1980
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
425 resolve(response); |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
426 }) |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
427 .catch(error => { |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
428 reject(error); |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
429 }); |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
430 }); |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
431 }, |
2462
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2407
diff
changeset
|
432 editStretch(stretch) { |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2407
diff
changeset
|
433 const properties = stretch.properties; |
1977
53c1383dfee3
define stretch: edit function prefills fields
Thomas Junk <thomas.junk@intevation.de>
parents:
1961
diff
changeset
|
434 this.date_info = properties.date_info.split("T")[0]; |
53c1383dfee3
define stretch: edit function prefills fields
Thomas Junk <thomas.junk@intevation.de>
parents:
1961
diff
changeset
|
435 this.id = properties.name; |
53c1383dfee3
define stretch: edit function prefills fields
Thomas Junk <thomas.junk@intevation.de>
parents:
1961
diff
changeset
|
436 this.nobjbn = properties.nobjnam; |
53c1383dfee3
define stretch: edit function prefills fields
Thomas Junk <thomas.junk@intevation.de>
parents:
1961
diff
changeset
|
437 this.objbn = properties.objnam; |
53c1383dfee3
define stretch: edit function prefills fields
Thomas Junk <thomas.junk@intevation.de>
parents:
1961
diff
changeset
|
438 this.countryCode = properties.countries; |
53c1383dfee3
define stretch: edit function prefills fields
Thomas Junk <thomas.junk@intevation.de>
parents:
1961
diff
changeset
|
439 this.source = properties["source_organization"]; |
1942
d1b7b1c70410
import stretch: listview with edit-function
Thomas Junk <thomas.junk@intevation.de>
parents:
1930
diff
changeset
|
440 this.edit = true; |
2397
b95234702ee9
define stretch: omit call to sanitize. Should no longer be necessary since f6380bbdb853
Thomas Junk <thomas.junk@intevation.de>
parents:
2387
diff
changeset
|
441 this.startrhm = properties.lower; |
b95234702ee9
define stretch: omit call to sanitize. Should no longer be necessary since f6380bbdb853
Thomas Junk <thomas.junk@intevation.de>
parents:
2387
diff
changeset
|
442 this.endrhm = properties.upper; |
2569
2d18b8d5b9db
define_stretch: tolerance only visible for new stretch definitions
Thomas Junk <thomas.junk@intevation.de>
parents:
2567
diff
changeset
|
443 this.editExistingStretch = true; |
1942
d1b7b1c70410
import stretch: listview with edit-function
Thomas Junk <thomas.junk@intevation.de>
parents:
1930
diff
changeset
|
444 }, |
2384
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
445 deleteStretch(stretch) { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
446 this.$store.commit("application/popup", { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
447 icon: "trash", |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
448 title: this.$gettext("Delete Stretch"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
449 content: |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
450 this.$gettext("Do you really want to delete this stretch:") + |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
451 `<br> |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
452 <b>${stretch.properties.name}, ${ |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
453 stretch.properties.source_organization |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
454 } (${stretch.properties.countries})</b>`, |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
455 confirm: { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
456 label: this.$gettext("Delete"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
457 icon: "trash", |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
458 callback: () => { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
459 displayInfo({ |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
460 title: this.$gettext("Not implemented"), |
2595
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2569
diff
changeset
|
461 message: this.$gettext("Deleting ") + stretch.id |
2384
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
462 }); |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
463 } |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
464 }, |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
465 cancel: { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
466 label: this.$gettext("Cancel"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
467 icon: "times" |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2364
diff
changeset
|
468 } |
1942
d1b7b1c70410
import stretch: listview with edit-function
Thomas Junk <thomas.junk@intevation.de>
parents:
1930
diff
changeset
|
469 }); |
d1b7b1c70410
import stretch: listview with edit-function
Thomas Junk <thomas.junk@intevation.de>
parents:
1930
diff
changeset
|
470 }, |
2462
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2407
diff
changeset
|
471 moveMapToStretch(stretch) { |
2909
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2908
diff
changeset
|
472 this.$store.commit("imports/selectedStretch", stretch); |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2136
diff
changeset
|
473 this.$store.commit("map/setLayerVisible", LAYERS.STRETCHES); |
2136
3138d60dd1a6
moveToExtent substitutes moveMap where easy doable
Thomas Junk <thomas.junk@intevation.de>
parents:
2102
diff
changeset
|
474 this.$store.commit("map/moveToExtent", { |
2462
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2407
diff
changeset
|
475 feature: stretch, |
1942
d1b7b1c70410
import stretch: listview with edit-function
Thomas Junk <thomas.junk@intevation.de>
parents:
1930
diff
changeset
|
476 zoom: 17, |
d1b7b1c70410
import stretch: listview with edit-function
Thomas Junk <thomas.junk@intevation.de>
parents:
1930
diff
changeset
|
477 preventZoomOut: true |
d1b7b1c70410
import stretch: listview with edit-function
Thomas Junk <thomas.junk@intevation.de>
parents:
1930
diff
changeset
|
478 }); |
d1b7b1c70410
import stretch: listview with edit-function
Thomas Junk <thomas.junk@intevation.de>
parents:
1930
diff
changeset
|
479 }, |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
480 clean() { |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
481 this.id = ""; |
1980
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
482 this.edit = false; |
2569
2d18b8d5b9db
define_stretch: tolerance only visible for new stretch definitions
Thomas Junk <thomas.junk@intevation.de>
parents:
2567
diff
changeset
|
483 this.editExistingStretch = false; |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
484 this.funktion = ""; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
485 this.startrhm = ""; |
2567
1cac2e58ef7d
streches: tolerance added
Thomas Junk <thomas.junk@intevation.de>
parents:
2563
diff
changeset
|
486 this.tolerance = 5; |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
487 this.endrhm = ""; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
488 this.objbn = ""; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
489 this.nobjbn = ""; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
490 this.countryCode = ""; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
491 this.date_info = new Date().toISOString().split("T")[0]; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
492 this.source = ""; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
493 this.pipetteStart = false; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
494 this.pipetteEnd = false; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
495 this.idError = false; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
496 this.funktionError = false; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
497 this.startrhmError = false; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
498 this.endrhmError = false; |
2563
dc4fae4bdb8f
Expose axis snapping tolerance to users
Tom Gottfried <tom@intevation.de>
parents:
2541
diff
changeset
|
499 this.toleranceError = false; |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
500 this.objbnError = false; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
501 this.nobjbnError = false; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
502 this.date_infoError = false; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
503 this.sourceError = false; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
504 this.countryCodeError = false; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
505 }, |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
506 startEdit() { |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
507 this.clean(); |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
508 this.edit = true; |
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
509 }, |
1823
7d37d9f5f272
define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1816
diff
changeset
|
510 togglePipette(t) { |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2136
diff
changeset
|
511 this.$store.commit("map/setLayerVisible", LAYERS.DISTANCEMARKSAXIS); |
1823
7d37d9f5f272
define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1816
diff
changeset
|
512 if (t === "start") { |
7d37d9f5f272
define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1816
diff
changeset
|
513 this.pipetteStart = !this.pipetteStart; |
7d37d9f5f272
define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1816
diff
changeset
|
514 this.pipetteEnd = false; |
7d37d9f5f272
define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1816
diff
changeset
|
515 } else { |
7d37d9f5f272
define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1816
diff
changeset
|
516 this.pipetteEnd = !this.pipetteEnd; |
7d37d9f5f272
define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1816
diff
changeset
|
517 this.pipetteStart = false; |
7d37d9f5f272
define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1816
diff
changeset
|
518 } |
7d37d9f5f272
define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1816
diff
changeset
|
519 }, |
1816
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
520 validate() { |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
521 const fields = [ |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
522 "id", |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
523 "funktion", |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
524 "startrhm", |
2563
dc4fae4bdb8f
Expose axis snapping tolerance to users
Tom Gottfried <tom@intevation.de>
parents:
2541
diff
changeset
|
525 "tolerance", |
1816
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
526 "endrhm", |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
527 "objbn", |
1960
e5c5954fbd84
define stretches: validation
Thomas Junk <thomas.junk@intevation.de>
parents:
1959
diff
changeset
|
528 "nobjbn", |
e5c5954fbd84
define stretches: validation
Thomas Junk <thomas.junk@intevation.de>
parents:
1959
diff
changeset
|
529 "countryCode", |
1816
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
530 "date_info", |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
531 "source" |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
532 ]; |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
533 fields.forEach(field => { |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
534 if (!this[field]) { |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
535 this[field + "Error"] = true; |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
536 } else { |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
537 this[field + "Error"] = false; |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
538 } |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
539 }); |
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
540 }, |
1871
8ae7a1fba4cd
prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents:
1870
diff
changeset
|
541 save() { |
1816
199fa7e759aa
define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1809
diff
changeset
|
542 this.validate(); |
1960
e5c5954fbd84
define stretches: validation
Thomas Junk <thomas.junk@intevation.de>
parents:
1959
diff
changeset
|
543 if ( |
e5c5954fbd84
define stretches: validation
Thomas Junk <thomas.junk@intevation.de>
parents:
1959
diff
changeset
|
544 !this.id || |
e5c5954fbd84
define stretches: validation
Thomas Junk <thomas.junk@intevation.de>
parents:
1959
diff
changeset
|
545 !this.startrhm || |
e5c5954fbd84
define stretches: validation
Thomas Junk <thomas.junk@intevation.de>
parents:
1959
diff
changeset
|
546 !this.endrhm || |
2569
2d18b8d5b9db
define_stretch: tolerance only visible for new stretch definitions
Thomas Junk <thomas.junk@intevation.de>
parents:
2567
diff
changeset
|
547 (!this.tolerance && this.editExistingStretch) || |
1960
e5c5954fbd84
define stretches: validation
Thomas Junk <thomas.junk@intevation.de>
parents:
1959
diff
changeset
|
548 !this.source || |
e5c5954fbd84
define stretches: validation
Thomas Junk <thomas.junk@intevation.de>
parents:
1959
diff
changeset
|
549 !this.date_info || |
e5c5954fbd84
define stretches: validation
Thomas Junk <thomas.junk@intevation.de>
parents:
1959
diff
changeset
|
550 !this.objbn || |
e5c5954fbd84
define stretches: validation
Thomas Junk <thomas.junk@intevation.de>
parents:
1959
diff
changeset
|
551 !this.countryCode |
e5c5954fbd84
define stretches: validation
Thomas Junk <thomas.junk@intevation.de>
parents:
1959
diff
changeset
|
552 ) |
e5c5954fbd84
define stretches: validation
Thomas Junk <thomas.junk@intevation.de>
parents:
1959
diff
changeset
|
553 return; |
1930
1aa864cccddc
define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents:
1921
diff
changeset
|
554 const data = { |
1aa864cccddc
define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents:
1921
diff
changeset
|
555 name: this.id, |
1aa864cccddc
define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents:
1921
diff
changeset
|
556 from: this.startrhm, |
1aa864cccddc
define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents:
1921
diff
changeset
|
557 to: this.endrhm, |
1aa864cccddc
define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents:
1921
diff
changeset
|
558 "source-organization": this.source, |
1aa864cccddc
define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents:
1921
diff
changeset
|
559 "date-info": this.date_info, |
1aa864cccddc
define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents:
1921
diff
changeset
|
560 objnam: this.objbn, |
1aa864cccddc
define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents:
1921
diff
changeset
|
561 nobjnam: this.nobjbn, |
1977
53c1383dfee3
define stretch: edit function prefills fields
Thomas Junk <thomas.junk@intevation.de>
parents:
1961
diff
changeset
|
562 countries: this.countryCode.split(",").map(x => { |
53c1383dfee3
define stretch: edit function prefills fields
Thomas Junk <thomas.junk@intevation.de>
parents:
1961
diff
changeset
|
563 return x.trim(); |
53c1383dfee3
define stretch: edit function prefills fields
Thomas Junk <thomas.junk@intevation.de>
parents:
1961
diff
changeset
|
564 }) |
1889
b6d0460b069d
define stretches: Now with store-backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1888
diff
changeset
|
565 }; |
2569
2d18b8d5b9db
define_stretch: tolerance only visible for new stretch definitions
Thomas Junk <thomas.junk@intevation.de>
parents:
2567
diff
changeset
|
566 if (!this.editExistingStretch) { |
2d18b8d5b9db
define_stretch: tolerance only visible for new stretch definitions
Thomas Junk <thomas.junk@intevation.de>
parents:
2567
diff
changeset
|
567 data["tolerance"] = this.tolerance; |
2d18b8d5b9db
define_stretch: tolerance only visible for new stretch definitions
Thomas Junk <thomas.junk@intevation.de>
parents:
2567
diff
changeset
|
568 } |
1930
1aa864cccddc
define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents:
1921
diff
changeset
|
569 this.$store |
1aa864cccddc
define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents:
1921
diff
changeset
|
570 .dispatch("imports/saveStretch", data) |
1921
0059aa870a39
Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents:
1896
diff
changeset
|
571 .then(() => { |
0059aa870a39
Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents:
1896
diff
changeset
|
572 displayInfo({ |
0059aa870a39
Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents:
1896
diff
changeset
|
573 title: this.$gettext("Import"), |
1930
1aa864cccddc
define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents:
1921
diff
changeset
|
574 message: this.$gettext("Starting import of stretch") |
1921
0059aa870a39
Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents:
1896
diff
changeset
|
575 }); |
1930
1aa864cccddc
define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents:
1921
diff
changeset
|
576 this.clean(); |
2907
ab0a829735f6
client: import stretches: removed unnecessary wrapper method
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
577 this.$store.dispatch("imports/loadStretches").then(() => { |
1980
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
578 this.edit = false; |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
579 }); |
1921
0059aa870a39
Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents:
1896
diff
changeset
|
580 }) |
0059aa870a39
Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents:
1896
diff
changeset
|
581 .catch(error => { |
0059aa870a39
Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents:
1896
diff
changeset
|
582 const { status, data } = error.response; |
0059aa870a39
Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents:
1896
diff
changeset
|
583 displayError({ |
0059aa870a39
Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents:
1896
diff
changeset
|
584 title: this.$gettext("Backend Error"), |
0059aa870a39
Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents:
1896
diff
changeset
|
585 message: `${status}: ${data.message || data}` |
0059aa870a39
Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents:
1896
diff
changeset
|
586 }); |
0059aa870a39
Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents:
1896
diff
changeset
|
587 }); |
1809
b16a6db0008f
feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents:
1803
diff
changeset
|
588 } |
b16a6db0008f
feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents:
1803
diff
changeset
|
589 }, |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
590 mounted() { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
591 this.edit = false; |
2908
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
592 this.loading = true; |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
593 this.$store |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
594 .dispatch("imports/loadStretches") |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
595 .catch(error => { |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
596 const { status, data } = error.response; |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
597 displayError({ |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
598 title: this.$gettext("Backend Error"), |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
599 message: `${status}: ${data.message || data}` |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
600 }); |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
601 }) |
2821113846a9
client: import stretches: added spinner overlay when loading
Markus Kottlaender <markus@intevation.de>
parents:
2907
diff
changeset
|
602 .finally(() => (this.loading = false)); |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
603 this.loadStagingData().catch(error => { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
604 const { status, data } = error.response; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
605 displayError({ |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
606 title: this.$gettext("Backend Error"), |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
607 message: `${status}: ${data.message || data}` |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
608 }); |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2651
diff
changeset
|
609 }); |
1809
b16a6db0008f
feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents:
1803
diff
changeset
|
610 } |
1610
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
611 }; |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
612 </script> |
2ee243f9a7ee
import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
613 |
1980
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
614 <style lang="scss" scoped> |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
615 .linkto { |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
616 cursor: pointer; |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
617 } |
c8e2f6838eaf
define stretches: mark stretches in review
Thomas Junk <thomas.junk@intevation.de>
parents:
1977
diff
changeset
|
618 </style> |