annotate client/src/components/Sidebar.vue @ 3678:8f58851927c0

client: make layer factory only return new layer config for individual maps instead of each time it is invoked. The purpose of the factory was to support multiple maps with individual layers. But returning a new config each time it is invoked leads to bugs that rely on the layer's state. Now this factory reuses the same objects it created before, per map.
author Markus Kottlaender <markus@intevation.de>
date Mon, 17 Jun 2019 17:31:35 +0200
parents 3eb19b38446e
children 008bc1ae8897
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
Thomas Junk <thomas.junk@intevation.de>
parents: 2413
diff changeset
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 => {
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
161 const { status, data } = error.response;
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
162 displayError({
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
163 title: "Backend Error",
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
164 message: `${status}: ${data.message || data}`
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
165 });
2651
9f3856337f55 import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents: 2637
diff changeset
166 });
2676
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
167 }
2774
6c1c4f55d99b sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents: 2717
diff changeset
168 };
3668
3eb19b38446e client: avoid requesting number of pending imports after logging out
Markus Kottlaender <markus@intevation.de>
parents: 3605
diff changeset
169 updateIndicators();
3eb19b38446e client: avoid requesting number of pending imports after logging out
Markus Kottlaender <markus@intevation.de>
parents: 3605
diff changeset
170 },
3eb19b38446e client: avoid requesting number of pending imports after logging out
Markus Kottlaender <markus@intevation.de>
parents: 3605
diff changeset
171 destroyed() {
3eb19b38446e client: avoid requesting number of pending imports after logging out
Markus Kottlaender <markus@intevation.de>
parents: 3605
diff changeset
172 clearTimeout(this.notificationTimer);
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
173 }
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
174 };
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
175 </script>
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
176
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
177 <style lang="scss" scoped>
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
178 .menubutton {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
179 height: 2rem;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
180 width: 2rem;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
181 top: 0;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
182 left: 0;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
183 color: #666;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
184 }
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
185
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
186 .indicator {
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
187 font-size: 11px;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
188 line-height: 11px;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
189 padding: 2px 4px 1px;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
190 position: absolute;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
191 top: 18px;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
192 left: 0px;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
193 z-index: 10;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
194 color: #fff;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
195 background: #17a2b8;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
196 border-top-right-radius: 0.25rem;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
197 border-bottom-left-radius: 0.25rem;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
198 }
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
199
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
200 .menu a {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
201 display: block;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
202 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
203 padding: 0.25rem 0.5rem;
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
204 color: #333;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
205 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
206 font-size: 90%;
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
207 .indicator {
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
208 left: auto;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
209 right: 10px;
2630
30df2d12d37f client: sidebar: fix indicator positioning
Markus Kottlaender <markus@intevation.de>
parents: 2591
diff changeset
210 top: 8px;
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
211 border-radius: 0.25rem;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
212 }
2406
b72d3da6409c client: fixed indicator style in sidebar menu when menu item is active
Markus Kottlaender <markus@intevation.de>
parents: 2404
diff changeset
213 &.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
214 background: #fff;
b72d3da6409c client: fixed indicator style in sidebar menu when menu item is active
Markus Kottlaender <markus@intevation.de>
parents: 2404
diff changeset
215 color: #333;
b72d3da6409c client: fixed indicator style in sidebar menu when menu item is active
Markus Kottlaender <markus@intevation.de>
parents: 2404
diff changeset
216 }
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
217 }
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
218
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
219 .menu a svg path {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
220 fill: #666;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
221 }
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
222
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
223 .menu a:hover {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
224 background-color: #f8f8f8;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
225 }
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
226
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
227 .menu a.router-link-exact-active {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
228 background-color: #17a2b8;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
229 color: #fff;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
230 }
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
231
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
232 .menu a.router-link-exact-active svg path {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
233 fill: #fff;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
234 }
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
235
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
236 .menu a.secondary.active {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
237 background: #ebfafd;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
238 color: #0f6674;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
239 }
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
240
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
241 .menu a.secondary.active svg path {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
242 fill: #0f6674;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
243 }
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
244
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
245 .sidebar {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
246 background-color: #ffffff;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
247 padding-top: $large-offset;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
248 opacity: $slight-transparent;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
249 transition: $transition-fast;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
250 overflow: hidden;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
251 }
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
252
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
253 .sidebarcollapsed {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
254 max-height: $icon-height;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
255 max-width: $icon-width;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
256 }
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
257
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
258 .sidebarextended {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
259 max-width: $sidebar-width;
1455
33dda08d67be unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
260 min-width: $sidebar-width;
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
261 }
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
262 </style>