Mercurial > gemma
annotate client/src/application/Userbar.vue @ 1122:a4c74a95c177 store-refactoring
minor store refactoring
removed unused getters from user store and renamed functions to adhere to nameing scheme
removed unnecessary getter from map store
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Tue, 06 Nov 2018 11:21:29 +0100 |
parents | ca628dce90dd |
children | d9e6a1f6f394 |
rev | line source |
---|---|
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 <template> |
629
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
2 <div> |
630
855cca0142ec
refac: Usermanagement now flexible sidebar layout
Thomas Junk <thomas.junk@intevation.de>
parents:
629
diff
changeset
|
3 <img @click="extendUserMenu" class="ui-element userpic shadow" src="../application/assets/user.png"> |
629
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
4 <div :class="userManagementStyle"> |
1122
a4c74a95c177
minor store refactoring
Markus Kottlaender <markus@intevation.de>
parents:
1019
diff
changeset
|
5 <span v-if="!isUsermenuCollapsed" class="username align-self-center">{{ user }}</span> |
629
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
6 <span v-if="!isUsermenuCollapsed" class="logout align-self-center" @click="logoff"> |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
7 <i class="fa fa-power-off"></i> |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
8 </span> |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
9 </div> |
621
b17a4482d07d
feat: UI adaptation of 4 slots
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
10 </div> |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
11 </template> |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
12 |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
13 <style lang="scss"> |
629
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
14 .userpic { |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
15 background: white; |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
16 position: absolute; |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
17 bottom: $offset; |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
18 left: $offset; |
630
855cca0142ec
refac: Usermanagement now flexible sidebar layout
Thomas Junk <thomas.junk@intevation.de>
parents:
629
diff
changeset
|
19 height: $icon-width; |
855cca0142ec
refac: Usermanagement now flexible sidebar layout
Thomas Junk <thomas.junk@intevation.de>
parents:
629
diff
changeset
|
20 width: $icon-height; |
629
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
21 border-radius: $border-radius; |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
22 } |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
23 |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
24 .username { |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
25 margin-left: 40px; |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
26 } |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
27 |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
28 .usermanagement { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
29 background: white; |
629
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
30 margin-left: $offset; |
632
f2097d2aa048
fix: adjusted icon sizes
Thomas Junk <thomas.junk@intevation.de>
parents:
631
diff
changeset
|
31 padding: $offset; |
629
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
32 border-radius: $border-radius; |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
33 margin-bottom: $offset; |
632
f2097d2aa048
fix: adjusted icon sizes
Thomas Junk <thomas.junk@intevation.de>
parents:
631
diff
changeset
|
34 height: $icon-height; |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
35 } |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
36 |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
37 .usermanagementcollapsed { |
629
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
626
diff
changeset
|
38 transition: 0.3s; |
632
f2097d2aa048
fix: adjusted icon sizes
Thomas Junk <thomas.junk@intevation.de>
parents:
631
diff
changeset
|
39 width: $icon-width; |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
40 } |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
41 |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
42 .usermanagementexpanded { |
631
13bccabbf7c5
fix: usermenu or sidebar trigger arrangement of user/userdetailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
630
diff
changeset
|
43 width: $sidebar-width; |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
44 } |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
45 </style> |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
46 |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
47 <script> |
1019
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
48 /* |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
49 * This is Free Software under GNU Affero General Public License v >= 3.0 |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
50 * without warranty, see README.md and license for details. |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
51 * |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
52 * SPDX-License-Identifier: AGPL-3.0-or-later |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
53 * License-Filename: LICENSES/AGPL-3.0.txt |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
54 * |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
55 * Copyright (C) 2018 by via donau |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
56 * – Österreichische Wasserstraßen-Gesellschaft mbH |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
57 * Software engineering by Intevation GmbH |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
58 * |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
59 * Author(s): |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
60 * Thomas Junk <thomas.junk@intevation.de> |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
647
diff
changeset
|
61 */ |
1122
a4c74a95c177
minor store refactoring
Markus Kottlaender <markus@intevation.de>
parents:
1019
diff
changeset
|
62 import { mapGetters, mapState } from "vuex"; |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
63 export default { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
64 name: "user", |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
65 data() { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
66 return {}; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
67 }, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
68 methods: { |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
69 extendUserMenu() { |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
70 this.$store.commit("application/toggleUserMenu"); |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
71 }, |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
72 logoff() { |
1122
a4c74a95c177
minor store refactoring
Markus Kottlaender <markus@intevation.de>
parents:
1019
diff
changeset
|
73 this.$store.commit("user/clearAuth"); |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
74 this.$store.commit("application/resetSidebar"); |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
75 this.$store.commit("application/resetUserMenu"); |
647
620a65f11b33
fix: splitscreenoption has to be reset for logout
Thomas Junk <thomas.junk@intevation.de>
parents:
641
diff
changeset
|
76 this.$store.commit("application/resetSplitScreen"); |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
77 this.$router.push("/login"); |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
78 } |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
79 }, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
80 computed: { |
1122
a4c74a95c177
minor store refactoring
Markus Kottlaender <markus@intevation.de>
parents:
1019
diff
changeset
|
81 ...mapState("user", ["user"]), |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
82 ...mapGetters("application", ["isUsermenuCollapsed"]), |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
83 userManagementStyle() { |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
84 return { |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
85 "ui-element": true, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
86 "d-flex": true, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
87 "flex-row": true, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
88 "justify-content-around": true, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
89 usermanagement: true, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
90 usermanagementcollapsed: this.isUsermenuCollapsed, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
91 usermanagementexpanded: !this.isUsermenuCollapsed, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
92 shadow: true |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
93 }; |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
94 } |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
95 } |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
96 }; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
97 </script> |