Mercurial > gemma
annotate client/src/application/stores/application.js @ 657:40d3b697ea15
Add PostgreSQL extension for 3D processing
We already use it for cross section calculation (see cross.go).
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 14 Sep 2018 17:45:42 +0200 |
parents | 83081ba6c9c1 |
children | 68a39aea942a |
rev | line source |
---|---|
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 const defaultCollapseState = true; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
2 |
647
620a65f11b33
fix: splitscreenoption has to be reset for logout
Thomas Junk <thomas.junk@intevation.de>
parents:
622
diff
changeset
|
3 const initializeSplitScreen = () => { |
620a65f11b33
fix: splitscreenoption has to be reset for logout
Thomas Junk <thomas.junk@intevation.de>
parents:
622
diff
changeset
|
4 return { |
620a65f11b33
fix: splitscreenoption has to be reset for logout
Thomas Junk <thomas.junk@intevation.de>
parents:
622
diff
changeset
|
5 active: false, |
620a65f11b33
fix: splitscreenoption has to be reset for logout
Thomas Junk <thomas.junk@intevation.de>
parents:
622
diff
changeset
|
6 mode: "v" |
620a65f11b33
fix: splitscreenoption has to be reset for logout
Thomas Junk <thomas.junk@intevation.de>
parents:
622
diff
changeset
|
7 }; |
620a65f11b33
fix: splitscreenoption has to be reset for logout
Thomas Junk <thomas.junk@intevation.de>
parents:
622
diff
changeset
|
8 }; |
620a65f11b33
fix: splitscreenoption has to be reset for logout
Thomas Junk <thomas.junk@intevation.de>
parents:
622
diff
changeset
|
9 |
649
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
10 const DRAWMODES = { |
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
11 LINE: "LineString" |
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
12 }; |
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
13 |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
14 const Application = { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
15 namespaced: true, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
16 state: { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
17 appTitle: process.env.VUE_APP_TITLE, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
18 secondaryLogo: process.env.VUE_APP_SECONDARY_LOGO_URL, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
19 sidebar: { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
20 iscollapsed: defaultCollapseState |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
21 }, |
647
620a65f11b33
fix: splitscreenoption has to be reset for logout
Thomas Junk <thomas.junk@intevation.de>
parents:
622
diff
changeset
|
22 splitsceen: initializeSplitScreen(), |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
23 usermenu: { |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
24 iscollapsed: defaultCollapseState |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
25 }, |
649
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
26 countries: ["AT", "SK", "HU", "HR", "RS", "BiH", "BG", "RO", "UA"], |
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
27 drawMode: null |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
28 }, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
29 getters: { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
30 countries: state => { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
31 return state.countries; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
32 }, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
33 sidebarCollapsed: state => { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
34 return state.sidebar.iscollapsed; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
35 }, |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
36 isUsermenuCollapsed: state => { |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
37 return state.usermenu.iscollapsed; |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
38 }, |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
39 appTitle: state => { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
40 return state.appTitle; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
41 }, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
42 secondaryLogo: state => { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
43 return state.secondaryLogo; |
593
c4a4dc612191
feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
44 }, |
c4a4dc612191
feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
45 isSplitscreen: state => { |
c4a4dc612191
feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
46 return state.splitsceen.active; |
c4a4dc612191
feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
47 }, |
c4a4dc612191
feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
48 splitMode: state => { |
c4a4dc612191
feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
49 return state.splitsceen.mode; |
649
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
50 }, |
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
51 drawMode: state => { |
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
52 return state.drawMode; |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
53 } |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
54 }, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
55 mutations: { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
56 toggleSidebar: state => { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
57 state.sidebar.iscollapsed = !state.sidebar.iscollapsed; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
58 }, |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
59 toggleUserMenu: state => { |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
60 state.usermenu.iscollapsed = !state.usermenu.iscollapsed; |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
61 }, |
593
c4a4dc612191
feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
62 toggleSplitScreen: state => { |
c4a4dc612191
feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
63 state.splitsceen.active = !state.splitsceen.active; |
c4a4dc612191
feat: Toggleable fairway profile
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
64 }, |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
65 resetSidebar: state => { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
66 state.sidebar.iscollapsed = defaultCollapseState; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
67 }, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
68 collapseSidebar: state => { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
69 state.sidebar.iscollapsed = true; |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
70 }, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
71 resetUserMenu: state => { |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
72 state.usermenu.iscollapsed = defaultCollapseState; |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
73 }, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
74 collapseUserMenu: state => { |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
593
diff
changeset
|
75 state.usermenu.iscollapsed = true; |
647
620a65f11b33
fix: splitscreenoption has to be reset for logout
Thomas Junk <thomas.junk@intevation.de>
parents:
622
diff
changeset
|
76 }, |
620a65f11b33
fix: splitscreenoption has to be reset for logout
Thomas Junk <thomas.junk@intevation.de>
parents:
622
diff
changeset
|
77 resetSplitScreen: state => { |
620a65f11b33
fix: splitscreenoption has to be reset for logout
Thomas Junk <thomas.junk@intevation.de>
parents:
622
diff
changeset
|
78 state.splitsceen = initializeSplitScreen(); |
649
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
79 }, |
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
80 toggleDrawModeLine: state => { |
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
81 if (state.drawMode && state.drawMode === DRAWMODES.LINE) { |
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
82 state.drawMode = null; |
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
83 return; |
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
84 } |
83081ba6c9c1
feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
85 state.drawMode = DRAWMODES.LINE; |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
86 } |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
87 }, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
88 actions: {} |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
89 }; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
90 |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
91 export default Application; |