Mercurial > gemma
annotate client/src/components/usermanagement/Usermanagement.vue @ 2624:9dbaf69c7a66
Improve geoserver config to better calculate bounding boxes
* Disable the use of estimated extents for the postgis storage
configuration for geoserver, which is set via the gemma middleware.
This way we are able to get better bounding boxes for many layers
where the postgis function `ST_EstimatedExtent()` would be far off.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Wed, 13 Mar 2019 16:18:39 +0100 |
parents | dda4cec8e67b |
children | 4bcb26542767 |
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;"> |
1606
a4d8f284db93
spacer in admin interface added
Thomas Junk <thomas.junk@intevation.de>
parents:
1604
diff
changeset
|
3 <Spacer></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"> |
2387
f185503ef35a
client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents:
2384
diff
changeset
|
7 <UIBoxHeader icon="users-cog" title="Users" /> |
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="[ |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
10 { id: 'role', title: 'Role', class: 'col-1' }, |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
11 { id: 'user', title: 'Username', class: 'col-3' }, |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
12 { id: 'country', title: 'Country', class: 'col-2' }, |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
13 { id: 'email', title: 'Email', class: 'col-3' } |
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 @sortingChanged="sortBy" |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
16 /> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
17 <UITableBody |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
18 :data="sortedUsers" |
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 :active="currentUser" |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
21 v-slot="{ item: user }" |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
22 > |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
23 <div class="py-2 col-1" @click="selectUser(user.user)"> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
24 <font-awesome-icon |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
25 v-tooltip="roleLabel(user.role)" |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
26 :icon="roleIcon(user.role)" |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
27 class="fa-lg" |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
28 ></font-awesome-icon> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
29 </div> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
30 <div class="py-2 col-3" @click="selectUser(user.user)"> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
31 {{ user.user }} |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
32 </div> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
33 <div class="py-2 col-2" @click="selectUser(user.user)"> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
34 {{ user.country }} |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
35 </div> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
36 <div class="py-2 col-3" @click="selectUser(user.user)"> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
37 {{ user.email }} |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
38 </div> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
39 <div class="py-2 col text-right"> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
40 <button |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
41 @click="sendTestMail(user.user)" |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
42 class="btn btn-sm btn-dark mr-1" |
2595
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
43 v-tooltip="sendMailLabel" |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
44 v-if="user.email" |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
45 > |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
46 <font-awesome-icon icon="paper-plane"></font-awesome-icon> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
47 </button> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
48 <button |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
49 @click="deleteUser(user.user)" |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
50 class="btn btn-sm btn-dark" |
2595
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
51 v-tooltip="deleteUserLabel" |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
52 > |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
53 <font-awesome-icon icon="trash" /> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
54 </button> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
55 </div> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
56 </UITableBody> |
2322
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
57 <div class="d-flex mx-auto align-items-center"> |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
58 <button |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
59 @click="prevPage" |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
60 v-if="this.currentPage !== 1" |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
61 class="mr-2 btn btn-sm btn-light align-self-center" |
1480 | 62 > |
2322
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
63 <font-awesome-icon icon="angle-left"></font-awesome-icon> |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
64 </button> |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
65 {{ this.currentPage }} / {{ this.pages }} |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
66 <button |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
67 @click="nextPage" |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
68 v-if="this.currentPage !== this.pages" |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
69 class="ml-2 btn btn-sm btn-light align-self-center" |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
70 > |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
71 <font-awesome-icon icon="angle-right"></font-awesome-icon> |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
72 </button> |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
73 </div> |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
74 <div class="mr-3 py-3 text-right"> |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
75 <button @click="addUser" class="btn btn-info addbutton shadow-sm"> |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
76 <translate>Add User</translate> |
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
77 </button> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
78 </div> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
79 </div> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
80 </div> |
2322
a25b4988eb0c
client: fixed usermanagement styles
Markus Kottlaender <markus@intevation.de>
parents:
2320
diff
changeset
|
81 <Userdetail v-if="isUserDetailsVisible"></Userdetail> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
82 </div> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
83 </div> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
84 </template> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
85 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
86 <style lang="sass" scoped> |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
87 .addbutton |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
88 position: absolute |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
89 bottom: $offset |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
90 right: $offset |
1542 | 91 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
92 .content |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
93 width: 100% |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
94 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
95 .userdetails |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
96 width: 50% |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
97 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
98 .main |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
99 height: 100% |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
100 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
101 .icon |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
102 font-size: large |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
103 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
104 .userlist |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
105 min-width: 520px |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
106 height: 100% |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
107 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
108 .userlistsmall |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
109 width: 100% |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
110 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
111 .userlistextended |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
112 width: 100% |
2320
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
113 |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
114 .table-body |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
115 .row |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
116 > div |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
117 transition: background-color 0.3s, color 0.3s |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
118 &.active |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
119 > div |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
120 background-color: $color-info |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
121 color: #fff |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
122 a |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
123 color: #fff !important |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
124 </style> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
125 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
126 <script> |
1362
ca33ad696594
remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1361
diff
changeset
|
127 /* 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
|
128 * 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
|
129 * |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
130 * SPDX-License-Identifier: AGPL-3.0-or-later |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
131 * 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
|
132 * |
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
133 * Copyright (C) 2018 by via donau |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
134 * – Österreichische Wasserstraßen-Gesellschaft mbH |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
135 * 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
|
136 * |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
137 * Author(s): |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
138 * Thomas Junk <thomas.junk@intevation.de> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
139 */ |
1613
f2d24dceecc7
refac: cleanup import paths
Thomas Junk <thomas.junk@intevation.de>
parents:
1606
diff
changeset
|
140 import store from "@/store"; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
141 import { mapGetters, mapState } from "vuex"; |
2320
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
142 import { displayError, displayInfo } from "@/lib/errors.js"; |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
143 import { HTTP } from "@/lib/http"; |
1674
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
144 import Vue from "vue"; |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
145 import { VTooltip, VPopover, VClosePopover } from "v-tooltip"; |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
146 |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
147 Vue.directive("tooltip", VTooltip); |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
148 Vue.directive("close-popover", VClosePopover); |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
149 Vue.component("v-popover", VPopover); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
150 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
151 export default { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
152 name: "userview", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
153 data() { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
154 return { |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
155 sortColumn: "user", |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
156 sortDirection: "ASC", |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
157 pageSize: 15, |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
158 currentPage: 1 |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
159 }; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
160 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
161 components: { |
1669
16fb9667ddf8
refac: use dynamic imports for components
Thomas Junk <thomas.junk@intevation.de>
parents:
1613
diff
changeset
|
162 Userdetail: () => import("./Userdetail"), |
16fb9667ddf8
refac: use dynamic imports for components
Thomas Junk <thomas.junk@intevation.de>
parents:
1613
diff
changeset
|
163 Spacer: () => import("@/components/Spacer") |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
164 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
165 computed: { |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
166 ...mapGetters("usermanagement", [ |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
167 "isUserDetailsVisible", |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
168 "users", |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
169 "currentUser" |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
170 ]), |
1455
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1448
diff
changeset
|
171 ...mapState("application", ["showSidebar"]), |
2595
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
172 sendMailLabel() { |
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
173 return this.$gettext("Send testmail"); |
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
174 }, |
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
175 deleteUserLabel() { |
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
176 return this.$gettext("Delete user"); |
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
177 }, |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
178 sortedUsers() { |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
179 const start = (this.currentPage - 1) * this.pageSize; |
2503
51dbcbf11c5f
client: addendum for e13daf439068
Markus Kottlaender <markus@intevation.de>
parents:
2502
diff
changeset
|
180 return this.users |
51dbcbf11c5f
client: addendum for e13daf439068
Markus Kottlaender <markus@intevation.de>
parents:
2502
diff
changeset
|
181 .filter(u => u) // to clone the array and leave the original store value intact |
51dbcbf11c5f
client: addendum for e13daf439068
Markus Kottlaender <markus@intevation.de>
parents:
2502
diff
changeset
|
182 .sort((a, b) => { |
51dbcbf11c5f
client: addendum for e13daf439068
Markus Kottlaender <markus@intevation.de>
parents:
2502
diff
changeset
|
183 if ( |
51dbcbf11c5f
client: addendum for e13daf439068
Markus Kottlaender <markus@intevation.de>
parents:
2502
diff
changeset
|
184 a[this.sortColumn].toLowerCase() < b[this.sortColumn].toLowerCase() |
51dbcbf11c5f
client: addendum for e13daf439068
Markus Kottlaender <markus@intevation.de>
parents:
2502
diff
changeset
|
185 ) |
51dbcbf11c5f
client: addendum for e13daf439068
Markus Kottlaender <markus@intevation.de>
parents:
2502
diff
changeset
|
186 return this.sortDirection === "ASC" ? -1 : 1; |
51dbcbf11c5f
client: addendum for e13daf439068
Markus Kottlaender <markus@intevation.de>
parents:
2502
diff
changeset
|
187 if ( |
51dbcbf11c5f
client: addendum for e13daf439068
Markus Kottlaender <markus@intevation.de>
parents:
2502
diff
changeset
|
188 a[this.sortColumn].toLowerCase() > b[this.sortColumn].toLowerCase() |
51dbcbf11c5f
client: addendum for e13daf439068
Markus Kottlaender <markus@intevation.de>
parents:
2502
diff
changeset
|
189 ) |
51dbcbf11c5f
client: addendum for e13daf439068
Markus Kottlaender <markus@intevation.de>
parents:
2502
diff
changeset
|
190 return this.sortDirection === "ASC" ? 1 : -1; |
51dbcbf11c5f
client: addendum for e13daf439068
Markus Kottlaender <markus@intevation.de>
parents:
2502
diff
changeset
|
191 return 0; |
51dbcbf11c5f
client: addendum for e13daf439068
Markus Kottlaender <markus@intevation.de>
parents:
2502
diff
changeset
|
192 }) |
51dbcbf11c5f
client: addendum for e13daf439068
Markus Kottlaender <markus@intevation.de>
parents:
2502
diff
changeset
|
193 .slice(start, start + this.pageSize); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
194 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
195 pages() { |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
196 return Math.ceil(this.users.length / this.pageSize); |
1272
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 tableStyle() { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
199 return { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
200 table: true, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
201 "table-hover": true, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
202 "table-sm": this.isUserDetailsVisible, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
203 fadeIn: true, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
204 animated: true |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
205 }; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
206 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
207 userlistStyle() { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
208 return [ |
2534
bb5286acfee2
client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents:
2503
diff
changeset
|
209 "userlist mr-2", |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
210 { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
211 userlistsmall: this.isUserDetailsVisible, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
212 userlistextended: !this.isUserDetailsVisible |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
213 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
214 ]; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
215 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
216 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
217 methods: { |
2320
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
218 sendTestMail(user) { |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
219 HTTP.get("/testmail/" + user, { |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
220 headers: { |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
221 "X-Gemma-Auth": localStorage.getItem("token"), |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
222 "Content-type": "text/xml; charset=UTF-8" |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
223 } |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
224 }) |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
225 .then(() => { |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
226 displayInfo({ |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
227 message: this.$gettext("Testmail sent") |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
228 }); |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
229 }) |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
230 .catch(error => { |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
231 this.loginFailed = true; |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
232 const { status, data } = error.response; |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
233 displayError({ |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
234 title: this.$gettext("Backend Error"), |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
235 message: `${status}: ${data.message || data}` |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
236 }); |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
237 }); |
f2c67ebeaabb
moved test mail button to table
Markus Kottlaender <markus@intevation.de>
parents:
2290
diff
changeset
|
238 }, |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
239 nextPage() { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
240 if (this.currentPage < this.pages) { |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
241 this.currentPage += 1; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
242 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
243 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
244 prevPage() { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
245 if (this.currentPage > 0) { |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
246 this.currentPage -= 1; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
247 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
248 }, |
2463
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
249 sortBy(sorting) { |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
250 this.sortColumn = sorting.sortColumn; |
8cc3cd1b27f2
client: usermanagement: implemented new table component
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
251 this.sortDirection = sorting.sortDirection; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
252 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
253 deleteUser(name) { |
2384
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
254 this.$store.commit("application/popup", { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
255 icon: "trash", |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
256 title: this.$gettext("Delete User"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
257 content: |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
258 this.$gettext( |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
259 "Do you really want to delete the following user account:" |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
260 ) + |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
261 `<br> |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
262 <b>${name}</b>`, |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
263 confirm: { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
264 label: this.$gettext("Delete"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
265 icon: "trash", |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
266 callback: () => { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
267 this.$store |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
268 .dispatch("usermanagement/deleteUser", { name }) |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
269 .then(() => { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
270 this.$store |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
271 .dispatch("usermanagement/loadUsers") |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
272 .catch(error => { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
273 const { status, data } = error.response; |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
274 displayError({ |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
275 title: this.$gettext("Backend Error"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
276 message: `${status}: ${data.message || data}` |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
277 }); |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
278 }); |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
279 }) |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
280 .catch(error => { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
281 const { status, data } = error.response; |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
282 displayError({ |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
283 title: this.$gettext("Backend Error"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
284 message: `${status}: ${data.message || data}` |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
285 }); |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
286 }); |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
287 } |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
288 }, |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
289 cancel: { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
290 label: this.$gettext("Cancel"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
291 icon: "times" |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
292 } |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2330
diff
changeset
|
293 }); |
1272
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 addUser() { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
296 this.$store.commit("usermanagement/clearCurrentUser"); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
297 this.$store.commit("usermanagement/setUserDetailsVisible"); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
298 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
299 selectUser(name) { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
300 const user = this.$store.getters["usermanagement/getUserByName"](name); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
301 this.$store.commit("usermanagement/setCurrentUser", user); |
1299
2738a6ae9ad8
fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
302 }, |
2738a6ae9ad8
fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
303 roleIcon(role) { |
2738a6ae9ad8
fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
304 if (role === "sys_admin") return "star"; |
2738a6ae9ad8
fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
305 if (role === "waterway_admin") return ["fab", "adn"]; |
2738a6ae9ad8
fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
306 return "user"; |
1674
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
307 }, |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
308 roleLabel(role) { |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
309 const labels = { |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
310 sys_admin: this.$gettext("System-Administrator"), |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
311 waterway_admin: this.$gettext("Waterway Admin"), |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
312 waterway_user: this.$gettext("Waterway User") |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
313 }; |
54f7493e5d36
fix: Tooltips are working again
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
314 return labels[role]; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
315 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
316 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
317 beforeRouteEnter(to, from, next) { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
318 store |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
319 .dispatch("usermanagement/loadUsers") |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
320 .then(next) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
321 .catch(error => { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
322 const { status, data } = error.response; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
323 displayError({ |
1460 | 324 title: this.$gettext("Backend Error"), |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
325 message: `${status}: ${data}` |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
326 }); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
327 }); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
328 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
329 beforeRouteLeave(to, from, next) { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
330 store.commit("usermanagement/clearCurrentUser"); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
331 store.commit("usermanagement/setUserDetailsInvisible"); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
332 next(); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
333 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
334 }; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
335 </script> |