Mercurial > gemma
annotate client/src/components/Sidebar.vue @ 2956:974122125a76
Let it be an error if closest points of DISMARs on axis are equal
This might be the case e.g. if both distance marks are very far
away from the available axis geometries. Instead of returning a
point in such a case, which would likely be an unexpected result,
raise an exception by means of STRICT.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Mon, 08 Apr 2019 14:53:09 +0200 |
parents | 6c5364ff0abb |
children | 6f351e00e579 |
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 | 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 | 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="/importapprovedgaugemeasurement"> |
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" /> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
54 <span class="fix-trans-space" v-translate |
2534
bb5286acfee2
client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents:
2457
diff
changeset
|
55 >Approved Gaugemeasurements</span |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
56 > |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
57 </router-link> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
58 <router-link to="/importwaterwayprofiles"> |
2919
6c5364ff0abb
client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents:
2774
diff
changeset
|
59 <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
|
60 <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
|
61 </router-link> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
62 <router-link to="/importschedule"> |
2919
6c5364ff0abb
client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents:
2774
diff
changeset
|
63 <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
|
64 <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
|
65 </router-link> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
66 <small class="text-muted pl-3"> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
67 <translate>Systemadministration</translate> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
68 </small> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
69 <hr class="m-0" /> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
70 </div> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
71 <div v-if="isSysAdmin"> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
72 <router-link to="/usermanagement"> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
73 <font-awesome-icon |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
74 class="fa-fw mr-2" |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
75 fixed-width |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
76 icon="users-cog" |
2919
6c5364ff0abb
client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents:
2774
diff
changeset
|
77 /> |
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>Users</span> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
79 </router-link> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
80 </div> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
81 <div v-if="isWaterwayAdmin"> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
82 <router-link to="/systemconfiguration"> |
2919
6c5364ff0abb
client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents:
2774
diff
changeset
|
83 <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
|
84 <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
|
85 </router-link> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
86 </div> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
87 <div v-if="isSysAdmin"> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
88 <router-link to="/logs"> |
2919
6c5364ff0abb
client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents:
2774
diff
changeset
|
89 <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
|
90 <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
|
91 </router-link> |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
92 </div> |
1463
a6dd2a8183a4
sidebar: added spacer class to import schedule
Thomas Junk <thomas.junk@intevation.de>
parents:
1455
diff
changeset
|
93 <hr class="m-0" /> |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
94 <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
|
95 <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
|
96 <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
|
97 </a> |
1777
e70b7b8e7b74
wrong rights rigthed, so they are right now right
Thomas Junk <thomas.junk@intevation.de>
parents:
1757
diff
changeset
|
98 </div> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
99 </div> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
100 </div> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
101 </template> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
102 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
103 <script> |
1362
ca33ad696594
remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1361
diff
changeset
|
104 /* 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
|
105 * 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
|
106 * |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
107 * SPDX-License-Identifier: AGPL-3.0-or-later |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
108 * 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
|
109 * |
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
110 * Copyright (C) 2018 by via donau |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
111 * – Österreichische Wasserstraßen-Gesellschaft mbH |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
112 * 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
|
113 * |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
114 * Author(s): |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
115 * Thomas Junk <thomas.junk@intevation.de> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
116 * Markus Kottländer <markus.kottlaender@intevation.de> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
117 */ |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
118 import { mapGetters, mapState } from "vuex"; |
1701
f4bd67daaaff
feat: force login on invalid session
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
119 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
|
120 import { displayError } from "@/lib/errors"; |
2651
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2637
diff
changeset
|
121 import { HTTP } from "@/lib/http"; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
122 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
123 export default { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
124 name: "sidebar", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
125 props: ["routeName"], |
2651
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2637
diff
changeset
|
126 data() { |
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2637
diff
changeset
|
127 return { |
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2637
diff
changeset
|
128 stagingNotifications: null |
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2637
diff
changeset
|
129 }; |
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2637
diff
changeset
|
130 }, |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
131 computed: { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
132 ...mapGetters("user", ["isSysAdmin", "isWaterwayAdmin"]), |
2774
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
133 ...mapState("user", ["user", "roles", "isAuthenticated"]), |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
134 ...mapState("application", [ |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
135 "showSidebar", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
136 "showSearchbarLastState", |
1289
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
137 "contextBoxContent", |
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
138 "showContextBox" |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
139 ]), |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
140 sidebarStyle() { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
141 return [ |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
142 "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
|
143 { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
144 sidebarcollapsed: !this.showSidebar, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
145 sidebarextended: this.showSidebar |
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 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
149 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
150 methods: { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
151 logoff() { |
1701
f4bd67daaaff
feat: force login on invalid session
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
152 logOff(); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
153 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
154 toggleContextBox(context) { |
1650
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1613
diff
changeset
|
155 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
|
156 this.$store.commit("application/searchQuery", ""); |
1282
a7dd8a3356fc
fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
157 this.$store.commit("application/showContextBox", true); |
a7dd8a3356fc
fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
158 this.$store.commit("application/contextBoxContent", context); |
a7dd8a3356fc
fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
159 this.$store.commit("application/showSearchbar", true); |
1289
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
160 }, |
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
161 isActive(item) { |
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
162 return ( |
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
163 this.showContextBox && |
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
164 this.contextBoxContent === item && |
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
165 this.routeName == "mainview" |
e1480ad4b6b0
improved menu style
Markus Kottlaender <markus@intevation.de>
parents:
1282
diff
changeset
|
166 ); |
2774
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
167 } |
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
168 }, |
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
169 mounted() { |
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
170 const updateIndicators = () => { |
2676
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
171 if (this.isWaterwayAdmin) { |
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
172 this.$store; |
2680
bd615f978164
sidebar: adding count as query parameter
Thomas Junk <thomas.junk@intevation.de>
parents:
2676
diff
changeset
|
173 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
|
174 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
|
175 }) |
2676
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
176 .then(response => { |
2698
472f4c6a1ec0
Sidebar: set count of pending imports correctly
Thomas Junk <thomas.junk@intevation.de>
parents:
2680
diff
changeset
|
177 this.stagingNotifications = response.data; |
2774
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
178 if (this.isAuthenticated) { |
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
179 setTimeout(updateIndicators, 15000); |
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
180 } |
2676
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
181 }) |
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
182 .catch(error => { |
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
183 const { status, data } = error.response; |
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
184 displayError({ |
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
185 title: "Backend Error", |
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
186 message: `${status}: ${data.message || data}` |
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
187 }); |
2651
9f3856337f55
import_overview: new unified interface as default
Thomas Junk <thomas.junk@intevation.de>
parents:
2637
diff
changeset
|
188 }); |
2676
906e9a13592f
sidebar: only update staging info for appropriate usergroups
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
189 } |
2774
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
190 }; |
6c1c4f55d99b
sidebar: only update when user is logged in
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
191 setTimeout(updateIndicators, 15000); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
192 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
193 }; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
194 </script> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
195 |
1449 | 196 <style lang="scss" scoped> |
197 .menubutton { | |
198 height: 2rem; | |
199 width: 2rem; | |
200 top: 0; | |
201 left: 0; | |
202 color: #666; | |
203 } | |
204 | |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
205 .indicator { |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
206 font-size: 11px; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
207 line-height: 11px; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
208 padding: 2px 4px 1px; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
209 position: absolute; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
210 top: 18px; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
211 left: 0px; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
212 z-index: 10; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
213 color: #fff; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
214 background: #17a2b8; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
215 border-top-right-radius: 0.25rem; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
216 border-bottom-left-radius: 0.25rem; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
217 } |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
218 |
1449 | 219 .menu a { |
220 display: block; | |
221 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
|
222 padding: 0.25rem 0.5rem; |
1449 | 223 color: #333; |
224 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
|
225 font-size: 90%; |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
226 .indicator { |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
227 left: auto; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
228 right: 10px; |
2630
30df2d12d37f
client: sidebar: fix indicator positioning
Markus Kottlaender <markus@intevation.de>
parents:
2591
diff
changeset
|
229 top: 8px; |
2382
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
230 border-radius: 0.25rem; |
c28971cd70ce
client: indicator for imports waiting for review
Markus Kottlaender <markus@intevation.de>
parents:
2354
diff
changeset
|
231 } |
2406
b72d3da6409c
client: fixed indicator style in sidebar menu when menu item is active
Markus Kottlaender <markus@intevation.de>
parents:
2404
diff
changeset
|
232 &.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
|
233 background: #fff; |
b72d3da6409c
client: fixed indicator style in sidebar menu when menu item is active
Markus Kottlaender <markus@intevation.de>
parents:
2404
diff
changeset
|
234 color: #333; |
b72d3da6409c
client: fixed indicator style in sidebar menu when menu item is active
Markus Kottlaender <markus@intevation.de>
parents:
2404
diff
changeset
|
235 } |
1449 | 236 } |
237 | |
238 .menu a svg path { | |
239 fill: #666; | |
240 } | |
241 | |
242 .menu a:hover { | |
243 background-color: #f8f8f8; | |
244 } | |
245 | |
246 .menu a.router-link-exact-active { | |
247 background-color: #17a2b8; | |
248 color: #fff; | |
249 } | |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
250 |
1449 | 251 .menu a.router-link-exact-active svg path { |
252 fill: #fff; | |
253 } | |
254 | |
255 .menu a.secondary.active { | |
256 background: #ebfafd; | |
257 color: #0f6674; | |
258 } | |
259 | |
260 .menu a.secondary.active svg path { | |
261 fill: #0f6674; | |
262 } | |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
263 |
1449 | 264 .sidebar { |
265 background-color: #ffffff; | |
266 padding-top: $large-offset; | |
267 opacity: $slight-transparent; | |
268 transition: $transition-fast; | |
269 overflow: hidden; | |
270 } | |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
271 |
1449 | 272 .sidebarcollapsed { |
273 max-height: $icon-height; | |
274 max-width: $icon-width; | |
275 } | |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
276 |
1449 | 277 .sidebarextended { |
278 max-width: $sidebar-width; | |
1455
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
279 min-width: $sidebar-width; |
1449 | 280 } |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
281 </style> |