annotate client/src/application/Userbar.vue @ 1144:5f98d0c9d738

linted code
author Markus Kottlaender <markus@intevation.de>
date Mon, 12 Nov 2018 15:12:04 +0100
parents 2fda33d55d81
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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>
1123
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1122
diff changeset
3 <img @click="$store.commit('application/showUsermenu', !showUsermenu)" 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">
1123
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1122
diff changeset
5 <span v-if="showUsermenu" class="username align-self-center">{{ user }}</span>
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1122
diff changeset
6 <span v-if="showUsermenu" class="logout align-self-center" @click="logoff">
629
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
1139
2fda33d55d81 scoped css
Markus Kottlaender <markus@intevation.de>
parents: 1123
diff changeset
13 <style lang="scss" scoped>
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 */
1144
5f98d0c9d738 linted code
Markus Kottlaender <markus@intevation.de>
parents: 1139
diff changeset
62 import { 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: {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
69 logoff() {
1122
a4c74a95c177 minor store refactoring
Markus Kottlaender <markus@intevation.de>
parents: 1019
diff changeset
70 this.$store.commit("user/clearAuth");
1123
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1122
diff changeset
71 this.$store.commit("application/showSidebar", false);
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1122
diff changeset
72 this.$store.commit("application/showUsermenu", false);
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1122
diff changeset
73 this.$store.commit("application/showSplitscreen", false);
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
74 this.$router.push("/login");
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
75 }
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
76 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
77 computed: {
1122
a4c74a95c177 minor store refactoring
Markus Kottlaender <markus@intevation.de>
parents: 1019
diff changeset
78 ...mapState("user", ["user"]),
1123
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1122
diff changeset
79 ...mapState("application", ["showUsermenu"]),
622
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 621
diff changeset
80 userManagementStyle() {
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 621
diff changeset
81 return {
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 621
diff changeset
82 "ui-element": true,
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 621
diff changeset
83 "d-flex": true,
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 621
diff changeset
84 "flex-row": true,
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 621
diff changeset
85 "justify-content-around": true,
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 621
diff changeset
86 usermanagement: true,
1123
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1122
diff changeset
87 usermanagementcollapsed: !this.showUsermenu,
d9e6a1f6f394 moved all collapse flags for UI elements to store
Markus Kottlaender <markus@intevation.de>
parents: 1122
diff changeset
88 usermanagementexpanded: this.showUsermenu,
622
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 621
diff changeset
89 shadow: true
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 621
diff changeset
90 };
47f11401d999 feat: Usermenu is now collapsible
Thomas Junk <thomas.junk@intevation.de>
parents: 621
diff changeset
91 }
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
92 }
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
93 };
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
94 </script>