annotate client/src/components/Sidebar.vue @ 2974:e161e1ffb6b5 unified_import

unified_imports: AGM moved to new interface
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 08 Apr 2019 16:44:15 +0200
parents 6f351e00e579
children 2a29bf8776d0
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="/">
1463
a6dd2a8183a4 sidebar: added spacer class to import schedule
Thomas Junk <thomas.junk@intevation.de>
parents: 1455
diff changeset
15 <font-awesome-icon
1542
31c6c7bd6190 layout issues
Thomas Junk <thomas.junk@intevation.de>
parents: 1517
diff changeset
16 class="fa-fw mr-2"
1505
a6c2d4252bae refresh clears notifications
Thomas Junk <thomas.junk@intevation.de>
parents: 1463
diff changeset
17 fixed-width
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
18 icon="map-marked-alt"
2919
6c5364ff0abb client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents: 2774
diff changeset
19 />
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>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
21 </router-link>
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
22 <router-link to="/bottlenecks">
2919
6c5364ff0abb client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents: 2774
diff changeset
23 <font-awesome-icon class="fa-fw mr-2" fixed-width icon="ship" />
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
24 <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
25 </router-link>
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
26 <div v-if="isWaterwayAdmin">
2416
Thomas Junk <thomas.junk@intevation.de>
parents: 2413
diff changeset
27 <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
28 <font-awesome-icon
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
29 class="fa-fw mr-2"
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
30 fixed-width
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
31 icon="clipboard-check"
2919
6c5364ff0abb client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents: 2774
diff changeset
32 />
2717
5b990f612420 import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents: 2709
diff changeset
33 <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
34 <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
35 {{ stagingNotifications }}
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
36 </span>
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
37 </router-link>
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">
2919
6c5364ff0abb client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents: 2774
diff changeset
41 <font-awesome-icon class="fa-fw 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">
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
46 <small class="text-muted pl-3"> <translate>Import</translate> </small>
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
47 <hr class="m-0" />
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
48 <router-link to="/importsoundingresults">
2919
6c5364ff0abb client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents: 2774
diff changeset
49 <font-awesome-icon class="fa-fw mr-2" fixed-width icon="upload" />
2534
bb5286acfee2 client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents: 2457
diff changeset
50 <span class="fix-trans-space" v-translate>Soundingresults</span>
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
51 </router-link>
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
52 <router-link to="/importwaterwayprofiles">
2919
6c5364ff0abb client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents: 2774
diff changeset
53 <font-awesome-icon class="fa-fw mr-2" fixed-width icon="upload" />
2534
bb5286acfee2 client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents: 2457
diff changeset
54 <span class="fix-trans-space" v-translate>Waterway Profiles</span>
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
55 </router-link>
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
56 <router-link to="/importschedule">
2919
6c5364ff0abb client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents: 2774
diff changeset
57 <font-awesome-icon class="fa-fw mr-2" fixed-width icon="clock" />
2591
eb69c6d27ae5 client: renamed menu item
Markus Kottlaender <markus@intevation.de>
parents: 2534
diff changeset
58 <translate class="fix-trans-space">Imports</translate>
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
59 </router-link>
2972
6f351e00e579 unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
60 <router-link to="/imports/configuration">
6f351e00e579 unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
61 <font-awesome-icon class="fa-fw mr-2" fixed-width icon="clock" />
6f351e00e579 unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
62 <translate class="fix-trans-space">Imports (New)</translate>
6f351e00e579 unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
63 </router-link>
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
64 <small class="text-muted pl-3">
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
65 <translate>Systemadministration</translate>
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
66 </small>
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
67 <hr class="m-0" />
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="/usermanagement">
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
71 <font-awesome-icon
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
72 class="fa-fw mr-2"
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
73 fixed-width
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
74 icon="users-cog"
2919
6c5364ff0abb client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents: 2774
diff changeset
75 />
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
76 <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
77 </router-link>
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
78 </div>
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
79 <div v-if="isWaterwayAdmin">
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
80 <router-link to="/systemconfiguration">
2919
6c5364ff0abb client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents: 2774
diff changeset
81 <font-awesome-icon class="fa-fw mr-2" fixed-width icon="wrench" />
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
82 <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
83 </router-link>
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
84 </div>
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
85 <div v-if="isSysAdmin">
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
86 <router-link to="/logs">
2919
6c5364ff0abb client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents: 2774
diff changeset
87 <font-awesome-icon class="fa-fw mr-2" fixed-width icon="book" />
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
88 <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
89 </router-link>
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
90 </div>
1463
a6dd2a8183a4 sidebar: added spacer class to import schedule
Thomas Junk <thomas.junk@intevation.de>
parents: 1455
diff changeset
91 <hr class="m-0" />
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
92 <a @click="logoff" href="#" class="logout">
2919
6c5364ff0abb client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents: 2774
diff changeset
93 <font-awesome-icon class="fa-fw 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
94 <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
95 </a>
1777
e70b7b8e7b74 wrong rights rigthed, so they are right now right
Thomas Junk <thomas.junk@intevation.de>
parents: 1757
diff changeset
96 </div>
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
97 </div>
1361
ea3a89a1813a remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
98 </div>
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
99 </template>
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
100
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
101 <script>
1362
ca33ad696594 remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1361
diff changeset
102 /* 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
103 * 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
104 *
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
105 * SPDX-License-Identifier: AGPL-3.0-or-later
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
106 * 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
107 *
ea3a89a1813a remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
108 * Copyright (C) 2018 by via donau
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
109 * – Österreichische Wasserstraßen-Gesellschaft mbH
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
110 * 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
111 *
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
112 * Author(s):
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
113 * Thomas Junk <thomas.junk@intevation.de>
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
114 * Markus Kottländer <markus.kottlaender@intevation.de>
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
115 */
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
116 import { mapGetters, mapState } from "vuex";
1701
f4bd67daaaff feat: force login on invalid session
Thomas Junk <thomas.junk@intevation.de>
parents: 1650
diff changeset
117 import { logOff } from "@/lib/session.js";
2383
8d025f85a3fe client: made indicator for open imports show up immediatly
Markus Kottlaender <markus@intevation.de>
parents: 2382
diff changeset
118 import { displayError } from "@/lib/errors";
2651
9f3856337f55 import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents: 2637
diff changeset
119 import { HTTP } from "@/lib/http";
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 export default {
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
122 name: "sidebar",
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
123 props: ["routeName"],
2651
9f3856337f55 import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents: 2637
diff changeset
124 data() {
9f3856337f55 import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents: 2637
diff changeset
125 return {
9f3856337f55 import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents: 2637
diff changeset
126 stagingNotifications: null
9f3856337f55 import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents: 2637
diff changeset
127 };
9f3856337f55 import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents: 2637
diff changeset
128 },
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
129 computed: {
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
130 ...mapGetters("user", ["isSysAdmin", "isWaterwayAdmin"]),
2774
6c1c4f55d99b sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents: 2717
diff changeset
131 ...mapState("user", ["user", "roles", "isAuthenticated"]),
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
132 ...mapState("application", [
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
133 "showSidebar",
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
134 "showSearchbarLastState",
1289
e1480ad4b6b0 improved menu style
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
135 "contextBoxContent",
e1480ad4b6b0 improved menu style
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
136 "showContextBox"
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
137 ]),
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
138 sidebarStyle() {
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
139 return [
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
140 "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
141 {
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
142 sidebarcollapsed: !this.showSidebar,
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
143 sidebarextended: this.showSidebar
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
144 }
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
145 ];
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
146 }
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
147 },
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
148 methods: {
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
149 logoff() {
1701
f4bd67daaaff feat: force login on invalid session
Thomas Junk <thomas.junk@intevation.de>
parents: 1650
diff changeset
150 logOff();
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
151 },
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
152 toggleContextBox(context) {
1650
90211725e4a9 highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents: 1613
diff changeset
153 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
154 this.$store.commit("application/searchQuery", "");
1282
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
155 this.$store.commit("application/showContextBox", true);
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
156 this.$store.commit("application/contextBoxContent", context);
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
157 this.$store.commit("application/showSearchbar", true);
1289
e1480ad4b6b0 improved menu style
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
158 },
e1480ad4b6b0 improved menu style
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
159 isActive(item) {
e1480ad4b6b0 improved menu style
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
160 return (
e1480ad4b6b0 improved menu style
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
161 this.showContextBox &&
e1480ad4b6b0 improved menu style
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
162 this.contextBoxContent === item &&
e1480ad4b6b0 improved menu style
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
163 this.routeName == "mainview"
e1480ad4b6b0 improved menu style
Markus Kottlaender <markus@intevation.de>
parents: 1282
diff changeset
164 );
2774
6c1c4f55d99b sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents: 2717
diff changeset
165 }
6c1c4f55d99b sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents: 2717
diff changeset
166 },
6c1c4f55d99b sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents: 2717
diff changeset
167 mounted() {
6c1c4f55d99b sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents: 2717
diff changeset
168 const updateIndicators = () => {
2676
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
169 if (this.isWaterwayAdmin) {
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
170 this.$store;
2680
bd615f978164 sidebar: adding count as query parameter
Thomas Junk <thomas.junk@intevation.de>
parents: 2676
diff changeset
171 HTTP.get("/imports?states=pending&count=true", {
2676
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
172 headers: { "X-Gemma-Auth": localStorage.getItem("token") }
2651
9f3856337f55 import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents: 2637
diff changeset
173 })
2676
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
174 .then(response => {
2698
472f4c6a1ec0 Sidebar: set count of pending imports correctly
Thomas Junk <thomas.junk@intevation.de>
parents: 2680
diff changeset
175 this.stagingNotifications = response.data;
2774
6c1c4f55d99b sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents: 2717
diff changeset
176 if (this.isAuthenticated) {
6c1c4f55d99b sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents: 2717
diff changeset
177 setTimeout(updateIndicators, 15000);
6c1c4f55d99b sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents: 2717
diff changeset
178 }
2676
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
179 })
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
180 .catch(error => {
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
181 const { status, data } = error.response;
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
182 displayError({
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
183 title: "Backend Error",
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
184 message: `${status}: ${data.message || data}`
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
185 });
2651
9f3856337f55 import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents: 2637
diff changeset
186 });
2676
906e9a13592f sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
187 }
2774
6c1c4f55d99b sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents: 2717
diff changeset
188 };
6c1c4f55d99b sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents: 2717
diff changeset
189 setTimeout(updateIndicators, 15000);
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
190 }
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
191 };
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
192 </script>
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
193
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
194 <style lang="scss" scoped>
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
195 .menubutton {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
196 height: 2rem;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
197 width: 2rem;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
198 top: 0;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
199 left: 0;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
200 color: #666;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
201 }
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
202
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
203 .indicator {
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
204 font-size: 11px;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
205 line-height: 11px;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
206 padding: 2px 4px 1px;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
207 position: absolute;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
208 top: 18px;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
209 left: 0px;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
210 z-index: 10;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
211 color: #fff;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
212 background: #17a2b8;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
213 border-top-right-radius: 0.25rem;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
214 border-bottom-left-radius: 0.25rem;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
215 }
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
216
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
217 .menu a {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
218 display: block;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
219 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
220 padding: 0.25rem 0.5rem;
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
221 color: #333;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
222 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
223 font-size: 90%;
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
224 .indicator {
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
225 left: auto;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
226 right: 10px;
2630
30df2d12d37f client: sidebar: fix indicator positioning
Markus Kottlaender <markus@intevation.de>
parents: 2591
diff changeset
227 top: 8px;
2382
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
228 border-radius: 0.25rem;
c28971cd70ce client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents: 2354
diff changeset
229 }
2406
b72d3da6409c client: fixed indicator style in sidebar menu when menu item is active
Markus Kottlaender <markus@intevation.de>
parents: 2404
diff changeset
230 &.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
231 background: #fff;
b72d3da6409c client: fixed indicator style in sidebar menu when menu item is active
Markus Kottlaender <markus@intevation.de>
parents: 2404
diff changeset
232 color: #333;
b72d3da6409c client: fixed indicator style in sidebar menu when menu item is active
Markus Kottlaender <markus@intevation.de>
parents: 2404
diff changeset
233 }
1449
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 svg path {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
237 fill: #666;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
238 }
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 .menu a:hover {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
241 background-color: #f8f8f8;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
242 }
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
243
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
244 .menu a.router-link-exact-active {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
245 background-color: #17a2b8;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
246 color: #fff;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
247 }
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
248
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
249 .menu a.router-link-exact-active svg path {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
250 fill: #fff;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
251 }
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
252
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
253 .menu a.secondary.active {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
254 background: #ebfafd;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
255 color: #0f6674;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
256 }
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
257
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
258 .menu a.secondary.active svg path {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
259 fill: #0f6674;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
260 }
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
261
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
262 .sidebar {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
263 background-color: #ffffff;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
264 padding-top: $large-offset;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
265 opacity: $slight-transparent;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
266 transition: $transition-fast;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
267 overflow: hidden;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
268 }
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
269
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
270 .sidebarcollapsed {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
271 max-height: $icon-height;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
272 max-width: $icon-width;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
273 }
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
274
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
275 .sidebarextended {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
276 max-width: $sidebar-width;
1455
33dda08d67be unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents: 1449
diff changeset
277 min-width: $sidebar-width;
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1429
diff changeset
278 }
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
279 </style>