@enso-ui/users 2.0.6 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -2
- package/src/bulma/components/navbar/ProfileControl.vue +6 -13
- package/src/bulma/pages/users/Edit.vue +2 -0
- package/src/bulma/pages/users/components/Avatar.vue +7 -8
- package/src/bulma/pages/users/components/DeleteModal.vue +2 -0
- package/src/bulma/pages/users/components/Session.vue +2 -3
- package/src/bulma/pages/users/components/Sessions.vue +2 -0
- package/src/bulma/pages/users/components/Token.vue +2 -3
- package/src/bulma/pages/users/components/Tokens.vue +2 -0
- package/src/bulma/pages/users/components/UserProfile.vue +12 -6
- package/src/core/components/navbar/ProfileControl.vue +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enso-ui/users",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10",
|
|
4
4
|
"description": "Basic users package",
|
|
5
5
|
"main": "bulma/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"@fortawesome/fontawesome-svg-core": "^1.2.2",
|
|
37
37
|
"@fortawesome/free-solid-svg-icons": "^5.2.0",
|
|
38
38
|
"@fortawesome/vue-fontawesome": "3.0.0-5",
|
|
39
|
-
"v-tooltip": "4.0.0-alpha.1",
|
|
40
39
|
"vue": "^3.0",
|
|
41
40
|
"vuex": "^4.0.0"
|
|
42
41
|
},
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<core-profile-control>
|
|
3
|
-
<template #default="{ user,
|
|
3
|
+
<template #default="{ user, hide, isTouch, visitProfile, toggle, visible }">
|
|
4
4
|
<a class="navbar-item"
|
|
5
5
|
@click="visitProfile()"
|
|
6
6
|
v-if="isTouch">
|
|
7
|
-
<
|
|
8
|
-
:src="avatarLink">
|
|
9
|
-
<span v-if="!isTouch"
|
|
10
|
-
class="ml-1">
|
|
11
|
-
{{ user.person.appellative || user.person.name }}
|
|
12
|
-
</span>
|
|
7
|
+
<avatar :user="user"/>
|
|
13
8
|
</a>
|
|
14
9
|
<div v-click-outside="hide"
|
|
15
10
|
:class="[
|
|
@@ -19,15 +14,13 @@
|
|
|
19
14
|
]" v-else>
|
|
20
15
|
<a class="navbar-link is-arrowless"
|
|
21
16
|
@click="toggle()">
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
<span v-if="!isTouch"
|
|
25
|
-
class="ml-1">
|
|
17
|
+
<avatar :user="user"/>
|
|
18
|
+
<span class="ml-1">
|
|
26
19
|
{{ user.person.appellative || user.person.name }}
|
|
27
20
|
</span>
|
|
28
21
|
</a>
|
|
29
|
-
<div
|
|
30
|
-
|
|
22
|
+
<div class="navbar-dropdown is-right"
|
|
23
|
+
v-if="visible">
|
|
31
24
|
<div class="user-panel p-2">
|
|
32
25
|
<avatar class="is-96x96"
|
|
33
26
|
:user="user"/>
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<figure class="image avatar"
|
|
3
|
-
v-tooltip="tooltip">
|
|
2
|
+
<figure class="image avatar">
|
|
4
3
|
<img class="is-rounded"
|
|
5
|
-
:src="
|
|
4
|
+
:src="link">
|
|
6
5
|
</figure>
|
|
7
6
|
</template>
|
|
8
7
|
|
|
9
8
|
<script>
|
|
10
|
-
import { VTooltip } from 'v-tooltip';
|
|
11
9
|
|
|
12
10
|
export default {
|
|
13
11
|
name: 'Avatar',
|
|
14
12
|
|
|
15
|
-
directives: { tooltip: VTooltip },
|
|
16
|
-
|
|
17
13
|
inject: ['route'],
|
|
18
14
|
|
|
19
15
|
props: {
|
|
@@ -24,11 +20,14 @@ export default {
|
|
|
24
20
|
},
|
|
25
21
|
|
|
26
22
|
computed: {
|
|
23
|
+
link() {
|
|
24
|
+
return this.route('core.avatars.show', this.user.avatar.id);
|
|
25
|
+
},
|
|
27
26
|
tooltip() {
|
|
28
27
|
return this.user.person?.appellative
|
|
29
28
|
?? this.user.person?.name;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
29
|
+
},
|
|
30
|
+
},
|
|
32
31
|
};
|
|
33
32
|
</script>
|
|
34
33
|
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
</template>
|
|
44
44
|
|
|
45
45
|
<script>
|
|
46
|
-
import { VTooltip } from 'v-tooltip';
|
|
47
46
|
import { FontAwesomeIcon as Fa } from '@fortawesome/vue-fontawesome';
|
|
48
47
|
import { library } from '@fortawesome/fontawesome-svg-core';
|
|
49
48
|
import {
|
|
@@ -72,8 +71,6 @@ export default {
|
|
|
72
71
|
|
|
73
72
|
inject: ['canAccess'],
|
|
74
73
|
|
|
75
|
-
directives: { tooltip: VTooltip },
|
|
76
|
-
|
|
77
74
|
components: { Confirmation, Fa },
|
|
78
75
|
|
|
79
76
|
props: {
|
|
@@ -83,6 +80,8 @@ export default {
|
|
|
83
80
|
},
|
|
84
81
|
},
|
|
85
82
|
|
|
83
|
+
emits: ['delete'],
|
|
84
|
+
|
|
86
85
|
data: () => ({
|
|
87
86
|
confirmation: false,
|
|
88
87
|
}),
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
</template>
|
|
38
38
|
|
|
39
39
|
<script>
|
|
40
|
-
import { VTooltip } from 'v-tooltip';
|
|
41
40
|
import { FontAwesomeIcon as Fa } from '@fortawesome/vue-fontawesome';
|
|
42
41
|
import { library } from '@fortawesome/fontawesome-svg-core';
|
|
43
42
|
import {
|
|
@@ -55,8 +54,6 @@ export default {
|
|
|
55
54
|
|
|
56
55
|
inject: ['canAccess'],
|
|
57
56
|
|
|
58
|
-
directives: { tooltip: VTooltip },
|
|
59
|
-
|
|
60
57
|
components: { Confirmation, Fa },
|
|
61
58
|
|
|
62
59
|
props: {
|
|
@@ -66,6 +63,8 @@ export default {
|
|
|
66
63
|
},
|
|
67
64
|
},
|
|
68
65
|
|
|
66
|
+
emits: ['delete'],
|
|
67
|
+
|
|
69
68
|
data: () => ({
|
|
70
69
|
confirmation: false,
|
|
71
70
|
}),
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
&& !impersonating
|
|
58
58
|
">
|
|
59
59
|
<a class="button is-warning"
|
|
60
|
-
@click="
|
|
60
|
+
@click="startImpersonating">
|
|
61
61
|
<span class="icon">
|
|
62
62
|
<fa icon="user-circle"/>
|
|
63
63
|
</span>
|
|
@@ -158,6 +158,7 @@ import {
|
|
|
158
158
|
faUser, faUserCircle, faSyncAlt, faTrashAlt, faUpload, faSignOutAlt, faPencilAlt,
|
|
159
159
|
} from '@fortawesome/free-solid-svg-icons';
|
|
160
160
|
import { Uploader } from '@enso-ui/uploader/bulma';
|
|
161
|
+
import eventBus from '@enso-ui/ui/src/core/services/eventBus';
|
|
161
162
|
import Divider from '@enso-ui/divider';
|
|
162
163
|
import format from '@enso-ui/ui/src/modules/plugins/date-fns/format';
|
|
163
164
|
|
|
@@ -170,6 +171,8 @@ export default {
|
|
|
170
171
|
|
|
171
172
|
inject: ['canAccess', 'errorHandler', 'i18n', 'route', 'routerErrorHandler'],
|
|
172
173
|
|
|
174
|
+
emits: ['start-impersonating'],
|
|
175
|
+
|
|
173
176
|
data: () => ({
|
|
174
177
|
profile: null,
|
|
175
178
|
}),
|
|
@@ -197,21 +200,24 @@ export default {
|
|
|
197
200
|
|
|
198
201
|
methods: {
|
|
199
202
|
...mapMutations(['setUserAvatar']),
|
|
203
|
+
dateFormat(date) {
|
|
204
|
+
return date
|
|
205
|
+
? format(date, this.meta.dateFormat)
|
|
206
|
+
: null;
|
|
207
|
+
},
|
|
200
208
|
fetch() {
|
|
201
209
|
axios.get(this.route(this.$route.name, this.$route.params.user))
|
|
202
210
|
.then(response => (this.profile = response.data.user))
|
|
203
211
|
.catch(this.errorHandler);
|
|
204
212
|
},
|
|
213
|
+
startImpersonating() {
|
|
214
|
+
eventBus.$emit('start-impersonating', this.profile.id);
|
|
215
|
+
},
|
|
205
216
|
updateAvatar() {
|
|
206
217
|
axios.patch(this.route('core.avatars.update', this.user.avatar.id))
|
|
207
218
|
.then(({ data }) => this.setUserAvatar(data.avatarId))
|
|
208
219
|
.catch(this.errorHandler);
|
|
209
220
|
},
|
|
210
|
-
dateFormat(date) {
|
|
211
|
-
return date
|
|
212
|
-
? format(date, this.meta.dateFormat)
|
|
213
|
-
: null;
|
|
214
|
-
},
|
|
215
221
|
},
|
|
216
222
|
};
|
|
217
223
|
</script>
|