annotate client/src/store/application.js @ 5586:215e6ba9651b surveysperbottleneckid

Added property "displayName" to bottlenecks. Before displayed, bottlenecks ordered by country are now checked for doubles per country. In case a double is found the displayName is enriched with the bottleneck_id. Otherwise the displayName is equal to "name" or "objnam". Example: const testList = [ { properties: { responsible_country: "AT", name: "Bananas", bottleneck_id: "BN1" } }, { properties: { responsible_country: "DE", name: "Bananas", bottleneck_id: "BN2" } }, { properties: { responsible_country: "DE", name: "Bananas", bottleneck_id: "BN3" } } ]; is rendered to: AT Bananas DE Bananas / BN2 Bananas / BN3
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 04 Apr 2022 15:12:43 +0200
parents 48bef30cdb72
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1063
7ec2133c6404 client: add area measurement. simpify code
Bernhard Reiter <bernhard@intevation.de>
parents: 1055
diff changeset
1 /* This is Free Software under GNU Affero General Public License v >= 3.0
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 1014
diff changeset
2 * without warranty, see README.md and license for details.
1063
7ec2133c6404 client: add area measurement. simpify code
Bernhard Reiter <bernhard@intevation.de>
parents: 1055
diff changeset
3 *
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 1014
diff changeset
4 * SPDX-License-Identifier: AGPL-3.0-or-later
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 1014
diff changeset
5 * License-Filename: LICENSES/AGPL-3.0.txt
1063
7ec2133c6404 client: add area measurement. simpify code
Bernhard Reiter <bernhard@intevation.de>
parents: 1055
diff changeset
6 *
1183
1d4801145a2d import soundingresults context now map instead administration
Thomas Junk <thomas.junk@intevation.de>
parents: 1123
diff changeset
7 * Copyright (C) 2018 by via donau
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 1014
diff changeset
8 * – Österreichische Wasserstraßen-Gesellschaft mbH
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 1014
diff changeset
9 * Software engineering by Intevation GmbH
1063
7ec2133c6404 client: add area measurement. simpify code
Bernhard Reiter <bernhard@intevation.de>
parents: 1055
diff changeset
10 *
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 1014
diff changeset
11 * Author(s):
1063
7ec2133c6404 client: add area measurement. simpify code
Bernhard Reiter <bernhard@intevation.de>
parents: 1055
diff changeset
12 * Thomas Junk <thomas.junk@intevation.de>
7ec2133c6404 client: add area measurement. simpify code
Bernhard Reiter <bernhard@intevation.de>
parents: 1055
diff changeset
13 * Markus Kottländer <markus.kottlaender@intevation.de>
7ec2133c6404 client: add area measurement. simpify code
Bernhard Reiter <bernhard@intevation.de>
parents: 1055
diff changeset
14 * Bernhard E. Reiter <bernhard.reiter@intevation.de>
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 1014
diff changeset
15 */
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 1014
diff changeset
16
5040
066b76ef5e6a selected time is refreshed after reloads
Thomas Junk <thomas.junk@intevation.de>
parents: 5037
diff changeset
17 import { displayError, displayInfo } from "@/lib/errors";
066b76ef5e6a selected time is refreshed after reloads
Thomas Junk <thomas.junk@intevation.de>
parents: 5037
diff changeset
18
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
19 import { HTTP } from "@/lib/http";
1096
aa1f5daf6fc9 refac: centralized stores
Thomas Junk <thomas.junk@intevation.de>
parents: 1063
diff changeset
20 import { version } from "../../package.json";
1014
77202406b1a7 reverted demo build target, include revision number based on version tag
Markus Kottlaender <markus@intevation.de>
parents: 810
diff changeset
21
1296
99c039e86624 replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
22 // initial state
99c039e86624 replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
23 const init = () => {
99c039e86624 replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
24 return {
3369
33c398df5cb5 client: implement download of the user manual
Fadi Abbud <fadi.abbud@intevation.de>
parents: 3296
diff changeset
25 userManualUrl: process.env.VUE_APP_USER_MANUAL_URL,
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
26 appTitle: process.env.VUE_APP_TITLE,
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
27 secondaryLogo: process.env.VUE_APP_SECONDARY_LOGO_URL,
1947
4235fa8f59d7 clien: pdf-gen: load logo externally; add prepare step
Bernhard Reiter <bernhard@intevation.de>
parents: 1634
diff changeset
28 logoForPDF: process.env.VUE_APP_LOGO_FOR_PDF_URL,
2384
c06b001dc26b client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents: 2257
diff changeset
29 popup: null,
4867
5555b77b8c4e report backenderror due to failing OL loaders
Thomas Junk <thomas.junk@intevation.de>
parents: 4495
diff changeset
30 backendError: false,
3146
b6cc4838d2c0 client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents: 3084
diff changeset
31 paneSetup: "DEFAULT",
3041
ccda334eed92 client: panes: improved panes rotation, works with pure css so that components don't need to be re-mounted
Markus Kottlaender <markus@intevation.de>
parents: 3011
diff changeset
32 paneRotate: 1,
1123
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
33 showSidebar: false,
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
34 showUsermenu: false,
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
35 showSearchbar: false,
1207
70116d392387 close bottleneck list: made searchbar collapse only if it was collapsed before
Markus Kottlaender <markus@intevation.de>
parents: 1204
diff changeset
36 showSearchbarLastState: false,
1123
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
37 showIdentify: false,
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
38 showLayers: true,
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
39 showPdfTool: false,
1282
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1264
diff changeset
40 showContextBox: false,
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents: 1296
diff changeset
41 showProfiles: false,
2596
8774054959a7 client: added Gauges dialog/tool to show waterlevel diagrams
Markus Kottlaender <markus@intevation.de>
parents: 2590
diff changeset
42 showGauges: false,
3231
2dab20bed284 show_statistics: refac to fairwayavailability
Thomas Junk <thomas.junk@intevation.de>
parents: 3182
diff changeset
43 showFairwayDepth: false,
3296
fa7dc3f31ef3 available_fairwaydepth_vs_lnwl: POC etd.
Thomas Junk <thomas.junk@intevation.de>
parents: 3231
diff changeset
44 showFairwayDepthLNWL: false,
5036
8f421cd3c746 client: Implemented first version of time-sliding
Fadi Abbud <fadi.abbud@intevation.de>
parents: 4867
diff changeset
45 showTimeSlider: false,
1282
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1264
diff changeset
46 contextBoxContent: null, // bottlenecks, imports, staging
4485
685a5fd3a2f3 Client: change toolbar to be extened by default
Bernhard Reiter <bernhard@intevation.de>
parents: 3850
diff changeset
47 expandToolbar: true,
4495
850968005e0a Limited list of countries in client to relevant ones.
Sascha Wilde <wilde@intevation.de>
parents: 4485
diff changeset
48 countries: ["AT", "SK", "HU", "HR", "RS", "BG", "RO"],
1204
ddfdf440da24 made searchbar contextual
Markus Kottlaender <markus@intevation.de>
parents: 1183
diff changeset
49 searchQuery: "",
5040
066b76ef5e6a selected time is refreshed after reloads
Thomas Junk <thomas.junk@intevation.de>
parents: 5037
diff changeset
50 selectedTime: new Date(),
5075
aeb100b4c41b timeslider: prerequisites for time travel
Thomas Junk <thomas.junk@intevation.de>
parents: 5063
diff changeset
51 currentVisibleTime: new Date(),
5085
fe63733750d7 client: correct refresh layers request time
Fadi Abbud <fadi.abbud@intevation.de>
parents: 5075
diff changeset
52 refreshLayersTime: new Date(),
5090
70bd5c824639 client: distinguish time in refreshLayers requests during Time-slider enable/disable
Fadi Abbud <fadi.abbud@intevation.de>
parents: 5085
diff changeset
53 storedTime: new Date(),
2825
d6c90d2c8c8d router: when not logged in the chosen route is temporary cached and after successful login restored and chache cleared
Thomas Junk <thomas.junk@intevation.de>
parents: 2596
diff changeset
54 version,
3617
bcf9713ee359 client: configuration: prepared fetching data accuracy values from backend
Markus Kottlaender <markus@intevation.de>
parents: 3369
diff changeset
55 tempRoute: "",
5288
48bef30cdb72 Client: limit displaying of error popup to only pdf-export mode(ECDIS layer)
Fadi Abbud <fadi.abbud@intevation.de>
parents: 5090
diff changeset
56 config: {},
48bef30cdb72 Client: limit displaying of error popup to only pdf-export mode(ECDIS layer)
Fadi Abbud <fadi.abbud@intevation.de>
parents: 5090
diff changeset
57 ongoingPDFExport: false
1296
99c039e86624 replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
58 };
99c039e86624 replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
59 };
99c039e86624 replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
60
99c039e86624 replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
61 export default {
99c039e86624 replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
62 init,
99c039e86624 replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
63 namespaced: true,
99c039e86624 replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
64 state: init(),
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
65 getters: {
1014
77202406b1a7 reverted demo build target, include revision number based on version tag
Markus Kottlaender <markus@intevation.de>
parents: 810
diff changeset
66 versionStr: state => {
77202406b1a7 reverted demo build target, include revision number based on version tag
Markus Kottlaender <markus@intevation.de>
parents: 810
diff changeset
67 // version number from package.json
77202406b1a7 reverted demo build target, include revision number based on version tag
Markus Kottlaender <markus@intevation.de>
parents: 810
diff changeset
68 let versionStr = "v" + state.version;
77202406b1a7 reverted demo build target, include revision number based on version tag
Markus Kottlaender <markus@intevation.de>
parents: 810
diff changeset
69
77202406b1a7 reverted demo build target, include revision number based on version tag
Markus Kottlaender <markus@intevation.de>
parents: 810
diff changeset
70 // hg revision
77202406b1a7 reverted demo build target, include revision number based on version tag
Markus Kottlaender <markus@intevation.de>
parents: 810
diff changeset
71 if (
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 1014
diff changeset
72 process.env.VUE_APP_HGREV &&
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 1014
diff changeset
73 (state.version.includes("dev") ||
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 1014
diff changeset
74 state.version.includes("beta") ||
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 1014
diff changeset
75 state.version.includes("alpha"))
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 1014
diff changeset
76 )
1634
05a2732cafac client: make version info comply to semver 2.0.0
Bernhard Reiter <bernhard@intevation.de>
parents: 1372
diff changeset
77 // a '+' according to semver 2.0.0 starts a build meta info section
05a2732cafac client: make version info comply to semver 2.0.0
Bernhard Reiter <bernhard@intevation.de>
parents: 1372
diff changeset
78 // which shall only have [0-9A-Za-z-] chars
05a2732cafac client: make version info comply to semver 2.0.0
Bernhard Reiter <bernhard@intevation.de>
parents: 1372
diff changeset
79 // and is to be ignored when determining the order
05a2732cafac client: make version info comply to semver 2.0.0
Bernhard Reiter <bernhard@intevation.de>
parents: 1372
diff changeset
80 versionStr += "+" + process.env.VUE_APP_HGREV;
1014
77202406b1a7 reverted demo build target, include revision number based on version tag
Markus Kottlaender <markus@intevation.de>
parents: 810
diff changeset
81
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 1014
diff changeset
82 return versionStr;
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
83 }
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
84 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
85 mutations: {
5288
48bef30cdb72 Client: limit displaying of error popup to only pdf-export mode(ECDIS layer)
Fadi Abbud <fadi.abbud@intevation.de>
parents: 5090
diff changeset
86 setOngoingPDFExport: (state, ongoingPDFExport) => {
48bef30cdb72 Client: limit displaying of error popup to only pdf-export mode(ECDIS layer)
Fadi Abbud <fadi.abbud@intevation.de>
parents: 5090
diff changeset
87 state.ongoingPDFExport = ongoingPDFExport;
48bef30cdb72 Client: limit displaying of error popup to only pdf-export mode(ECDIS layer)
Fadi Abbud <fadi.abbud@intevation.de>
parents: 5090
diff changeset
88 },
5075
aeb100b4c41b timeslider: prerequisites for time travel
Thomas Junk <thomas.junk@intevation.de>
parents: 5063
diff changeset
89 setCurrentVisibleTime: (state, currentVisibleTime) => {
aeb100b4c41b timeslider: prerequisites for time travel
Thomas Junk <thomas.junk@intevation.de>
parents: 5063
diff changeset
90 state.currentVisibleTime = currentVisibleTime;
aeb100b4c41b timeslider: prerequisites for time travel
Thomas Junk <thomas.junk@intevation.de>
parents: 5063
diff changeset
91 },
5085
fe63733750d7 client: correct refresh layers request time
Fadi Abbud <fadi.abbud@intevation.de>
parents: 5075
diff changeset
92 setLayerRefreshedTime: (state, refreshLayersTime) => {
fe63733750d7 client: correct refresh layers request time
Fadi Abbud <fadi.abbud@intevation.de>
parents: 5075
diff changeset
93 state.refreshLayersTime = refreshLayersTime;
fe63733750d7 client: correct refresh layers request time
Fadi Abbud <fadi.abbud@intevation.de>
parents: 5075
diff changeset
94 },
5090
70bd5c824639 client: distinguish time in refreshLayers requests during Time-slider enable/disable
Fadi Abbud <fadi.abbud@intevation.de>
parents: 5085
diff changeset
95 setStoredTime: (state, storedTime) => {
70bd5c824639 client: distinguish time in refreshLayers requests during Time-slider enable/disable
Fadi Abbud <fadi.abbud@intevation.de>
parents: 5085
diff changeset
96 state.storedTime = storedTime;
70bd5c824639 client: distinguish time in refreshLayers requests during Time-slider enable/disable
Fadi Abbud <fadi.abbud@intevation.de>
parents: 5085
diff changeset
97 },
2825
d6c90d2c8c8d router: when not logged in the chosen route is temporary cached and after successful login restored and chache cleared
Thomas Junk <thomas.junk@intevation.de>
parents: 2596
diff changeset
98 setTempRoute: (state, tempRoute) => {
d6c90d2c8c8d router: when not logged in the chosen route is temporary cached and after successful login restored and chache cleared
Thomas Junk <thomas.junk@intevation.de>
parents: 2596
diff changeset
99 state.tempRoute = tempRoute;
d6c90d2c8c8d router: when not logged in the chosen route is temporary cached and after successful login restored and chache cleared
Thomas Junk <thomas.junk@intevation.de>
parents: 2596
diff changeset
100 },
2384
c06b001dc26b client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents: 2257
diff changeset
101 popup: (state, popup) => {
c06b001dc26b client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents: 2257
diff changeset
102 state.popup = popup;
c06b001dc26b client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents: 2257
diff changeset
103 },
3146
b6cc4838d2c0 client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents: 3084
diff changeset
104 paneSetup: (state, setup) => {
b6cc4838d2c0 client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents: 3084
diff changeset
105 state.paneSetup = setup;
2984
61f69e8919d3 client: prepared splitview
Markus Kottlaender <markus@intevation.de>
parents: 2825
diff changeset
106 },
3041
ccda334eed92 client: panes: improved panes rotation, works with pure css so that components don't need to be re-mounted
Markus Kottlaender <markus@intevation.de>
parents: 3011
diff changeset
107 paneRotate: (state, rotate) => {
3084
5a1f243d9c7c client: panes: made paneRotate mutation automatically rotate if no rotation value is provided
Markus Kottlaender <markus@intevation.de>
parents: 3079
diff changeset
108 if (rotate) {
5a1f243d9c7c client: panes: made paneRotate mutation automatically rotate if no rotation value is provided
Markus Kottlaender <markus@intevation.de>
parents: 3079
diff changeset
109 state.paneRotate = rotate;
5a1f243d9c7c client: panes: made paneRotate mutation automatically rotate if no rotation value is provided
Markus Kottlaender <markus@intevation.de>
parents: 3079
diff changeset
110 } else {
5a1f243d9c7c client: panes: made paneRotate mutation automatically rotate if no rotation value is provided
Markus Kottlaender <markus@intevation.de>
parents: 3079
diff changeset
111 state.paneRotate++;
5a1f243d9c7c client: panes: made paneRotate mutation automatically rotate if no rotation value is provided
Markus Kottlaender <markus@intevation.de>
parents: 3079
diff changeset
112 if (state.paneRotate === 5) state.paneRotate = 1;
5a1f243d9c7c client: panes: made paneRotate mutation automatically rotate if no rotation value is provided
Markus Kottlaender <markus@intevation.de>
parents: 3079
diff changeset
113 }
2984
61f69e8919d3 client: prepared splitview
Markus Kottlaender <markus@intevation.de>
parents: 2825
diff changeset
114 },
5037
9d288d9b851b client: move selectedTime to store
Fadi Abbud <fadi.abbud@intevation.de>
parents: 5036
diff changeset
115 setSelectedTime: (state, time) => {
5036
8f421cd3c746 client: Implemented first version of time-sliding
Fadi Abbud <fadi.abbud@intevation.de>
parents: 4867
diff changeset
116 state.selectedTime = time;
8f421cd3c746 client: Implemented first version of time-sliding
Fadi Abbud <fadi.abbud@intevation.de>
parents: 4867
diff changeset
117 },
8f421cd3c746 client: Implemented first version of time-sliding
Fadi Abbud <fadi.abbud@intevation.de>
parents: 4867
diff changeset
118 showTimeSlider: (state, show) => {
8f421cd3c746 client: Implemented first version of time-sliding
Fadi Abbud <fadi.abbud@intevation.de>
parents: 4867
diff changeset
119 state.showTimeSlider = show;
8f421cd3c746 client: Implemented first version of time-sliding
Fadi Abbud <fadi.abbud@intevation.de>
parents: 4867
diff changeset
120 },
1123
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
121 showSidebar: (state, show) => {
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
122 state.showSidebar = show;
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
123 },
1123
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
124 showUsermenu: (state, show) => {
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
125 state.showUsermenu = show;
810
68a39aea942a Fairwayprofile
Thomas Junk <thomas.junk@intevation.de>
parents: 649
diff changeset
126 },
1123
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
127 showSearchbar: (state, show) => {
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
128 state.showSearchbar = show;
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
129 },
1123
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
130 showIdentify: (state, show) => {
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
131 state.showIdentify = show;
622
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 593
diff changeset
132 },
1123
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
133 showLayers: (state, show) => {
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
134 state.showLayers = show;
647
620a65f11b33 fix: splitscreenoption has to be reset for logout
Thomas Junk <thomas.junk@intevation.de>
parents: 622
diff changeset
135 },
1123
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
136 showPdfTool: (state, show) => {
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
137 state.showPdfTool = show;
1183
1d4801145a2d import soundingresults context now map instead administration
Thomas Junk <thomas.junk@intevation.de>
parents: 1123
diff changeset
138 },
1282
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1264
diff changeset
139 showContextBox: (state, show) => {
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1264
diff changeset
140 state.showContextBox = show;
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1264
diff changeset
141 },
1372
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents: 1296
diff changeset
142 showProfiles: (state, show) => {
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents: 1296
diff changeset
143 state.showProfiles = show;
553aadd97087 new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents: 1296
diff changeset
144 },
2596
8774054959a7 client: added Gauges dialog/tool to show waterlevel diagrams
Markus Kottlaender <markus@intevation.de>
parents: 2590
diff changeset
145 showGauges: (state, show) => {
8774054959a7 client: added Gauges dialog/tool to show waterlevel diagrams
Markus Kottlaender <markus@intevation.de>
parents: 2590
diff changeset
146 state.showGauges = show;
8774054959a7 client: added Gauges dialog/tool to show waterlevel diagrams
Markus Kottlaender <markus@intevation.de>
parents: 2590
diff changeset
147 },
3231
2dab20bed284 show_statistics: refac to fairwayavailability
Thomas Junk <thomas.junk@intevation.de>
parents: 3182
diff changeset
148 showFairwayDepth: (state, show) => {
2dab20bed284 show_statistics: refac to fairwayavailability
Thomas Junk <thomas.junk@intevation.de>
parents: 3182
diff changeset
149 state.showFairwayDepth = show;
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents: 3146
diff changeset
150 },
3296
fa7dc3f31ef3 available_fairwaydepth_vs_lnwl: POC etd.
Thomas Junk <thomas.junk@intevation.de>
parents: 3231
diff changeset
151 showFairwayDepthLNWL: (state, show) => {
fa7dc3f31ef3 available_fairwaydepth_vs_lnwl: POC etd.
Thomas Junk <thomas.junk@intevation.de>
parents: 3231
diff changeset
152 state.showFairwayDepthLNWL = show;
fa7dc3f31ef3 available_fairwaydepth_vs_lnwl: POC etd.
Thomas Junk <thomas.junk@intevation.de>
parents: 3231
diff changeset
153 },
1282
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1264
diff changeset
154 contextBoxContent: (state, context) => {
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1264
diff changeset
155 state.contextBoxContent = context;
1230
957907eaaa72 implemented context sensitive box below search bar (see: issue224)
Markus Kottlaender <markus@intevation.de>
parents: 1208
diff changeset
156 if (context) {
957907eaaa72 implemented context sensitive box below search bar (see: issue224)
Markus Kottlaender <markus@intevation.de>
parents: 1208
diff changeset
157 state.showSearchbarLastState = state.showSearchbar;
957907eaaa72 implemented context sensitive box below search bar (see: issue224)
Markus Kottlaender <markus@intevation.de>
parents: 1208
diff changeset
158 }
1208
8df4ebbc5c3f staging area
Thomas Junk <thomas.junk@intevation.de>
parents: 1207
diff changeset
159 },
1264
76bc179c181f made toolbar expandable
Markus Kottlaender <markus@intevation.de>
parents: 1230
diff changeset
160 expandToolbar: (state, expandToolbar) => {
76bc179c181f made toolbar expandable
Markus Kottlaender <markus@intevation.de>
parents: 1230
diff changeset
161 state.expandToolbar = expandToolbar;
76bc179c181f made toolbar expandable
Markus Kottlaender <markus@intevation.de>
parents: 1230
diff changeset
162 },
1204
ddfdf440da24 made searchbar contextual
Markus Kottlaender <markus@intevation.de>
parents: 1183
diff changeset
163 searchQuery: (state, searchQuery) => {
ddfdf440da24 made searchbar contextual
Markus Kottlaender <markus@intevation.de>
parents: 1183
diff changeset
164 state.searchQuery = searchQuery;
3617
bcf9713ee359 client: configuration: prepared fetching data accuracy values from backend
Markus Kottlaender <markus@intevation.de>
parents: 3369
diff changeset
165 },
bcf9713ee359 client: configuration: prepared fetching data accuracy values from backend
Markus Kottlaender <markus@intevation.de>
parents: 3369
diff changeset
166 config: (state, config) => {
bcf9713ee359 client: configuration: prepared fetching data accuracy values from backend
Markus Kottlaender <markus@intevation.de>
parents: 3369
diff changeset
167 state.config = config;
4867
5555b77b8c4e report backenderror due to failing OL loaders
Thomas Junk <thomas.junk@intevation.de>
parents: 4495
diff changeset
168 },
5555b77b8c4e report backenderror due to failing OL loaders
Thomas Junk <thomas.junk@intevation.de>
parents: 4495
diff changeset
169 setBackendErrorFlag: state => {
5555b77b8c4e report backenderror due to failing OL loaders
Thomas Junk <thomas.junk@intevation.de>
parents: 4495
diff changeset
170 state.backendError = true;
5555b77b8c4e report backenderror due to failing OL loaders
Thomas Junk <thomas.junk@intevation.de>
parents: 4495
diff changeset
171 },
5555b77b8c4e report backenderror due to failing OL loaders
Thomas Junk <thomas.junk@intevation.de>
parents: 4495
diff changeset
172 removeBackendErrorFlag: state => {
5555b77b8c4e report backenderror due to failing OL loaders
Thomas Junk <thomas.junk@intevation.de>
parents: 4495
diff changeset
173 state.backendError = false;
3617
bcf9713ee359 client: configuration: prepared fetching data accuracy values from backend
Markus Kottlaender <markus@intevation.de>
parents: 3369
diff changeset
174 }
bcf9713ee359 client: configuration: prepared fetching data accuracy values from backend
Markus Kottlaender <markus@intevation.de>
parents: 3369
diff changeset
175 },
bcf9713ee359 client: configuration: prepared fetching data accuracy values from backend
Markus Kottlaender <markus@intevation.de>
parents: 3369
diff changeset
176 actions: {
4867
5555b77b8c4e report backenderror due to failing OL loaders
Thomas Junk <thomas.junk@intevation.de>
parents: 4495
diff changeset
177 reportBackendError({ commit }) {
5555b77b8c4e report backenderror due to failing OL loaders
Thomas Junk <thomas.junk@intevation.de>
parents: 4495
diff changeset
178 const TWOMINUTES = 2 * 60 * 1000;
5555b77b8c4e report backenderror due to failing OL loaders
Thomas Junk <thomas.junk@intevation.de>
parents: 4495
diff changeset
179 commit("setBackendErrorFlag");
5555b77b8c4e report backenderror due to failing OL loaders
Thomas Junk <thomas.junk@intevation.de>
parents: 4495
diff changeset
180 setTimeout(() => {
5555b77b8c4e report backenderror due to failing OL loaders
Thomas Junk <thomas.junk@intevation.de>
parents: 4495
diff changeset
181 commit("removeBackendErrorFlag");
5555b77b8c4e report backenderror due to failing OL loaders
Thomas Junk <thomas.junk@intevation.de>
parents: 4495
diff changeset
182 }, TWOMINUTES);
5555b77b8c4e report backenderror due to failing OL loaders
Thomas Junk <thomas.junk@intevation.de>
parents: 4495
diff changeset
183 },
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
184 loadConfig({ commit }) {
3850
0d0e52612c32 client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents: 3627
diff changeset
185 return HTTP.get("/system/settings", {
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
186 headers: { "X-Gemma-Auth": localStorage.getItem("token") }
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
187 }).then(response => {
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
188 commit("config", response.data);
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
189 });
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
190 },
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
191 saveConfig(context, config) {
3850
0d0e52612c32 client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents: 3627
diff changeset
192 return HTTP.put("/system/settings", config, {
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
193 headers: {
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
194 "X-Gemma-Auth": localStorage.getItem("token"),
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
195 "Content-type": "application/json"
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
196 }
3627
67984bf6dba6 client: configuration: added info popup when saving settings
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
197 })
67984bf6dba6 client: configuration: added info popup when saving settings
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
198 .then(() => {
67984bf6dba6 client: configuration: added info popup when saving settings
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
199 displayInfo({
67984bf6dba6 client: configuration: added info popup when saving settings
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
200 message: "Configuration saved!"
67984bf6dba6 client: configuration: added info popup when saving settings
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
201 });
67984bf6dba6 client: configuration: added info popup when saving settings
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
202 })
67984bf6dba6 client: configuration: added info popup when saving settings
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
203 .catch(error => {
67984bf6dba6 client: configuration: added info popup when saving settings
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
204 const { status, data } = error.response;
67984bf6dba6 client: configuration: added info popup when saving settings
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
205 displayError({
67984bf6dba6 client: configuration: added info popup when saving settings
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
206 title: "Backend Error",
67984bf6dba6 client: configuration: added info popup when saving settings
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
207 message: `${status}: ${data.message || data}`
67984bf6dba6 client: configuration: added info popup when saving settings
Markus Kottlaender <markus@intevation.de>
parents: 3625
diff changeset
208 });
3625
a688a478e35f implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents: 3622
diff changeset
209 });
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
210 }
1123
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1115
diff changeset
211 }
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
212 };