Mercurial > gemma
annotate client/src/application/User.vue @ 623:7cada58cae2c
fix: e2e for new UI adapted
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 11 Sep 2018 14:19:13 +0200 |
parents | 47f11401d999 |
children | d4fa28bfa6ec |
rev | line source |
---|---|
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 <template> |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
2 <div :class="userManagementStyle"> |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
3 <img @click="extendUserMenu" class="userpic" src="../application/assets/user.png"> |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
4 <span v-if="!isUsermenuCollapsed" class="username align-self-center">{{ userinfo }}</span> |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
5 <span v-if="!isUsermenuCollapsed" class="logout align-self-center" @click="logoff"> |
621
b17a4482d07d
feat: UI adaptation of 4 slots
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
6 <i class="fa fa-power-off"></i> |
b17a4482d07d
feat: UI adaptation of 4 slots
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
7 </span> |
b17a4482d07d
feat: UI adaptation of 4 slots
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
8 </div> |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
9 </template> |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
10 |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
11 <style lang="scss"> |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
12 .usermanagement { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
13 background: white; |
621
b17a4482d07d
feat: UI adaptation of 4 slots
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
14 margin-left: 1rem; |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
15 padding: 0.25rem; |
621
b17a4482d07d
feat: UI adaptation of 4 slots
Thomas Junk <thomas.junk@intevation.de>
parents:
585
diff
changeset
|
16 border-radius: 5px; |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
17 } |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
18 |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
19 .usermanagementcollapsed { |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
20 width: 50px; |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
21 } |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
22 |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
23 .usermanagementexpanded { |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
24 width: 150px; |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
25 } |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
26 </style> |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
27 |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
28 <script> |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
29 import { mapGetters } from "vuex"; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
30 export default { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
31 name: "user", |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
32 data() { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
33 return {}; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
34 }, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
35 methods: { |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
36 extendUserMenu() { |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
37 this.$store.commit("application/toggleUserMenu"); |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
38 }, |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
39 logoff() { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
40 this.$store.commit("user/clear_auth"); |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
41 this.$store.commit("application/resetSidebar"); |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
42 this.$store.commit("application/resetUserMenu"); |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
43 this.$router.push("/login"); |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
44 } |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
45 }, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
46 computed: { |
622
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
47 ...mapGetters("user", ["userinfo"]), |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
48 ...mapGetters("application", ["isUsermenuCollapsed"]), |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
49 userManagementStyle() { |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
50 return { |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
51 "ui-element": true, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
52 "d-flex": true, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
53 "flex-row": true, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
54 "justify-content-around": true, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
55 usermanagement: true, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
56 usermanagementcollapsed: this.isUsermenuCollapsed, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
57 usermanagementexpanded: !this.isUsermenuCollapsed, |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
58 shadow: true |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
59 }; |
47f11401d999
feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
621
diff
changeset
|
60 } |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
61 } |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
62 }; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
63 </script> |