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