annotate client/src/components/fairway/Profiles.vue @ 2540:3c17d401fbd4

client: cross profiles: moved waterlevel select to Profiles dialog aaaand also switched to the popup component as confirmation mechanism for deleting saved profiles
author Markus Kottlaender <markus@intevation.de>
date Thu, 07 Mar 2019 15:19:16 +0100
parents bb5286acfee2
children 468c8dc796cf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
1 <template>
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
2 <div
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
3 :class="[
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
4 'box ui-element rounded bg-white text-nowrap',
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
5 { expanded: showProfiles }
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
6 ]"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
7 >
2260
531e776cb81d client: reduced width of pdf-, profile- and identify-box
Markus Kottlaender <markus@intevation.de>
parents: 2154
diff changeset
8 <div style="width: 18rem">
2387
f185503ef35a client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents: 2365
diff changeset
9 <UIBoxHeader icon="chart-area" title="Profiles" :closeCallback="close" />
2534
bb5286acfee2 client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
10 <div class="box-body">
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
11 <div
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
12 class="loading d-flex justify-content-center align-items-center"
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
13 v-if="surveysLoading || profileLoading"
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
14 >
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
15 <font-awesome-icon icon="spinner" spin />
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
16 </div>
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
17 <select
2540
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
18 @change="moveToBottleneck"
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
19 v-model="selectedBottleneck"
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
20 class="form-control font-weight-bold"
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
21 >
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
22 <option :value="null">
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
23 <translate>Select Bottleneck</translate>
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
24 </option>
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
25 <option
2436
64ff5984351e client: renamed store property
Markus Kottlaender <markus@intevation.de>
parents: 2435
diff changeset
26 v-for="bn in bottlenecksList"
1379
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
27 :key="bn.properties.name"
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
28 :value="bn.properties.name"
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
29 >{{ bn.properties.name }}</option
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
30 >
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
31 </select>
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
32 <div v-if="selectedBottleneck">
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
33 <div class="d-flex mt-2">
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
34 <div class="flex-fill">
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
35 <small class="text-muted">
2540
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
36 <translate>Waterlevel</translate>:
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
37 </small>
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
38 <select
2540
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
39 v-model="selectedWaterLevel"
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
40 class="form-control form-control-sm small"
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
41 >
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
42 <option value="" v-if="Object.keys(waterLevels).length === 0">
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
43 <translate>Current</translate>
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
44 </option>
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
45 <option
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
46 v-for="wl in Object.keys(waterLevels)"
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
47 :key="wl"
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
48 :value="wl"
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
49 >
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
50 {{ formatSurveyDate(wl) }}
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
51 </option>
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
52 </select>
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
53 </div>
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
54 <div class="flex-fill ml-2">
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
55 <small class="text-muted"> <translate>Survey</translate>: </small>
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
56 <select
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
57 v-model="selectedSurvey"
2540
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
58 class="form-control form-control-sm small"
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
59 >
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
60 <option
1379
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
61 v-for="survey in surveys"
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
62 :key="survey.date_info"
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
63 :value="survey"
1521
276df8dadc14 bought localized datestrings
Thomas Junk <thomas.junk@intevation.de>
parents: 1518
diff changeset
64 >{{ formatSurveyDate(survey.date_info) }}</option
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
65 >
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
66 </select>
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
67 </div>
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
68 <div
2540
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
69 class="flex-fill ml-2"
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
70 v-if="selectedSurvey && surveys.length > 1"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
71 >
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
72 <small class="text-muted mt-1">
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
73 <translate>Compare with</translate>:
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
74 </small>
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
75 <select
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
76 v-model="additionalSurvey"
2540
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
77 class="form-control form-control-sm small"
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
78 >
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
79 <option :value="null">None</option>
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
80 <option
1379
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
81 v-for="survey in additionalSurveys"
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
82 :key="survey.date_info"
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
83 :value="survey"
1521
276df8dadc14 bought localized datestrings
Thomas Junk <thomas.junk@intevation.de>
parents: 1518
diff changeset
84 >{{ formatSurveyDate(survey.date_info) }}</option
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
85 >
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
86 </select>
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
87 </div>
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
88 </div>
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
89 <hr class="w-100 mb-0" />
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
90 <small class="text-muted d-block mt-2">
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
91 <translate>Saved cross profiles</translate>:
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
92 </small>
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
93 <div class="d-flex">
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
94 <select
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
95 :class="[
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
96 'form-control form-control-sm flex-fill',
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
97 { 'rounded-left-only': selectedCut }
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
98 ]"
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
99 v-model="selectedCut"
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
100 >
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
101 <option></option>
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
102 <option
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
103 v-for="(cut, index) in previousCuts"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
104 :value="cut"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
105 :key="index"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
106 >{{ cut.label }}</option
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
107 >
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
108 </select>
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
109 <button
2540
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
110 class="btn btn-sm btn-dark input-button-right"
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
111 @click="deleteSelectedCut(selectedCut)"
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
112 v-if="selectedCut"
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
113 >
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
114 <font-awesome-icon icon="trash" />
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
115 </button>
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
116 </div>
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
117 <small class="text-muted d-block mt-2">
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
118 <translate>Enter coordinates manually</translate>:
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
119 </small>
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
120 <div class="position-relative">
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
121 <input
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
122 class="form-control form-control-sm pr-5"
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
123 placeholder="Lat,Lon,Lat,Lon"
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
124 v-model="coordinatesInput"
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
125 />
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
126 <button
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
127 class="btn btn-sm btn-info position-absolute input-button-right"
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
128 @click="applyManualCoordinates"
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
129 style="top: 0; right: 0;"
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
130 v-if="coordinatesInputIsValid"
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
131 >
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
132 <font-awesome-icon icon="check" />
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
133 </button>
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
134 </div>
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
135 <small class="d-flex text-left mt-2" v-if="startPoint && endPoint">
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
136 <div class="text-nowrap mr-3">
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
137 <b> <translate>Start</translate>: </b> <br />
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
138 Lat: {{ startPoint[1] }} <br />
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
139 Lon: {{ startPoint[0] }}
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
140 </div>
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
141 <div class="text-nowrap">
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
142 <b>End:</b> <br />
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
143 Lat: {{ endPoint[1] }} <br />
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
144 Lon: {{ endPoint[0] }}
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
145 </div>
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
146 <button
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
147 v-clipboard:copy="coordinatesForClipboard"
1379
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
148 v-clipboard:success="onCopyCoordinates"
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
149 class="btn btn-info btn-sm ml-auto mt-auto"
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
150 >
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
151 <font-awesome-icon icon="copy" />
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
152 </button>
1379
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
153 </small>
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
154 <div class="d-flex mt-3">
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
155 <div
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
156 class="pr-3 w-50"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
157 v-if="startPoint && endPoint && !selectedCut"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
158 >
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
159 <button
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
160 class="btn btn-info btn-sm w-100"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
161 @click="showLabelInput = !showLabelInput"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
162 >
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
163 <font-awesome-icon :icon="showLabelInput ? 'times' : 'check'" />
1379
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
164 {{ showLabelInput ? "Cancel" : "Save" }}
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
165 </button>
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
166 </div>
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
167 <div
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
168 :class="startPoint && endPoint && !selectedCut ? 'w-50' : 'w-100'"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
169 >
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
170 <button class="btn btn-info btn-sm w-100" @click="toggleCutTool">
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
171 <font-awesome-icon
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
172 :icon="cutTool && cutTool.getActive() ? 'times' : 'plus'"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
173 ></font-awesome-icon>
1379
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
174 {{ cutTool && cutTool.getActive() ? "Cancel" : "New" }}
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
175 </button>
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
176 </div>
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
177 </div>
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
178 <div v-if="showLabelInput" class="mt-2">
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
179 <small class="text-muted">
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
180 <translate>Enter label for cross profile</translate>:
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
181 </small>
1379
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
182 <div class="position-relative">
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
183 <input
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
184 class="form-control form-control-sm pr-5"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
185 v-model="cutLabel"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
186 />
1379
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
187 <button
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
188 class="btn btn-sm btn-info position-absolute input-button-right"
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
189 @click="saveCut"
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
190 v-if="cutLabel"
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
191 style="top: 0; right: 0;"
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
192 >
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
193 <font-awesome-icon icon="check" />
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
194 </button>
1379
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
195 </div>
da44c669c9f5 formatted file
Markus Kottlaender <markus@intevation.de>
parents: 1377
diff changeset
196 </div>
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
197 </div>
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
198 </div>
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
199 </div>
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
200 </div>
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
201 </template>
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
202
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
203 <style lang="scss" scoped>
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
204 .loading {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
205 background: rgba(255, 255, 255, 0.9);
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
206 position: absolute;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
207 z-index: 99;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
208 top: 0;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
209 right: 0;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
210 bottom: 0;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
211 left: 0;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
212 }
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
213
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
214 .input-button-right {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
215 border-top-right-radius: $border-radius;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
216 border-bottom-right-radius: $border-radius;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
217 border-top-left-radius: 0 !important;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
218 border-bottom-left-radius: 0 !important;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
219 }
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
220
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
221 .rounded-left-only {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
222 border-top-right-radius: 0 !important;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
223 border-bottom-right-radius: 0 !important;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
224 border-top-left-radius: $border-radius;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
225 border-bottom-left-radius: $border-radius;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1441
diff changeset
226 }
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
227 </style>
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
228
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
229 <script>
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
230 /* This is Free Software under GNU Affero General Public License v >= 3.0
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
231 * without warranty, see README.md and license for details.
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
232 *
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
233 * SPDX-License-Identifier: AGPL-3.0-or-later
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
234 * License-Filename: LICENSES/AGPL-3.0.txt
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
235 *
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1399
diff changeset
236 * Copyright (C) 2018 by via donau
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
237 * – Österreichische Wasserstraßen-Gesellschaft mbH
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
238 * Software engineering by Intevation GmbH
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
239 *
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
240 * Author(s):
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
241 * Markus Kottländer <markus.kottlaender@intevation.de>
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
242 */
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
243 import { mapState, mapGetters } from "vuex";
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
244 import Feature from "ol/Feature";
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
245 import LineString from "ol/geom/LineString";
1613
f2d24dceecc7 refac: cleanup import paths
Thomas Junk <thomas.junk@intevation.de>
parents: 1558
diff changeset
246 import { displayError, displayInfo } from "@/lib/errors.js";
f2d24dceecc7 refac: cleanup import paths
Thomas Junk <thomas.junk@intevation.de>
parents: 1558
diff changeset
247 import { formatSurveyDate } from "@/lib/date.js";
2365
242c170e00ce client:use the name constants instead of strings
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2260
diff changeset
248 import { LAYERS } from "@/store/map.js";
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
249
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
250 export default {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
251 name: "profiles",
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
252 data() {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
253 return {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
254 coordinatesInput: "",
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
255 cutLabel: "",
2540
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
256 showLabelInput: false
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
257 };
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
258 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
259 computed: {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
260 ...mapGetters("map", ["getVSourceByName"]),
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
261 ...mapState("application", ["showProfiles"]),
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
262 ...mapState("map", ["lineTool", "polygonTool", "cutTool"]),
2436
64ff5984351e client: renamed store property
Markus Kottlaender <markus@intevation.de>
parents: 2435
diff changeset
263 ...mapState("bottlenecks", [
64ff5984351e client: renamed store property
Markus Kottlaender <markus@intevation.de>
parents: 2435
diff changeset
264 "bottlenecksList",
64ff5984351e client: renamed store property
Markus Kottlaender <markus@intevation.de>
parents: 2435
diff changeset
265 "surveys",
64ff5984351e client: renamed store property
Markus Kottlaender <markus@intevation.de>
parents: 2435
diff changeset
266 "surveysLoading"
64ff5984351e client: renamed store property
Markus Kottlaender <markus@intevation.de>
parents: 2435
diff changeset
267 ]),
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
268 ...mapState("fairwayprofile", [
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
269 "previousCuts",
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
270 "startPoint",
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
271 "endPoint",
2540
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
272 "profileLoading",
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
273 "waterLevels"
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
274 ]),
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
275 selectedBottleneck: {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
276 get() {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
277 return this.$store.state.bottlenecks.selectedBottleneck;
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
278 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
279 set(name) {
1553
35f85da41fdb fix: select first sounfing result after selecting bottleneck
Thomas Junk <thomas.junk@intevation.de>
parents: 1521
diff changeset
280 this.$store
35f85da41fdb fix: select first sounfing result after selecting bottleneck
Thomas Junk <thomas.junk@intevation.de>
parents: 1521
diff changeset
281 .dispatch("bottlenecks/setSelectedBottleneck", name)
35f85da41fdb fix: select first sounfing result after selecting bottleneck
Thomas Junk <thomas.junk@intevation.de>
parents: 1521
diff changeset
282 .then(() => {
35f85da41fdb fix: select first sounfing result after selecting bottleneck
Thomas Junk <thomas.junk@intevation.de>
parents: 1521
diff changeset
283 this.$store.commit("bottlenecks/setFirstSurveySelected");
35f85da41fdb fix: select first sounfing result after selecting bottleneck
Thomas Junk <thomas.junk@intevation.de>
parents: 1521
diff changeset
284 });
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
285 }
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
286 },
2540
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
287 selectedWaterLevel: {
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
288 get() {
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
289 return this.$store.state.fairwayprofile.selectedWaterLevel.date || "";
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
290 },
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
291 set(value) {
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
292 this.$store.commit("fairwayprofile/setSelectedWaterLevel", value);
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
293 }
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
294 },
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
295 selectedSurvey: {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
296 get() {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
297 return this.$store.state.bottlenecks.selectedSurvey;
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
298 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
299 set(survey) {
1394
b350b0b5cb6c refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents: 1391
diff changeset
300 this.$store.commit("fairwayprofile/additionalSurvey", null);
b350b0b5cb6c refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents: 1391
diff changeset
301 this.$store.commit("bottlenecks/selectedSurvey", survey);
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
302 }
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
303 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
304 additionalSurvey: {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
305 get() {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
306 return this.$store.state.fairwayprofile.additionalSurvey;
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
307 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
308 set(survey) {
1391
801ae5f4bc5b fixed bug when changing additional survey in profile dialog
Markus Kottlaender <markus@intevation.de>
parents: 1382
diff changeset
309 this.$store.commit("fairwayprofile/additionalSurvey", survey);
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
310 }
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
311 },
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
312 selectedCut: {
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
313 get() {
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
314 return this.$store.state.fairwayprofile.selectedCut;
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
315 },
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
316 set(cut) {
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
317 this.$store.commit("fairwayprofile/selectedCut", cut);
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
318 if (!cut) {
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
319 this.$store.commit("fairwayprofile/clearCurrentProfile");
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
320 this.$store.commit("application/showSplitscreen", false);
2365
242c170e00ce client:use the name constants instead of strings
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2260
diff changeset
321 this.getVSourceByName(LAYERS.CUTTOOL).clear();
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
322 }
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
323 }
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
324 },
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
325 additionalSurveys() {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
326 return this.surveys.filter(survey => survey !== this.selectedSurvey);
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
327 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
328 coordinatesForClipboard() {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
329 return (
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
330 this.startPoint[1] +
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
331 "," +
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
332 this.startPoint[0] +
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
333 "," +
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
334 this.endPoint[1] +
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
335 "," +
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
336 this.endPoint[0]
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
337 );
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
338 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
339 coordinatesInputIsValid() {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
340 const coordinates = this.coordinatesInput
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
341 .split(",")
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
342 .map(coord => parseFloat(coord.trim()))
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
343 .filter(c => Number(c) === c);
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
344 return coordinates.length === 4;
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
345 }
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
346 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
347 watch: {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
348 selectedBottleneck() {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
349 this.$store.dispatch("fairwayprofile/previousCuts");
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
350 this.cutLabel =
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
351 this.selectedBottleneck + " (" + new Date().toISOString() + ")";
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
352 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
353 selectedSurvey(survey) {
1394
b350b0b5cb6c refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents: 1391
diff changeset
354 this.loadProfile(survey);
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
355 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
356 additionalSurvey(survey) {
1394
b350b0b5cb6c refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents: 1391
diff changeset
357 this.loadProfile(survey);
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
358 },
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
359 selectedCut(cut) {
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
360 if (cut) {
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
361 this.applyCoordinates(cut.coordinates);
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
362 }
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
363 }
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
364 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
365 methods: {
2387
f185503ef35a client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents: 2365
diff changeset
366 close() {
f185503ef35a client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents: 2365
diff changeset
367 this.$store.commit("application/showProfiles", false);
f185503ef35a client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents: 2365
diff changeset
368 },
1521
276df8dadc14 bought localized datestrings
Thomas Junk <thomas.junk@intevation.de>
parents: 1518
diff changeset
369 formatSurveyDate(date) {
276df8dadc14 bought localized datestrings
Thomas Junk <thomas.junk@intevation.de>
parents: 1518
diff changeset
370 return formatSurveyDate(date);
276df8dadc14 bought localized datestrings
Thomas Junk <thomas.junk@intevation.de>
parents: 1518
diff changeset
371 },
1394
b350b0b5cb6c refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents: 1391
diff changeset
372 loadProfile(survey) {
b350b0b5cb6c refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents: 1391
diff changeset
373 if (survey) {
b350b0b5cb6c refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents: 1391
diff changeset
374 this.$store.commit("fairwayprofile/profileLoading", true);
1399
8e2c9e518440 improved search style
Markus Kottlaender <markus@intevation.de>
parents: 1396
diff changeset
375 this.$store
8e2c9e518440 improved search style
Markus Kottlaender <markus@intevation.de>
parents: 1396
diff changeset
376 .dispatch("fairwayprofile/loadProfile", survey)
8e2c9e518440 improved search style
Markus Kottlaender <markus@intevation.de>
parents: 1396
diff changeset
377 .finally(() =>
8e2c9e518440 improved search style
Markus Kottlaender <markus@intevation.de>
parents: 1396
diff changeset
378 this.$store.commit("fairwayprofile/profileLoading", false)
8e2c9e518440 improved search style
Markus Kottlaender <markus@intevation.de>
parents: 1396
diff changeset
379 );
1394
b350b0b5cb6c refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents: 1391
diff changeset
380 }
b350b0b5cb6c refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents: 1391
diff changeset
381 },
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
382 toggleCutTool() {
1437
1cd1549aab47 fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents: 1435
diff changeset
383 this.cutTool.setActive(!this.cutTool.getActive());
1cd1549aab47 fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents: 1435
diff changeset
384 this.lineTool.setActive(false);
1cd1549aab47 fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents: 1435
diff changeset
385 this.polygonTool.setActive(false);
1cd1549aab47 fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents: 1435
diff changeset
386 this.$store.commit("map/setCurrentMeasurement", null);
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
387 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
388 onCopyCoordinates() {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
389 displayInfo({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1437
diff changeset
390 message: this.$gettext("Coordinates copied to clipboard!")
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
391 });
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
392 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
393 applyManualCoordinates() {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
394 const coordinates = this.coordinatesInput
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
395 .split(",")
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
396 .map(coord => parseFloat(coord.trim()));
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
397 this.selectedCut = null;
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
398 this.coordinatesInput = "";
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
399 this.applyCoordinates([
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
400 coordinates[1],
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
401 coordinates[0],
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
402 coordinates[3],
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
403 coordinates[2]
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
404 ]);
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
405 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
406 applyCoordinates(coordinates) {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
407 // allow only numbers
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
408 coordinates = coordinates.filter(c => Number(c) === c);
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
409 if (coordinates.length === 4) {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
410 // draw line on map
2365
242c170e00ce client:use the name constants instead of strings
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2260
diff changeset
411 this.getVSourceByName(LAYERS.CUTTOOL).clear();
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
412 const cut = new Feature({
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
413 geometry: new LineString([
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
414 [coordinates[0], coordinates[1]],
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
415 [coordinates[2], coordinates[3]]
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
416 ]).transform("EPSG:4326", "EPSG:3857")
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
417 });
2365
242c170e00ce client:use the name constants instead of strings
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2260
diff changeset
418 this.getVSourceByName(LAYERS.CUTTOOL).addFeature(cut);
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
419
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
420 // draw diagram
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
421 this.$store.dispatch("fairwayprofile/cut", cut);
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
422 } else {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
423 displayError({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1437
diff changeset
424 title: this.$gettext("Invalid input"),
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1437
diff changeset
425 message: this.$gettext(
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
426 "Please enter correct coordinates in the format: Lat,Lon,Lat,Lon"
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1437
diff changeset
427 )
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
428 });
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
429 }
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
430 },
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
431 saveCut() {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
432 const previousCuts =
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
433 JSON.parse(localStorage.getItem("previousCuts")) || [];
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
434 const newEntry = {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
435 label: this.cutLabel,
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
436 bottleneckName: this.selectedBottleneck,
1377
fa7d647f8d77 added timestamp to saved cross profiles
Markus Kottlaender <markus@intevation.de>
parents: 1372
diff changeset
437 coordinates: [...this.startPoint, ...this.endPoint],
fa7d647f8d77 added timestamp to saved cross profiles
Markus Kottlaender <markus@intevation.de>
parents: 1372
diff changeset
438 timestamp: new Date().getTime()
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
439 };
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
440 const existingEntry = previousCuts.find(cut => {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
441 return JSON.stringify(cut) === JSON.stringify(newEntry);
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
442 });
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
443 if (!existingEntry) previousCuts.push(newEntry);
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
444 if (previousCuts.length > 100) previousCuts.shift();
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
445 localStorage.setItem("previousCuts", JSON.stringify(previousCuts));
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
446 this.$store.dispatch("fairwayprofile/previousCuts");
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
447
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
448 this.showLabelInput = false;
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
449 displayInfo({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1437
diff changeset
450 title: this.$gettext("Profile saved!"),
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1437
diff changeset
451 message: this.$gettext(
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
452 'You can now select these coordinates from the "Saved cross profiles" menu to restore this cross profile.'
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1437
diff changeset
453 )
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
454 });
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
455 },
2540
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
456 deleteSelectedCut(cut) {
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
457 this.$store.commit("application/popup", {
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
458 icon: "trash",
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
459 title: this.$gettext("Delete cross profile"),
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
460 content:
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
461 this.$gettext("Do you really want to delete the cross profile:") +
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
462 `<br>
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
463 <b>${cut.label}</b>`,
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
464 confirm: {
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
465 label: this.$gettext("Delete"),
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
466 icon: "trash",
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
467 callback: () => {
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
468 let previousCuts =
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
469 JSON.parse(localStorage.getItem("previousCuts")) || [];
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
470 previousCuts = previousCuts.filter(cut => {
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
471 return JSON.stringify(cut) !== JSON.stringify(this.selectedCut);
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
472 });
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
473 localStorage.setItem("previousCuts", JSON.stringify(previousCuts));
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
474 this.$store.commit("fairwayprofile/selectedCut", null);
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
475 this.$store.dispatch("fairwayprofile/previousCuts");
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
476 displayInfo({ title: this.$gettext("Profile deleted!") });
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
477 }
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
478 },
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
479 cancel: {
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
480 label: this.$gettext("Cancel"),
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
481 icon: "times"
3c17d401fbd4 client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
482 }
1395
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
483 });
210e9f16f8a0 delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents: 1394
diff changeset
484 },
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
485 moveToBottleneck() {
2436
64ff5984351e client: renamed store property
Markus Kottlaender <markus@intevation.de>
parents: 2435
diff changeset
486 const bottleneck = this.bottlenecksList.find(
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
487 bn => bn.properties.name === this.selectedBottleneck
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
488 );
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
489 if (!bottleneck) return;
2136
3138d60dd1a6 moveToExtent substitutes moveMap where easy doable
Thomas Junk <thomas.junk@intevation.de>
parents: 1613
diff changeset
490 this.$store.commit("map/moveToExtent", {
3138d60dd1a6 moveToExtent substitutes moveMap where easy doable
Thomas Junk <thomas.junk@intevation.de>
parents: 1613
diff changeset
491 feature: bottleneck,
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
492 zoom: 17,
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
493 preventZoomOut: true
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
494 });
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
495 }
2434
817b3d726b43 client: loadBottlenecks (bottleneck_overview) only where needed
Markus Kottlaender <markus@intevation.de>
parents: 2387
diff changeset
496 },
817b3d726b43 client: loadBottlenecks (bottleneck_overview) only where needed
Markus Kottlaender <markus@intevation.de>
parents: 2387
diff changeset
497 mounted() {
2435
3679d604645e client: renamed store action
Markus Kottlaender <markus@intevation.de>
parents: 2434
diff changeset
498 this.$store.dispatch("bottlenecks/loadBottlenecksList");
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
499 }
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
500 };
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
501 </script>