Mercurial > gemma
annotate client/src/components/usermanagement/Usermanagement.vue @ 3915:f7f09f32d6e0
hydrological conditions: omit rendering, when container isn't visible
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 11 Jul 2019 13:51:26 +0200 |
parents | 1b8bb4f89227 |
children | 2e47b32a389d |
rev | line source |
---|---|
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
2322
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
2 <div class="main d-flex flex-row" style="position: relative;"> |
2919
6c5364ff0abb
client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents:
2899
diff
changeset
|
3 <Spacer /> |
2534
bb5286acfee2
client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents:
2503
diff
changeset
|
4 <div class="d-flex content py-2"> |
2322
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
5 <div :class="userlistStyle"> |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
6 <div class="card shadow-xs"> |
2760
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2739
diff
changeset
|
7 <UIBoxHeader icon="users-cog" :title="usersLabel" /> |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
8 <UITableHeader |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
9 :columns="[ |
2782
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
10 { id: 'role', title: `${roleForColumLabel}`, class: 'col-1' }, |
2874
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
11 { id: 'user', title: `${usernameLabel}`, class: 'col-4' }, |
2782
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
12 { id: 'country', title: `${countryLabel}`, class: 'col-2' }, |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
13 { id: 'email', title: `${emailLabel}`, class: 'col-3' } |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
14 ]" |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
15 /> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
16 <UITableBody |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
17 :data="users | sortTable(sortColumn, sortDirection, page, pageSize)" |
2880
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
18 :isActive="item => item === currentUser" |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
19 maxHeight="47rem" |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
20 > |
2874
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
21 <template v-slot:row="{ item: user }"> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
22 <div |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
23 class="table-cell center col-1" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
24 @click="selectUser(user.user)" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
25 > |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
26 <font-awesome-icon |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
27 v-tooltip="roleLabel(user.role)" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
28 :icon="roleIcon(user.role)" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
29 class="fa-lg" |
2919
6c5364ff0abb
client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents:
2899
diff
changeset
|
30 /> |
2874
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
31 </div> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
32 <div class="table-cell col-4" @click="selectUser(user.user)"> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
33 {{ user.user }} |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
34 </div> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
35 <div |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
36 class="table-cell center col-2" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
37 @click="selectUser(user.user)" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
38 > |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
39 {{ user.country }} |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
40 </div> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
41 <div class="table-cell col-3" @click="selectUser(user.user)"> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
42 {{ user.email }} |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
43 </div> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
44 <div class="table-cell col text-right justify-content-end"> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
45 <button |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
46 @click="sendTestMail(user.user)" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
47 class="btn btn-xs btn-dark mr-1" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
48 v-tooltip="sendMailLabel" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
49 v-if="user.email" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
50 > |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
51 <font-awesome-icon icon="paper-plane" fixed-width /> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
52 </button> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
53 <button |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
54 @click="deleteUser(user.user)" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
55 class="btn btn-xs btn-dark" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
56 v-tooltip="deleteUserLabel" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
57 > |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
58 <font-awesome-icon icon="trash" fixed-width /> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
59 </button> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
60 </div> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
61 </template> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
62 </UITableBody> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
63 <div class="p-3 border-top d-flex justify-content-between"> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
64 <div></div> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
65 <div> |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
66 <button |
2874
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
67 @click="prevPage" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
68 v-if="this.page !== 1" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
69 class="mr-2 btn btn-sm btn-light align-self-center" |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
70 > |
2919
6c5364ff0abb
client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents:
2899
diff
changeset
|
71 <font-awesome-icon icon="angle-left" /> |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
72 </button> |
2874
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
73 {{ this.page }} / {{ this.pages }} |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
74 <button |
2874
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
75 @click="nextPage" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
76 v-if="this.page !== this.pages" |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2782
diff
changeset
|
77 class="ml-2 btn btn-sm btn-light align-self-center" |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
78 > |
2919
6c5364ff0abb
client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents:
2899
diff
changeset
|
79 <font-awesome-icon icon="angle-right" /> |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
80 </button> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
81 </div> |
2322
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
82 <button @click="addUser" class="btn btn-info addbutton shadow-sm"> |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
83 <translate>Add User</translate> |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
84 </button> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
85 </div> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
86 </div> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
87 </div> |
2919
6c5364ff0abb
client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents:
2899
diff
changeset
|
88 <Userdetail v-if="isUserDetailsVisible" /> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
89 </div> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
90 </div> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
91 </template> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
92 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
93 <style lang="sass" scoped> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
94 .content |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
95 width: 100% |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
96 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
97 .userdetails |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
98 width: 50% |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
99 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
100 .main |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
101 height: 100% |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
102 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
103 .icon |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
104 font-size: large |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
105 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
106 .userlist |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
107 min-width: 520px |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
108 height: 100% |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
109 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
110 .userlistsmall |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
111 width: 100% |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
112 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
113 .userlistextended |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
114 width: 100% |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
115 </style> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
116 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
117 <script> |
1362
ca33ad696594
remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1361
diff
changeset
|
118 /* 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
|
119 * 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
|
120 * |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
121 * SPDX-License-Identifier: AGPL-3.0-or-later |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
122 * 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
|
123 * |
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
124 * Copyright (C) 2018 by via donau |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
125 * – Österreichische Wasserstraßen-Gesellschaft mbH |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
126 * 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
|
127 * |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
128 * Author(s): |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
129 * Thomas Junk <thomas.junk@intevation.de> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
130 */ |
1613
f2d24dceecc7
refac: cleanup import paths
Thomas Junk <thomas.junk@intevation.de>
parents:
1606
diff
changeset
|
131 import store from "@/store"; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
132 import { mapGetters, mapState } from "vuex"; |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2919
diff
changeset
|
133 import { displayError, displayInfo } from "@/lib/errors"; |
2320
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
134 import { HTTP } from "@/lib/http"; |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
135 import { sortTable } from "@/lib/mixins"; |
1674
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
136 |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
137 export default { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
138 name: "userview", |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
139 mixins: [sortTable], |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
140 data() { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
141 return { |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
142 sortColumn: "user" // overriding the sortTable mixin's empty default value |
1272
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 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
145 components: { |
1669
16fb9667ddf8
refac: use dynamic imports for components
Thomas Junk <thomas.junk@intevation.de>
parents:
1613
diff
changeset
|
146 Userdetail: () => import("./Userdetail"), |
16fb9667ddf8
refac: use dynamic imports for components
Thomas Junk <thomas.junk@intevation.de>
parents:
1613
diff
changeset
|
147 Spacer: () => import("@/components/Spacer") |
1272
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 computed: { |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
150 ...mapGetters("usermanagement", [ |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
151 "isUserDetailsVisible", |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
152 "users", |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
153 "currentUser" |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
154 ]), |
1455
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1448
diff
changeset
|
155 ...mapState("application", ["showSidebar"]), |
2760
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2739
diff
changeset
|
156 usersLabel() { |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2739
diff
changeset
|
157 return this.$gettext("Users"); |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2739
diff
changeset
|
158 }, |
2595
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
159 sendMailLabel() { |
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
160 return this.$gettext("Send testmail"); |
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
161 }, |
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
162 deleteUserLabel() { |
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
163 return this.$gettext("Delete user"); |
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
164 }, |
2782
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
165 roleForColumLabel() { |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
166 return this.$gettext("Role"); |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
167 }, |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
168 usernameLabel() { |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
169 return this.$gettext("Username"); |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
170 }, |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
171 countryLabel() { |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
172 return this.$gettext("Country"); |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
173 }, |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
174 emailLabel() { |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
175 return this.$gettext("Email"); |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
176 }, |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
177 pages() { |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
178 return Math.ceil(this.users.length / this.pageSize); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
179 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
180 tableStyle() { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
181 return { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
182 table: true, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
183 "table-hover": true, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
184 "table-sm": this.isUserDetailsVisible, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
185 fadeIn: true, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
186 animated: true |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
187 }; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
188 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
189 userlistStyle() { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
190 return [ |
2534
bb5286acfee2
client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents:
2503
diff
changeset
|
191 "userlist mr-2", |
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 userlistsmall: this.isUserDetailsVisible, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
194 userlistextended: !this.isUserDetailsVisible |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
195 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
196 ]; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
197 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
198 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
199 methods: { |
2320
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
200 sendTestMail(user) { |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
201 HTTP.get("/testmail/" + user, { |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
202 headers: { |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
203 "X-Gemma-Auth": localStorage.getItem("token"), |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
204 "Content-type": "text/xml; charset=UTF-8" |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
205 } |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
206 }) |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
207 .then(() => { |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
208 displayInfo({ |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
209 message: this.$gettext("Testmail sent") |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
210 }); |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
211 }) |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
212 .catch(error => { |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
213 this.loginFailed = true; |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
214 const { status, data } = error.response; |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
215 displayError({ |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
216 title: this.$gettext("Backend Error"), |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
217 message: `${status}: ${data.message || data}` |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
218 }); |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
219 }); |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
220 }, |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
221 nextPage() { |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
222 if (this.page < this.pages) { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
223 this.page += 1; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
224 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
225 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
226 prevPage() { |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
227 if (this.page > 0) { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
228 this.page -= 1; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
229 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
230 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
231 deleteUser(name) { |
2384
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
232 this.$store.commit("application/popup", { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
233 icon: "trash", |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
234 title: this.$gettext("Delete User"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
235 content: |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
236 this.$gettext( |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
237 "Do you really want to delete the following user account:" |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
238 ) + |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
239 `<br> |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
240 <b>${name}</b>`, |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
241 confirm: { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
242 label: this.$gettext("Delete"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
243 icon: "trash", |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
244 callback: () => { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
245 this.$store |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
246 .dispatch("usermanagement/deleteUser", { name }) |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
247 .then(() => { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
248 this.$store |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
249 .dispatch("usermanagement/loadUsers") |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
250 .catch(error => { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
251 const { status, data } = error.response; |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
252 displayError({ |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
253 title: this.$gettext("Backend Error"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
254 message: `${status}: ${data.message || data}` |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
255 }); |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
256 }); |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
257 }) |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
258 .catch(error => { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
259 const { status, data } = error.response; |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
260 displayError({ |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
261 title: this.$gettext("Backend Error"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
262 message: `${status}: ${data.message || data}` |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
263 }); |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
264 }); |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
265 } |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
266 }, |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
267 cancel: { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
268 label: this.$gettext("Cancel"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
269 icon: "times" |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
270 } |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
271 }); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
272 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
273 addUser() { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
274 this.$store.commit("usermanagement/clearCurrentUser"); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
275 this.$store.commit("usermanagement/setUserDetailsVisible"); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
276 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
277 selectUser(name) { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
278 const user = this.$store.getters["usermanagement/getUserByName"](name); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
279 this.$store.commit("usermanagement/setCurrentUser", user); |
1299
2738a6ae9ad8
fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
280 }, |
2738a6ae9ad8
fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
281 roleIcon(role) { |
2738a6ae9ad8
fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
282 if (role === "sys_admin") return "star"; |
2738a6ae9ad8
fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
283 if (role === "waterway_admin") return ["fab", "adn"]; |
2738a6ae9ad8
fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
284 return "user"; |
1674
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
285 }, |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
286 roleLabel(role) { |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
287 const labels = { |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
288 sys_admin: this.$gettext("System-Administrator"), |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
289 waterway_admin: this.$gettext("Waterway Admin"), |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
290 waterway_user: this.$gettext("Waterway User") |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
291 }; |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
292 return labels[role]; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
293 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
294 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
295 beforeRouteEnter(to, from, next) { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
296 store |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
297 .dispatch("usermanagement/loadUsers") |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
298 .then(next) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
299 .catch(error => { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
300 const { status, data } = error.response; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
301 displayError({ |
1460 | 302 title: this.$gettext("Backend Error"), |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
303 message: `${status}: ${data}` |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
304 }); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
305 }); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
306 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
307 beforeRouteLeave(to, from, next) { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
308 store.commit("usermanagement/clearCurrentUser"); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
309 store.commit("usermanagement/setUserDetailsInvisible"); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
310 next(); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
311 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
312 }; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
313 </script> |