annotate client/src/components/ImportStretches.vue @ 1930:1aa864cccddc

define stretches: converted to vuex
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 21 Jan 2019 11:57:03 +0100
parents 0059aa870a39
children d1b7b1c70410
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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">
1797
67340ceecc5f feat: define sections and stretches etd
Thomas Junk <thomas.junk@intevation.de>
parents: 1669
diff changeset
3 <h6 class="mb-0 py-2 px-3 border-bottom d-flex align-items-center">
67340ceecc5f feat: define sections and stretches etd
Thomas Junk <thomas.junk@intevation.de>
parents: 1669
diff changeset
4 <font-awesome-icon icon="road" class="mr-2"></font-awesome-icon>
1870
3050d702913a sections and stretches: only stretches. only sysadmin.
Thomas Junk <thomas.junk@intevation.de>
parents: 1827
diff changeset
5 <translate>Define stretches</translate>
1797
67340ceecc5f feat: define sections and stretches etd
Thomas Junk <thomas.junk@intevation.de>
parents: 1669
diff changeset
6 </h6>
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
7 <div v-if="!edit" class="mb-3">
1888
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
8 <div class="mt-3 mb-2 mr-3 ml-3 d-flex flex-row border-bottom">
1896
5f2510523b9c define stretches: header class added
Thomas Junk <thomas.junk@intevation.de>
parents: 1889
diff changeset
9 <div class="header id">id</div>
5f2510523b9c define stretches: header class added
Thomas Junk <thomas.junk@intevation.de>
parents: 1889
diff changeset
10 <div class="header funktion">funktion</div>
5f2510523b9c define stretches: header class added
Thomas Junk <thomas.junk@intevation.de>
parents: 1889
diff changeset
11 <div class="header startrhm">startrhm</div>
5f2510523b9c define stretches: header class added
Thomas Junk <thomas.junk@intevation.de>
parents: 1889
diff changeset
12 <div class="header endrhm">endrhm</div>
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
13 </div>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
14 <div
1888
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
15 class=" mr-3 ml-3 d-flex flex-row"
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
16 v-for="stretch in stretches"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
17 :key="stretch.id"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
18 >
1888
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
19 <div class="id">{{ stretch.id }}</div>
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
20 <div class="funktion">{{ stretch.funktion }}</div>
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
21 <div class="startrhm">{{ stretch.startrhm }}</div>
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
22 <div class="endrhm">{{ stretch.endrhm }}</div>
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
23 </div>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
24 <div class="mt-3" v-if="stretches.length == 0">
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
25 <translate>No results.</translate>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
26 </div>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
27 </div>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
28 <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
29 <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
30 <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
31 <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
32 <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
33 <input
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
34 id="id"
1870
3050d702913a sections and stretches: only stretches. only sysadmin.
Thomas Junk <thomas.junk@intevation.de>
parents: 1827
diff changeset
35 type="text"
3050d702913a sections and stretches: only stretches. only sysadmin.
Thomas Junk <thomas.junk@intevation.de>
parents: 1827
diff changeset
36 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
37 placeholder="AT_Section_12"
1870
3050d702913a sections and stretches: only stretches. only sysadmin.
Thomas Junk <thomas.junk@intevation.de>
parents: 1827
diff changeset
38 aria-label="id"
3050d702913a sections and stretches: only stretches. only sysadmin.
Thomas Junk <thomas.junk@intevation.de>
parents: 1827
diff changeset
39 v-model="id"
3050d702913a sections and stretches: only stretches. only sysadmin.
Thomas Junk <thomas.junk@intevation.de>
parents: 1827
diff changeset
40 />
3050d702913a sections and stretches: only stretches. only sysadmin.
Thomas Junk <thomas.junk@intevation.de>
parents: 1827
diff changeset
41 <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
42 <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
43 <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
44 </small>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
45 </span>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
46 </div>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
47 <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
48 <div>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
49 <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
50 <translate>Countrycode</translate>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
51 </small>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
52 <input
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
53 id="countryCode"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
54 type="text"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
55 class="form-control"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
56 placeholder="AT"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
57 aria-label="id"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
58 v-model="countryCode"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
59 />
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
60 <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
61 <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
62 <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
63 </small>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
64 </span>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
65 </div>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
66 <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
67 </div>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
68 </div>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
69 <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
70 <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
71 <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
72 <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
73 <input
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
74 id="startrhm"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
75 type="text"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
76 class="form-control"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
77 placeholder="e.g. ATXXX00001000000019900"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
78 aria-label="startrhm"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
79 v-model="startrhm"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
80 />
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
81 <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
82 <font-awesome-icon
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
83 @click="togglePipette('start')"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
84 :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
85 icon="bullseye"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
86 ></font-awesome-icon>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
87 </span>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
88 </div>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
89 <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
90 <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
91 <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
92 </small>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
93 </span>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
94 </div>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
95 <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
96 <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
97 <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
98 <input
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
99 id="endrhm"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
100 type="text"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
101 class="form-control"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
102 placeholder="e.g. ATXXX00001000000019900"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
103 aria-label="endrhm"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
104 v-model="endrhm"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
105 />
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
106 <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
107 <font-awesome-icon
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
108 @click="togglePipette('end')"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
109 :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
110 icon="bullseye"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
111 ></font-awesome-icon>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
112 </span>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
113 </div>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
114 <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
115 <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
116 <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
117 </small>
3050d702913a sections and stretches: only stretches. only sysadmin.
Thomas Junk <thomas.junk@intevation.de>
parents: 1827
diff changeset
118 </span>
3050d702913a sections and stretches: only stretches. only sysadmin.
Thomas Junk <thomas.junk@intevation.de>
parents: 1827
diff changeset
119 </div>
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
120 </div>
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
121 <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
122 <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
123 <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
124 <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
125 </small>
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
126 <input
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
127 id="objbn"
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
128 type="text"
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
129 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
130 placeholder=""
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
131 aria-label="objbn"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
132 v-model="objbn"
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
133 />
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
134 <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
135 <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
136 <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
137 </small>
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
138 </span>
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
139 </div>
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
140 <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
141 <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
142 <translate>National Object name</translate>
1803
975a7de89f05 define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 1797
diff changeset
143 </small>
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
144 <input
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
145 id="nobjbn"
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
146 type="text"
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
147 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
148 placeholder=""
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
149 aria-label="nobjbn"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
150 v-model="nobjbn"
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
151 />
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
152 <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
153 <small v-if="nobjbnError && !nobjbn">
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
154 <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
155 </small>
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
156 </span>
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
157 </div>
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
158 </div>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
159 <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
160 <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
161 <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
162 <input
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
163 id="date_info"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
164 type="date"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
165 class="form-control"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
166 placeholder="date_info"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
167 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
168 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
169 />
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
170 <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
171 <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
172 <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
173 </small>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
174 </span>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
175 </div>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
176 <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
177 <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
178 <input
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
179 id="source"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
180 type="text"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
181 class="form-control"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
182 placeholder="source"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
183 aria-label="source"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
184 v-model="source"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
185 />
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
186 <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
187 <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
188 <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
189 </small>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
190 </span>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
191 </div>
1803
975a7de89f05 define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 1797
diff changeset
192 </div>
975a7de89f05 define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 1797
diff changeset
193 </div>
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
194 <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
195 <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
196 <button
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
197 @click="save"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
198 type="submit"
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
199 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
200 >
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
201 <translate>Submit</translate>
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
202 </button>
1803
975a7de89f05 define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 1797
diff changeset
203 </div>
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
204 </div>
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
205 <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
206 <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
207 <translate>New stretch</translate>
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
208 </button>
1803
975a7de89f05 define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 1797
diff changeset
209 </div>
1610
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
210 </div>
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
211 </template>
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
212
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
213 <script>
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
214 /* 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
215 * without warranty, see README.md and license for details.
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
216 *
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
217 * SPDX-License-Identifier: AGPL-3.0-or-later
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
218 * License-Filename: LICENSES/AGPL-3.0.txt
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
219 *
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
220 * Copyright (C) 2018 by via donau
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
221 * – Österreichische Wasserstraßen-Gesellschaft mbH
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
222 * Software engineering by Intevation GmbH
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
223 *
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
224 * Author(s):
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
225 * Thomas Junk <thomas.junk@intevation.de>
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
226 */
1827
27c4effba5b1 stretches only for sysadmin plus country code
Thomas Junk <thomas.junk@intevation.de>
parents: 1823
diff changeset
227 import { mapState, mapGetters } from "vuex";
1921
0059aa870a39 Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents: 1896
diff changeset
228 import { displayError, displayInfo } from "@/lib/errors.js";
1610
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
229
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
230 export default {
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
231 name: "importstretches",
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
232 data() {
1803
975a7de89f05 define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 1797
diff changeset
233 return {
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
234 edit: false,
1803
975a7de89f05 define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 1797
diff changeset
235 id: "",
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
236 funktion: "",
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
237 startrhm: "",
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
238 endrhm: "",
1803
975a7de89f05 define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 1797
diff changeset
239 objbn: "",
975a7de89f05 define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 1797
diff changeset
240 nobjbn: "",
1827
27c4effba5b1 stretches only for sysadmin plus country code
Thomas Junk <thomas.junk@intevation.de>
parents: 1823
diff changeset
241 countryCode: "",
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
242 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
243 source: "",
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
244 pipetteStart: false,
1816
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
245 pipetteEnd: false,
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
246 idError: false,
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
247 funktionError: false,
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
248 startrhmError: false,
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
249 endrhmError: false,
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
250 objbnError: false,
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
251 nobjbnError: false,
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
252 date_infoError: false,
1827
27c4effba5b1 stretches only for sysadmin plus country code
Thomas Junk <thomas.junk@intevation.de>
parents: 1823
diff changeset
253 sourceError: false,
27c4effba5b1 stretches only for sysadmin plus country code
Thomas Junk <thomas.junk@intevation.de>
parents: 1823
diff changeset
254 countryCodeError: false
1803
975a7de89f05 define stretches WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 1797
diff changeset
255 };
1610
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
256 },
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
257 mounted() {
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
258 this.edit = false;
1930
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
259 // this.$store.dispatch("imports/loadStretches").catch(error => {
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
260 // const { status, data } = error.response;
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
261 // displayError({
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
262 // title: this.$gettext("Backend Error"),
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
263 // message: `${status}: ${data.message || data}`
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
264 // });
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
265 // });
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
266 },
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
267 methods: {
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
268 clean() {
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
269 this.id = "";
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
270 this.funktion = "";
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
271 this.startrhm = "";
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
272 this.endrhm = "";
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
273 this.objbn = "";
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
274 this.nobjbn = "";
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
275 this.countryCode = "";
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
276 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
277 this.source = "";
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
278 this.pipetteStart = false;
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
279 this.pipetteEnd = false;
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
280 this.idError = false;
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
281 this.funktionError = false;
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
282 this.startrhmError = false;
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
283 this.endrhmError = false;
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
284 this.objbnError = false;
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
285 this.nobjbnError = false;
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
286 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
287 this.sourceError = false;
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
288 this.countryCodeError = false;
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
289 },
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
290 startEdit() {
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
291 this.clean();
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
292 this.edit = true;
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
293 },
1823
7d37d9f5f272 define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1816
diff changeset
294 togglePipette(t) {
7d37d9f5f272 define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1816
diff changeset
295 if (t === "start") {
7d37d9f5f272 define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1816
diff changeset
296 this.pipetteStart = !this.pipetteStart;
7d37d9f5f272 define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1816
diff changeset
297 this.pipetteEnd = false;
7d37d9f5f272 define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1816
diff changeset
298 } else {
7d37d9f5f272 define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1816
diff changeset
299 this.pipetteEnd = !this.pipetteEnd;
7d37d9f5f272 define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1816
diff changeset
300 this.pipetteStart = false;
7d37d9f5f272 define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1816
diff changeset
301 }
7d37d9f5f272 define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1816
diff changeset
302 },
1816
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
303 validate() {
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
304 const fields = [
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
305 "id",
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
306 "funktion",
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
307 "startrhm",
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
308 "endrhm",
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
309 "objbn",
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
310 "date_info",
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
311 "source"
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
312 ];
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
313 fields.forEach(field => {
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
314 if (!this[field]) {
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
315 this[field + "Error"] = true;
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
316 } else {
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
317 this[field + "Error"] = false;
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
318 }
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
319 });
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
320 },
1871
8ae7a1fba4cd prototypical listview for stretches. new and back buttons. have fun
Thomas Junk <thomas.junk@intevation.de>
parents: 1870
diff changeset
321 save() {
1816
199fa7e759aa define stretches: more userfriendly errormessage behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1809
diff changeset
322 this.validate();
1930
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
323 const data = {
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
324 name: this.id,
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
325 from: this.startrhm,
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
326 to: this.endrhm,
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
327 "source-organization": this.source,
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
328 "date-info": this.date_info,
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
329 objnam: this.objbn,
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
330 nobjnam: this.nobjbn,
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
331 countries: this.countryCode.split(",")
1889
b6d0460b069d define stretches: Now with store-backend
Thomas Junk <thomas.junk@intevation.de>
parents: 1888
diff changeset
332 };
1930
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
333 this.$store
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
334 .dispatch("imports/saveStretch", data)
1921
0059aa870a39 Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents: 1896
diff changeset
335 .then(() => {
0059aa870a39 Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents: 1896
diff changeset
336 displayInfo({
0059aa870a39 Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents: 1896
diff changeset
337 title: this.$gettext("Import"),
1930
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
338 message: this.$gettext("Starting import of stretch")
1921
0059aa870a39 Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents: 1896
diff changeset
339 });
1930
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
340 this.clean();
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
341 this.edit = false;
1921
0059aa870a39 Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents: 1896
diff changeset
342 })
0059aa870a39 Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents: 1896
diff changeset
343 .catch(error => {
1930
1aa864cccddc define stretches: converted to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 1921
diff changeset
344 console.log(error);
1921
0059aa870a39 Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents: 1896
diff changeset
345 const { status, data } = error.response;
0059aa870a39 Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents: 1896
diff changeset
346 displayError({
0059aa870a39 Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents: 1896
diff changeset
347 title: this.$gettext("Backend Error"),
0059aa870a39 Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents: 1896
diff changeset
348 message: `${status}: ${data.message || data}`
0059aa870a39 Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents: 1896
diff changeset
349 });
0059aa870a39 Hotfixed stretch import.
Sascha Wilde <wilde@intevation.de>
parents: 1896
diff changeset
350 });
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
351 }
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
352 },
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
353 watch: {
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
354 identifiedFeatures() {
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
355 const filterDistanceMarks = x => {
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
356 return /^distance_marks/.test(x["id_"]);
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
357 };
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
358 const distanceMark = this.identifiedFeatures.filter(filterDistanceMarks);
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
359 if (distanceMark.length > 0) {
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
360 const value = distanceMark[0]["id_"]
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
361 .split(".")[1]
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
362 .replace(/,|\(|\)/g, "");
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
363 this.startrhm = this.pipetteStart ? value : this.startrhm;
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
364 this.endrhm = this.pipetteEnd ? value : this.endrhm;
1823
7d37d9f5f272 define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1816
diff changeset
365 this.pipetteStart = false;
7d37d9f5f272 define stretches: better targetting behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1816
diff changeset
366 this.pipetteEnd = false;
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
367 }
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
368 }
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
369 },
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
370 computed: {
1827
27c4effba5b1 stretches only for sysadmin plus country code
Thomas Junk <thomas.junk@intevation.de>
parents: 1823
diff changeset
371 ...mapState("map", ["identifiedFeatures", "currentMeasurement"]),
1889
b6d0460b069d define stretches: Now with store-backend
Thomas Junk <thomas.junk@intevation.de>
parents: 1888
diff changeset
372 ...mapGetters("user", ["isSysAdmin"]),
b6d0460b069d define stretches: Now with store-backend
Thomas Junk <thomas.junk@intevation.de>
parents: 1888
diff changeset
373 ...mapState("imports", ["stretches"])
1809
b16a6db0008f feat: define sections and stretches with targetting option
Thomas Junk <thomas.junk@intevation.de>
parents: 1803
diff changeset
374 }
1610
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
375 };
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
376 </script>
2ee243f9a7ee import stretches boilerplate added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
377
1888
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
378 <style lang="scss" scoped>
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
379 .id {
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
380 text-align: left;
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
381 width: 25%;
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
382 }
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
383
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
384 .funktion {
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
385 text-align: left;
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
386 width: 25%;
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
387 }
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
388
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
389 .endrhm {
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
390 text-align: left;
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
391 width: 25%;
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
392 }
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
393
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
394 .startrhm {
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
395 text-align: left;
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
396 width: 25%;
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
397 }
45197e7a7ad3 import stretches: listing layout fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 1871
diff changeset
398 </style>