Mercurial > gemma
annotate client/src/components/Sidebar.vue @ 5259:680be197844d
Merged branch new-fwa.
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Wed, 13 May 2020 11:28:34 +0200 |
parents | 6b054b91d9b2 |
children | 064ac1014713 |
rev | line source |
---|---|
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
2 <div class="position-relative"> |
2651
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2637
diff
changeset
|
3 <span class="indicator" v-if="!showSidebar && stagingNotifications"> |
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2637
diff
changeset
|
4 {{ stagingNotifications }} |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
5 </span> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
6 <div :class="sidebarStyle"> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
7 <div |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
8 @click="$store.commit('application/showSidebar', !showSidebar)" |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
9 class="menubutton ui-element d-print-none p-2 bg-white rounded position-absolute d-flex justify-content-center" |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
10 > |
2919
6c5364ff0abb
client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents:
2774
diff
changeset
|
11 <font-awesome-icon class="fa-fw" icon="bars" /> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
12 </div> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
13 <div class="menu text-nowrap text-left"> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
14 <router-link to="/"> |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
15 <font-awesome-icon class="mr-2" fixed-width icon="map-marked-alt" /> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
16 <span class="fix-trans-space" v-translate>Map</span> |
2329
514193fd0120
refac: improve routing structure. We now have /bottlenecks, /stretches, /review routes
Thomas Junk <thomas.junk@intevation.de>
parents:
2282
diff
changeset
|
17 </router-link> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
18 <router-link to="/bottlenecks"> |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
19 <font-awesome-icon class="mr-2" fixed-width icon="ship" /> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
20 <span class="fix-trans-space" v-translate>Bottlenecks</span> |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
21 </router-link> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
22 <div v-if="isWaterwayAdmin"> |
2416 | 23 <router-link to="/imports/overview" class="position-relative"> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
24 <font-awesome-icon |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
25 class="mr-2" |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
26 fixed-width |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
27 icon="clipboard-check" |
2919
6c5364ff0abb
client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents:
2774
diff
changeset
|
28 /> |
2717
5b990f612420
import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2709
diff
changeset
|
29 <span class="fix-trans-space" v-translate>Import review</span> |
2651
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2637
diff
changeset
|
30 <span class="indicator" v-if="showSidebar && stagingNotifications"> |
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2637
diff
changeset
|
31 {{ stagingNotifications }} |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
32 </span> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
33 </router-link> |
3345
954f8b751fb0
client: sidebar: moved menu item
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
34 <router-link to="/imports/configuration"> |
954f8b751fb0
client: sidebar: moved menu item
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
35 <font-awesome-icon class="mr-2" fixed-width icon="clock" /> |
954f8b751fb0
client: sidebar: moved menu item
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
36 <translate class="fix-trans-space">Imports</translate> |
954f8b751fb0
client: sidebar: moved menu item
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
37 </router-link> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
38 </div> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
39 <div v-if="isSysAdmin"> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
40 <router-link to="/stretches"> |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
41 <font-awesome-icon class="mr-2" fixed-width icon="road" /> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
42 <span class="fix-trans-space" v-translate>Define stretches</span> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
43 </router-link> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
44 </div> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
45 <div v-if="isWaterwayAdmin"> |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
46 <router-link to="/sections"> |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
47 <font-awesome-icon class="mr-2" fixed-width icon="road" /> |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
48 <span class="fix-trans-space" v-translate>Define sections</span> |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
49 </router-link> |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
50 </div> |
3345
954f8b751fb0
client: sidebar: moved menu item
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
51 <small |
954f8b751fb0
client: sidebar: moved menu item
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
52 class="text-muted pl-2 pb-1 d-block border-bottom" |
954f8b751fb0
client: sidebar: moved menu item
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
53 v-if="isSysAdmin" |
954f8b751fb0
client: sidebar: moved menu item
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
54 > |
954f8b751fb0
client: sidebar: moved menu item
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
55 <translate>Systemadministration</translate> |
954f8b751fb0
client: sidebar: moved menu item
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
56 </small> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
57 <div v-if="isSysAdmin"> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
58 <router-link to="/usermanagement"> |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
59 <font-awesome-icon class="mr-2" fixed-width icon="users-cog" /> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
60 <span class="fix-trans-space" v-translate>Users</span> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
61 </router-link> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
62 </div> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
63 <div v-if="isWaterwayAdmin"> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
64 <router-link to="/systemconfiguration"> |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
65 <font-awesome-icon class="mr-2" fixed-width icon="wrench" /> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
66 <span class="fix-trans-space" v-translate>Configuration</span> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
67 </router-link> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
68 </div> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
69 <div v-if="isSysAdmin"> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
70 <router-link to="/logs"> |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
71 <font-awesome-icon class="mr-2" fixed-width icon="book" /> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
72 <span class="fix-trans-space" v-translate>Logs</span> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
73 </router-link> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
74 </div> |
1463
a6dd2a8183a4
sidebar: added spacer class to import schedule
Thomas Junk <thomas.junk@intevation.de>
parents:
1455
diff
changeset
|
75 <hr class="m-0" /> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
76 <a @click="logoff" href="#" class="logout"> |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
77 <font-awesome-icon class="mr-2" fixed-width icon="power-off" /> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
78 <span class="fix-trans-space" v-translate>Logout</span> {{ user }} |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
79 </a> |
1777
e70b7b8e7b74
wrong rights rigthed, so they are right now right
Thomas Junk <thomas.junk@intevation.de>
parents:
1757
diff
changeset
|
80 </div> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
81 </div> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
82 </div> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
83 </template> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
84 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
85 <script> |
1362
ca33ad696594
remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1361
diff
changeset
|
86 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
87 * without warranty, see README.md and license for details. |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
88 * |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
89 * SPDX-License-Identifier: AGPL-3.0-or-later |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
90 * License-Filename: LICENSES/AGPL-3.0.txt |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
91 * |
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
92 * Copyright (C) 2018 by via donau |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
93 * – Österreichische Wasserstraßen-Gesellschaft mbH |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
94 * Software engineering by Intevation GmbH |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
95 * |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
96 * Author(s): |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
97 * Thomas Junk <thomas.junk@intevation.de> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
98 * Markus Kottländer <markus.kottlaender@intevation.de> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
99 */ |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
100 import { mapGetters, mapState } from "vuex"; |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2983
diff
changeset
|
101 import { logOff } from "@/lib/session"; |
2383
8d025f85a3fe
client: made indicator for open imports show up immediatly
Markus Kottlaender <markus@intevation.de>
parents:
2382
diff
changeset
|
102 import { displayError } from "@/lib/errors"; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
103 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
104 export default { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
105 name: "sidebar", |
3668
3eb19b38446e
client: avoid requesting number of pending imports after logging out
Markus Kottlaender <markus@intevation.de>
parents:
3605
diff
changeset
|
106 data() { |
3eb19b38446e
client: avoid requesting number of pending imports after logging out
Markus Kottlaender <markus@intevation.de>
parents:
3605
diff
changeset
|
107 return { |
3eb19b38446e
client: avoid requesting number of pending imports after logging out
Markus Kottlaender <markus@intevation.de>
parents:
3605
diff
changeset
|
108 notificationTimer: null |
3eb19b38446e
client: avoid requesting number of pending imports after logging out
Markus Kottlaender <markus@intevation.de>
parents:
3605
diff
changeset
|
109 }; |
3eb19b38446e
client: avoid requesting number of pending imports after logging out
Markus Kottlaender <markus@intevation.de>
parents:
3605
diff
changeset
|
110 }, |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
111 computed: { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
112 ...mapGetters("user", ["isSysAdmin", "isWaterwayAdmin"]), |
2774
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
113 ...mapState("user", ["user", "roles", "isAuthenticated"]), |
3605
d02d4e31491b
sidebar: move staging notifications to store and update notifications after finishing review
Thomas Junk <thomas.junk@intevation.de>
parents:
3345
diff
changeset
|
114 ...mapState("imports", ["stagingNotifications"]), |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
115 ...mapState("application", [ |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
116 "showSidebar", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
117 "showSearchbarLastState", |
1289
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
118 "contextBoxContent", |
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
119 "showContextBox" |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
120 ]), |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
121 sidebarStyle() { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
122 return [ |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
123 "ui-element position-relative sidebar rounded shadow-xs d-print-none mb-auto", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
124 { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
125 sidebarcollapsed: !this.showSidebar, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
126 sidebarextended: this.showSidebar |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
127 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
128 ]; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
129 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
130 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
131 methods: { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
132 logoff() { |
1701
f4bd67daaaff
feat: force login on invalid session
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
133 logOff(); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
134 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
135 toggleContextBox(context) { |
1650
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1613
diff
changeset
|
136 if (this.$route.path !== "/") this.$router.push("/"); |
2282
2e40909a975d
clean searchbar when context is changed
Thomas Junk <thomas.junk@intevation.de>
parents:
2277
diff
changeset
|
137 this.$store.commit("application/searchQuery", ""); |
1282
a7dd8a3356fc
fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
138 this.$store.commit("application/showContextBox", true); |
a7dd8a3356fc
fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
139 this.$store.commit("application/contextBoxContent", context); |
a7dd8a3356fc
fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
140 this.$store.commit("application/showSearchbar", true); |
1289
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
141 }, |
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
142 isActive(item) { |
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
143 return ( |
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
144 this.showContextBox && |
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
145 this.contextBoxContent === item && |
2983
2e7c0f9cff24
client: removed unnecessary component property
Markus Kottlaender <markus@intevation.de>
parents:
2979
diff
changeset
|
146 this.$route.name == "mainview" |
1289
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
147 ); |
2774
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
148 } |
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
149 }, |
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
150 mounted() { |
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
151 const updateIndicators = () => { |
2676
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
152 if (this.isWaterwayAdmin) { |
3605
d02d4e31491b
sidebar: move staging notifications to store and update notifications after finishing review
Thomas Junk <thomas.junk@intevation.de>
parents:
3345
diff
changeset
|
153 this.$store |
d02d4e31491b
sidebar: move staging notifications to store and update notifications after finishing review
Thomas Junk <thomas.junk@intevation.de>
parents:
3345
diff
changeset
|
154 .dispatch("imports/loadStagingNotifications") |
d02d4e31491b
sidebar: move staging notifications to store and update notifications after finishing review
Thomas Junk <thomas.junk@intevation.de>
parents:
3345
diff
changeset
|
155 .then(() => { |
2774
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
156 if (this.isAuthenticated) { |
3668
3eb19b38446e
client: avoid requesting number of pending imports after logging out
Markus Kottlaender <markus@intevation.de>
parents:
3605
diff
changeset
|
157 this.notificationTimer = setTimeout(updateIndicators, 15000); |
2774
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
158 } |
2676
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
159 }) |
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
160 .catch(error => { |
4869
6b054b91d9b2
backend not reachable as error message etd. Login adjusted
Thomas Junk <thomas.junk@intevation.de>
parents:
4868
diff
changeset
|
161 let message = "Backend not reachable"; |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
3668
diff
changeset
|
162 if (error.response) { |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
3668
diff
changeset
|
163 const { status, data } = error.response; |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
3668
diff
changeset
|
164 message = `${status}: ${data.message || data}`; |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
3668
diff
changeset
|
165 } |
2676
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
166 displayError({ |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
3668
diff
changeset
|
167 title: this.$gettext("Backend Error"), |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
3668
diff
changeset
|
168 message: message |
2676
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
169 }); |
2651
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2637
diff
changeset
|
170 }); |
2676
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
171 } |
2774
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
172 }; |
3668
3eb19b38446e
client: avoid requesting number of pending imports after logging out
Markus Kottlaender <markus@intevation.de>
parents:
3605
diff
changeset
|
173 updateIndicators(); |
3eb19b38446e
client: avoid requesting number of pending imports after logging out
Markus Kottlaender <markus@intevation.de>
parents:
3605
diff
changeset
|
174 }, |
3eb19b38446e
client: avoid requesting number of pending imports after logging out
Markus Kottlaender <markus@intevation.de>
parents:
3605
diff
changeset
|
175 destroyed() { |
3eb19b38446e
client: avoid requesting number of pending imports after logging out
Markus Kottlaender <markus@intevation.de>
parents:
3605
diff
changeset
|
176 clearTimeout(this.notificationTimer); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
177 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
178 }; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
179 </script> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
180 |
1449 | 181 <style lang="scss" scoped> |
182 .menubutton { | |
183 height: 2rem; | |
184 width: 2rem; | |
185 top: 0; | |
186 left: 0; | |
187 color: #666; | |
188 } | |
189 | |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
190 .indicator { |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
191 font-size: 11px; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
192 line-height: 11px; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
193 padding: 2px 4px 1px; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
194 position: absolute; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
195 top: 18px; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
196 left: 0px; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
197 z-index: 10; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
198 color: #fff; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
199 background: #17a2b8; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
200 border-top-right-radius: 0.25rem; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
201 border-bottom-left-radius: 0.25rem; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
202 } |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
203 |
1449 | 204 .menu a { |
205 display: block; | |
206 text-align: left; | |
2534
bb5286acfee2
client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents:
2457
diff
changeset
|
207 padding: 0.25rem 0.5rem; |
1449 | 208 color: #333; |
209 text-decoration: none; | |
2534
bb5286acfee2
client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents:
2457
diff
changeset
|
210 font-size: 90%; |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
211 .indicator { |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
212 left: auto; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
213 right: 10px; |
2630
30df2d12d37f
client: sidebar: fix indicator positioning
Markus Kottlaender <markus@intevation.de>
parents:
2591
diff
changeset
|
214 top: 8px; |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
215 border-radius: 0.25rem; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
216 } |
2406
b72d3da6409c
client: fixed indicator style in sidebar menu when menu item is active
Markus Kottlaender <markus@intevation.de>
parents:
2404
diff
changeset
|
217 &.router-link-exact-active .indicator { |
b72d3da6409c
client: fixed indicator style in sidebar menu when menu item is active
Markus Kottlaender <markus@intevation.de>
parents:
2404
diff
changeset
|
218 background: #fff; |
b72d3da6409c
client: fixed indicator style in sidebar menu when menu item is active
Markus Kottlaender <markus@intevation.de>
parents:
2404
diff
changeset
|
219 color: #333; |
b72d3da6409c
client: fixed indicator style in sidebar menu when menu item is active
Markus Kottlaender <markus@intevation.de>
parents:
2404
diff
changeset
|
220 } |
1449 | 221 } |
222 | |
223 .menu a svg path { | |
224 fill: #666; | |
225 } | |
226 | |
227 .menu a:hover { | |
228 background-color: #f8f8f8; | |
229 } | |
230 | |
231 .menu a.router-link-exact-active { | |
232 background-color: #17a2b8; | |
233 color: #fff; | |
234 } | |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
235 |
1449 | 236 .menu a.router-link-exact-active svg path { |
237 fill: #fff; | |
238 } | |
239 | |
240 .menu a.secondary.active { | |
241 background: #ebfafd; | |
242 color: #0f6674; | |
243 } | |
244 | |
245 .menu a.secondary.active svg path { | |
246 fill: #0f6674; | |
247 } | |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
248 |
1449 | 249 .sidebar { |
250 background-color: #ffffff; | |
251 padding-top: $large-offset; | |
252 opacity: $slight-transparent; | |
253 transition: $transition-fast; | |
254 overflow: hidden; | |
255 } | |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
256 |
1449 | 257 .sidebarcollapsed { |
258 max-height: $icon-height; | |
259 max-width: $icon-width; | |
260 } | |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
261 |
1449 | 262 .sidebarextended { |
263 max-width: $sidebar-width; | |
1455
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
264 min-width: $sidebar-width; |
1449 | 265 } |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
266 </style> |