annotate client/src/components/stretches/Stretches.vue @ 3276:75db3199f76e

client: define stretches: fixed review button for stretches with pending import
author Markus Kottlaender <markus@intevation.de>
date Wed, 15 May 2019 17:55:38 +0200
parents 98b5119cf4c1
children 439e1865a2d2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3263
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
1 <template>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
2 <div class="d-flex flex-column mb-3">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
3 <UIBoxHeader
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
4 icon="road"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
5 :title="defineStretchesLabel"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
6 :closeCallback="$parent.close"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
7 />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
8 <div class="position-relative">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
9 <UISpinnerOverlay v-if="loading" />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
10 <div v-if="!edit" class="mb-3">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
11 <UITableHeader
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
12 :columns="[
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
13 { id: 'properties.name', title: `${nameLabel}`, class: 'col-4' },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
14 {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
15 id: 'properties.date_info',
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
16 title: `${dateLabel}`,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
17 class: 'col-2'
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
18 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
19 {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
20 id: 'properties.source_organization',
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
21 title: `${sourceorganizationLabel}`,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
22 class: 'col-3'
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
23 }
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
24 ]"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
25 />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
26 <UITableBody
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
27 :data="filteredStretches() | sortTable(sortColumn, sortDirection)"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
28 >
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
29 <template v-slot:row="{ item: stretch }">
3276
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
30 <div class="py-1 col-4">
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
31 <a @click="moveMapToStretch(stretch)" href="#">
3265
f92f7c9df392 client: define stretches: fixed editing stretches
Markus Kottlaender <markus@intevation.de>
parents: 3263
diff changeset
32 {{ stretch.properties.name }}
f92f7c9df392 client: define stretches: fixed editing stretches
Markus Kottlaender <markus@intevation.de>
parents: 3263
diff changeset
33 </a>
3263
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
34 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
35 <div class="py-1 col-2">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
36 {{ stretch.properties.date_info | surveyDate }}
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
37 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
38 <div class="py-1 col-3">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
39 {{ stretch.properties.source_organization }}
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
40 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
41 <div class="py-1 col text-right">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
42 <button
3276
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
43 v-if="isInStaging(stretch.properties.name)"
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
44 @click="gotoStaging(stretch.properties.name)"
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
45 class="btn btn-xs btn-danger mr-1"
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
46 >
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
47 <font-awesome-icon
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
48 icon="exclamation-triangle"
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
49 fixed-width
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
50 v-tooltip="reviewTooltip"
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
51 />
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
52 </button>
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
53 <button
3263
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
54 class="btn btn-xs btn-dark mr-1"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
55 @click="editStretch(stretch)"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
56 >
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
57 <font-awesome-icon icon="pencil-alt" fixed-width />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
58 </button>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
59 <button
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
60 class="btn btn-xs btn-dark"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
61 @click="deleteStretch(stretch)"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
62 >
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
63 <font-awesome-icon icon="trash" fixed-width />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
64 </button>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
65 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
66 </template>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
67 </UITableBody>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
68 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
69 <div v-if="edit">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
70 <div class="ml-3 mr-3">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
71 <div class="d-flex flex-row justify-content-between">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
72 <div class="mt-2 w-50 mr-2 text-left">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
73 <small class="text-muted"> <translate>ID</translate> </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
74 <input
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
75 id="id"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
76 type="text"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
77 class="form-control"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
78 placeholder="AT_Section_12"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
79 aria-label="id"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
80 v-model="id"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
81 :disabled="editExistingStretch"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
82 />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
83 <span class="text-left text-danger">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
84 <small v-if="idError && !id">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
85 <translate>Please enter an id</translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
86 </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
87 </span>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
88 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
89 <div class="mt-2 w-50 ml-2 text-left">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
90 <div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
91 <small class="text-muted">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
92 <translate>Countrycode</translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
93 </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
94 <input
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
95 id="countryCode"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
96 type="text"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
97 class="form-control"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
98 placeholder="AT"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
99 aria-label="id"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
100 v-model="countryCode"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
101 />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
102 <span class="text-left text-danger">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
103 <small v-if="countryCodeError && !countryCode">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
104 <translate>Please enter a countrycode </translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
105 </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
106 </span>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
107 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
108 <div class="w-50 ml-2"></div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
109 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
110 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
111 <div class="d-flex flex-column justify-content-between">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
112 <div class="mt-2 text-left">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
113 <small class="text-muted">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
114 <translate>Start rhm</translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
115 </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
116 <div class="d-flex flex-row">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
117 <input
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
118 id="startrhm"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
119 type="text"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
120 class="form-control"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
121 placeholder="e.g. ATXXX000010000019900"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
122 aria-label="startrhm"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
123 v-model="startrhm"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
124 />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
125 <span class="input-group-text" @click="togglePipette('start')">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
126 <font-awesome-icon
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
127 :class="{ 'text-info': pipetteStart }"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
128 icon="crosshairs"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
129 />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
130 </span>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
131 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
132 <span class="text-left text-danger">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
133 <small v-if="startrhmError && !startrhm">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
134 <translate>Please enter a start point</translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
135 </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
136 </span>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
137 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
138 <div class="mt-2 text-left">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
139 <small class="text-muted"> <translate>End rhm</translate> </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
140 <div class="d-flex flex-row">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
141 <input
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
142 id="endrhm"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
143 type="text"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
144 class="form-control"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
145 placeholder="e.g. ATXXX000010000019900"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
146 aria-label="endrhm"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
147 v-model="endrhm"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
148 />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
149 <span class="input-group-text" @click="togglePipette('end')">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
150 <font-awesome-icon
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
151 :class="{ 'text-info': pipetteEnd }"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
152 icon="crosshairs"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
153 />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
154 </span>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
155 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
156 <span class="text-left text-danger">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
157 <small v-if="endrhmError && !endrhm">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
158 <translate>Please enter an end point</translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
159 </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
160 </span>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
161 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
162 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
163 <div
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
164 v-if="!editExistingStretch"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
165 class="d-flex flex-row justify-content-between"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
166 >
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
167 <div class="mt-2 mr-2 w-50 text-left">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
168 <small class="text-muted">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
169 <translate
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
170 >Tolerance for snapping of waterway axis [m]</translate
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
171 >
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
172 </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
173 <input
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
174 class="form-control"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
175 v-model.number="tolerance"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
176 placeholder=""
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
177 type="number"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
178 min="0"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
179 step="any"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
180 aria-label="tolerance"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
181 id="tolerance"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
182 />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
183 <span class="text-left text-danger">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
184 <small v-if="toleranceError && !tolerance">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
185 <translate>Please enter a tolerance value</translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
186 </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
187 </span>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
188 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
189 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
190 <div class="d-flex flex-row justify-content-between">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
191 <div class="mt-2 mr-2 w-50 text-left">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
192 <small class="text-muted">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
193 <translate>Object name</translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
194 </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
195 <input
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
196 id="objbn"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
197 type="text"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
198 class="form-control"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
199 placeholder=""
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
200 aria-label="objbn"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
201 v-model="objbn"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
202 />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
203 <span class="text-left text-danger">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
204 <small v-if="objbnError && !objbn">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
205 <translate>Please enter an objectname</translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
206 </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
207 </span>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
208 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
209 <div class="mt-2 ml-2 w-50 text-left">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
210 <small class="text-muted">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
211 <translate>National Object name</translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
212 </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
213 <input
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
214 id="nobjbn"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
215 type="text"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
216 class="form-control"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
217 placeholder=""
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
218 aria-label="nobjbn"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
219 v-model="nobjbn"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
220 />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
221 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
222 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
223 <div class="d-flex flex-row justify-content-between">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
224 <div class="mt-2 mr-2 w-50 text-left">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
225 <small class="text-muted">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
226 <translate>Date info</translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
227 </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
228 <input
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
229 id="date_info"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
230 type="date"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
231 class="form-control"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
232 placeholder="date_info"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
233 aria-label="date_info"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
234 v-model="date_info"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
235 />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
236 <span class="text-left text-danger">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
237 <small v-if="date_infoError && !date_info">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
238 <translate>Please enter a date</translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
239 </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
240 </span>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
241 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
242 <div class="mt-2 ml-2 w-50 text-left">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
243 <small class="text-muted"> <translate>Source</translate> </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
244 <input
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
245 id="source"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
246 type="text"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
247 class="form-control"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
248 placeholder="source"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
249 aria-label="source"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
250 v-model="source"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
251 />
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
252 <span class="text-left text-danger">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
253 <small v-if="sourceError && !source">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
254 <translate>Please enter a source</translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
255 </small>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
256 </span>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
257 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
258 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
259 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
260 <div class="text-right mt-2 mr-3 mb-3">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
261 <button @click="edit = false" class="btn btn-warning mr-2">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
262 Back
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
263 </button>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
264 <button
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
265 @click="save"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
266 type="submit"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
267 class="shadow-sm btn btn-info submit-button"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
268 >
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
269 <translate>Submit</translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
270 </button>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
271 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
272 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
273 <div class="text-right mr-3">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
274 <button v-if="!edit" @click="startEdit()" class="btn btn-info">
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
275 <translate>New stretch</translate>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
276 </button>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
277 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
278 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
279 </div>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
280 </template>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
281
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
282 <script>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
283 /* This is Free Software under GNU Affero General Public License v >= 3.0
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
284 * without warranty, see README.md and license for details.
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
285 *
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
286 * SPDX-License-Identifier: AGPL-3.0-or-later
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
287 * License-Filename: LICENSES/AGPL-3.0.txt
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
288 *
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
289 * Copyright (C) 2018, 2019 by via donau
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
290 * – Österreichische Wasserstraßen-Gesellschaft mbH
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
291 * Software engineering by Intevation GmbH
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
292 *
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
293 * Author(s):
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
294 * Thomas Junk <thomas.junk@intevation.de>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
295 * Tom Gottfried <tom.gottfried@intevation.de>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
296 */
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
297 import { mapState, mapGetters } from "vuex";
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
298 import { displayError, displayInfo } from "@/lib/errors";
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
299 import { HTTP } from "@/lib/http";
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
300 import { sortTable } from "@/lib/mixins";
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
301
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
302 export default {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
303 name: "importstretches",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
304 mixins: [sortTable],
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
305 data() {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
306 return {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
307 staging: [],
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
308 edit: false,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
309 editExistingStretch: false,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
310 id: "",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
311 funktion: "",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
312 startrhm: "",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
313 endrhm: "",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
314 tolerance: 5,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
315 objbn: "",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
316 nobjbn: "",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
317 countryCode: "",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
318 date_info: new Date().toISOString().split("T")[0],
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
319 source: "",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
320 pipetteStart: false,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
321 pipetteEnd: false,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
322 idError: false,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
323 funktionError: false,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
324 startrhmError: false,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
325 endrhmError: false,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
326 toleranceError: false,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
327 objbnError: false,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
328 nobjbnError: false,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
329 date_infoError: false,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
330 sourceError: false,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
331 countryCodeError: false,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
332 loading: false
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
333 };
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
334 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
335 computed: {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
336 ...mapState("application", ["searchQuery"]),
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
337 ...mapState("map", ["identifiedFeatures", "currentMeasurement"]),
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
338 ...mapGetters("map", ["openLayersMap"]),
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
339 ...mapGetters("user", ["isSysAdmin"]),
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
340 ...mapState("imports", ["stretches"]),
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
341 defineStretchesLabel() {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
342 return this.$gettext("Define Stretches");
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
343 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
344 nameLabel() {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
345 return this.$gettext("Name");
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
346 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
347 dateLabel() {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
348 return this.$gettext("Date");
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
349 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
350 sourceorganizationLabel() {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
351 return this.$gettext("Source organization");
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
352 },
3276
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
353 reviewTooltip() {
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
354 return this.$gettext("Review pending import");
3263
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
355 }
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
356 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
357 watch: {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
358 identifiedFeatures() {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
359 const distanceMark = this.identifiedFeatures.find(x =>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
360 /^distance_marks_geoserver/.test(x["id_"])
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
361 );
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
362 if (distanceMark) {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
363 const location = distanceMark.get("location");
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
364 this.startrhm = this.pipetteStart ? location : this.startrhm;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
365 this.endrhm = this.pipetteEnd ? location : this.endrhm;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
366 this.pipetteStart = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
367 this.pipetteEnd = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
368 this.$store.commit("map/mapPopupEnabled", true);
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
369 }
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
370 }
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
371 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
372 methods: {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
373 filteredStretches() {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
374 return this.stretches.filter(s => {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
375 return (s.properties.name + s.properties.source_organization)
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
376 .toLowerCase()
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
377 .includes(this.searchQuery.toLowerCase());
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
378 });
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
379 },
3274
c1beed689439 client: define stretches: inlined method
Markus Kottlaender <markus@intevation.de>
parents: 3272
diff changeset
380 gotoStaging(stretchName) {
3276
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
381 let pendingImport = this.staging.find(s => s.name === stretchName);
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
382 if (pendingImport)
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
383 this.$router.push("/imports/overview/" + pendingImport.id);
3263
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
384 },
3276
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
385 isInStaging(stretchName) {
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
386 return !!this.staging.find(s => s.name === stretchName);
3263
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
387 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
388 loadStagingData() {
3276
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
389 HTTP.get("/imports?states=pending&kinds=st", {
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
390 headers: { "X-Gemma-Auth": localStorage.getItem("token") }
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
391 })
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
392 .then(response => {
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
393 response.data.imports.forEach(i => {
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
394 HTTP.get("/imports/" + i.id, {
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
395 headers: { "X-Gemma-Auth": localStorage.getItem("token") }
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
396 })
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
397 .then(response => {
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
398 this.staging.push({
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
399 id: i.id,
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
400 name: response.data.summary.stretch
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
401 });
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
402 })
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
403 .catch(error => {
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
404 const { status, data } = error.response;
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
405 displayError({
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
406 title: this.$gettext("Backend Error"),
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
407 message: `${status}: ${data.message || data}`
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
408 });
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
409 })
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
410 .finally(() => (this.loading = false));
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
411 });
3263
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
412 })
3276
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
413 .catch(error => {
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
414 const { status, data } = error.response;
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
415 displayError({
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
416 title: this.$gettext("Backend Error"),
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
417 message: `${status}: ${data.message || data}`
3263
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
418 });
3276
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
419 });
3263
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
420 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
421 editStretch(stretch) {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
422 const properties = stretch.properties;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
423 this.date_info = properties.date_info.split("T")[0];
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
424 this.id = properties.name;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
425 this.nobjbn = properties.nobjnam;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
426 this.objbn = properties.objnam;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
427 this.countryCode = properties.countries;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
428 this.source = properties["source_organization"];
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
429 this.edit = true;
3265
f92f7c9df392 client: define stretches: fixed editing stretches
Markus Kottlaender <markus@intevation.de>
parents: 3263
diff changeset
430 this.startrhm = properties.lower.replace(/[,()]/g, "");
f92f7c9df392 client: define stretches: fixed editing stretches
Markus Kottlaender <markus@intevation.de>
parents: 3263
diff changeset
431 this.endrhm = properties.upper.replace(/[,()]/g, "");
3263
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
432 this.editExistingStretch = true;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
433 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
434 deleteStretch(stretch) {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
435 this.$store.commit("application/popup", {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
436 icon: "trash",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
437 title: this.$gettext("Delete Stretch"),
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
438 content:
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
439 this.$gettext("Do you really want to delete this stretch:") +
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
440 `<br>
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
441 <b>${stretch.properties.name}, ${
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
442 stretch.properties.source_organization
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
443 } (${stretch.properties.countries})</b>`,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
444 confirm: {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
445 label: this.$gettext("Delete"),
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
446 icon: "trash",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
447 callback: () => {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
448 displayInfo({
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
449 title: this.$gettext("Not implemented"),
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
450 message: this.$gettext("Deleting ") + stretch.id
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
451 });
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
452 }
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
453 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
454 cancel: {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
455 label: this.$gettext("Cancel"),
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
456 icon: "times"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
457 }
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
458 });
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
459 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
460 moveMapToStretch(stretch) {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
461 this.$store.commit("imports/selectedStretchId", stretch.id);
3272
a9d047ccf408 client: fairway availability: set stretch in dialog when selecting stretch from map/list
Markus Kottlaender <markus@intevation.de>
parents: 3265
diff changeset
462 this.$store.commit("fairwayavailability/type", "stretches");
a9d047ccf408 client: fairway availability: set stretch in dialog when selecting stretch from map/list
Markus Kottlaender <markus@intevation.de>
parents: 3265
diff changeset
463 this.$store.commit("application/showFairwayDepth", true);
3263
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
464 this.openLayersMap()
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
465 .getLayer("STRETCHES")
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
466 .setVisible(true);
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
467 this.$store.dispatch("map/moveToFeauture", {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
468 feature: stretch,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
469 zoom: 17,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
470 preventZoomOut: true
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
471 });
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
472 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
473 clean() {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
474 this.id = "";
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
475 this.edit = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
476 this.editExistingStretch = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
477 this.funktion = "";
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
478 this.startrhm = "";
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
479 this.tolerance = 5;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
480 this.endrhm = "";
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
481 this.objbn = "";
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
482 this.nobjbn = "";
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
483 this.countryCode = "";
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
484 this.date_info = new Date().toISOString().split("T")[0];
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
485 this.source = "";
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
486 this.pipetteStart = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
487 this.pipetteEnd = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
488 this.idError = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
489 this.funktionError = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
490 this.startrhmError = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
491 this.endrhmError = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
492 this.toleranceError = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
493 this.objbnError = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
494 this.nobjbnError = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
495 this.date_infoError = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
496 this.sourceError = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
497 this.countryCodeError = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
498 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
499 startEdit() {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
500 this.clean();
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
501 this.edit = true;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
502 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
503 togglePipette(t) {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
504 this.openLayersMap()
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
505 .getLayer("DISTANCEMARKSAXIS")
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
506 .setVisible(true);
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
507 if (t === "start") {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
508 this.$store.commit("map/mapPopupEnabled", this.pipetteStart);
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
509 this.pipetteStart = !this.pipetteStart;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
510 this.pipetteEnd = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
511 } else {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
512 this.$store.commit("map/mapPopupEnabled", this.pipetteEnd);
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
513 this.pipetteEnd = !this.pipetteEnd;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
514 this.pipetteStart = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
515 }
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
516 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
517 validate() {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
518 const fields = [
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
519 "id",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
520 "funktion",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
521 "startrhm",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
522 "tolerance",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
523 "endrhm",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
524 "objbn",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
525 "nobjbn",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
526 "countryCode",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
527 "date_info",
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
528 "source"
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
529 ];
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
530 fields.forEach(field => {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
531 if (!this[field]) {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
532 this[field + "Error"] = true;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
533 } else {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
534 this[field + "Error"] = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
535 }
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
536 });
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
537 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
538 save() {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
539 this.validate();
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
540 if (
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
541 !this.id ||
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
542 !this.startrhm ||
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
543 !this.endrhm ||
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
544 (!this.tolerance && this.editExistingStretch) ||
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
545 !this.source ||
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
546 !this.date_info ||
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
547 !this.objbn ||
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
548 !this.countryCode
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
549 )
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
550 return;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
551 const data = {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
552 name: this.id,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
553 from: this.startrhm,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
554 to: this.endrhm,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
555 "source-organization": this.source,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
556 "date-info": this.date_info,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
557 objnam: this.objbn,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
558 nobjnam: this.nobjbn,
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
559 countries: this.countryCode.split(",").map(x => {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
560 return x.trim();
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
561 })
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
562 };
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
563 if (!this.editExistingStretch) {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
564 data["tolerance"] = this.tolerance;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
565 }
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
566 this.$store
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
567 .dispatch("imports/saveStretch", data)
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
568 .then(() => {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
569 displayInfo({
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
570 title: this.$gettext("Import"),
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
571 message: this.$gettext("Starting import of stretch")
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
572 });
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
573 this.clean();
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
574 this.$store.dispatch("imports/loadStretches").then(() => {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
575 this.edit = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
576 });
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
577 })
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
578 .catch(error => {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
579 const { status, data } = error.response;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
580 displayError({
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
581 title: this.$gettext("Backend Error"),
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
582 message: `${status}: ${data.message || data}`
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
583 });
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
584 });
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
585 }
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
586 },
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
587 mounted() {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
588 this.edit = false;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
589 this.loading = true;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
590 this.$store
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
591 .dispatch("imports/loadStretches")
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
592 .catch(error => {
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
593 const { status, data } = error.response;
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
594 displayError({
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
595 title: this.$gettext("Backend Error"),
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
596 message: `${status}: ${data.message || data}`
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
597 });
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
598 })
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
599 .finally(() => (this.loading = false));
3276
75db3199f76e client: define stretches: fixed review button for stretches with pending import
Markus Kottlaender <markus@intevation.de>
parents: 3275
diff changeset
600 this.loadStagingData();
3263
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
601 }
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
602 };
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
603 </script>