@enso-ui/users 2.0.13 → 2.0.17
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 +3 -2
- package/src/bulma/components/navbar/ProfileControl.vue +2 -2
- package/src/bulma/pages/users/Create.vue +1 -1
- package/src/bulma/pages/users/Edit.vue +8 -5
- package/src/bulma/pages/users/Index.vue +3 -1
- package/src/bulma/pages/users/components/DeleteModal.vue +2 -2
- package/src/bulma/pages/users/components/Session.vue +2 -2
- package/src/bulma/pages/users/components/Sessions.vue +6 -5
- package/src/bulma/pages/users/components/Token.vue +2 -2
- package/src/bulma/pages/users/components/Tokens.vue +8 -8
- package/src/bulma/pages/users/components/UserProfile.vue +7 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enso-ui/users",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.17",
|
|
4
4
|
"description": "Basic users package",
|
|
5
5
|
"main": "bulma/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"@enso-ui/ui": "^5.0",
|
|
35
35
|
"@enso-ui/uploader": "^2.0",
|
|
36
36
|
"@fortawesome/fontawesome-svg-core": "^1.2.2",
|
|
37
|
-
"@fortawesome/free-
|
|
37
|
+
"@fortawesome/free-brands-svg-icons": "^5.11.2",
|
|
38
|
+
"@fortawesome/free-solid-svg-icons": "^5.11.2",
|
|
38
39
|
"@fortawesome/vue-fontawesome": "3.0.0-5",
|
|
39
40
|
"vue": "^3.0",
|
|
40
41
|
"vuex": "^4.0.0"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<enso-form class="box has-background-light raises-on-hover">
|
|
5
5
|
<template #group_id="props">
|
|
6
6
|
<form-field v-bind="props"
|
|
7
|
-
@update:
|
|
7
|
+
@update:model-value="pivotParams.userGroups.id = $event"/>
|
|
8
8
|
</template>
|
|
9
9
|
<template #role_id="props">
|
|
10
10
|
<form-field v-bind="props"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
">
|
|
10
10
|
<template #group_id="props">
|
|
11
11
|
<form-field v-bind="props"
|
|
12
|
-
@update:
|
|
12
|
+
@update:model-value="pivotParams.userGroups.id = $event"/>
|
|
13
13
|
</template>
|
|
14
14
|
<template #role_id="props">
|
|
15
15
|
<form-field v-bind="props"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<form-field v-bind="props"
|
|
20
20
|
@focus="props.field.meta.readonly = false"
|
|
21
21
|
@blur="props.field.meta.readonly = true"
|
|
22
|
-
@
|
|
22
|
+
@update:model-value="password = $event.target.value"
|
|
23
23
|
v-if="!props.field.meta.hidden"/>
|
|
24
24
|
<password-strength class="mt-1"
|
|
25
25
|
:password="props.field.value"/>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<form-field v-bind="props"
|
|
29
29
|
@focus="props.field.meta.readonly = false"
|
|
30
30
|
@blur="props.field.meta.readonly = true"
|
|
31
|
-
@
|
|
31
|
+
@update:model-value="passwordConfirmation = $event.target.value"
|
|
32
32
|
@keydown="$emit('update');"
|
|
33
33
|
v-if="!props.field.meta.hidden"/>
|
|
34
34
|
</template>
|
|
@@ -145,7 +145,10 @@ export default {
|
|
|
145
145
|
Tokens,
|
|
146
146
|
},
|
|
147
147
|
|
|
148
|
-
inject: [
|
|
148
|
+
inject: [
|
|
149
|
+
'http', 'i18n', 'canAccess', 'errorHandler', 'route',
|
|
150
|
+
'routerErrorHandler', 'toastr',
|
|
151
|
+
],
|
|
149
152
|
|
|
150
153
|
emits: ['update'],
|
|
151
154
|
|
|
@@ -178,7 +181,7 @@ export default {
|
|
|
178
181
|
.catch(this.routerErrorHandler));
|
|
179
182
|
},
|
|
180
183
|
resetPassword() {
|
|
181
|
-
|
|
184
|
+
this.http.post(this.route('administration.users.resetPassword', this.$route.params))
|
|
182
185
|
.then(({ data }) => this.toastr.success(data.message))
|
|
183
186
|
.catch(this.errorHandler);
|
|
184
187
|
},
|
|
@@ -41,7 +41,7 @@ export default {
|
|
|
41
41
|
|
|
42
42
|
directives: { focus },
|
|
43
43
|
|
|
44
|
-
inject: ['i18n', 'errorHandler', 'route'],
|
|
44
|
+
inject: ['http', 'i18n', 'errorHandler', 'route'],
|
|
45
45
|
|
|
46
46
|
props: {
|
|
47
47
|
userId: {
|
|
@@ -54,7 +54,7 @@ export default {
|
|
|
54
54
|
|
|
55
55
|
methods: {
|
|
56
56
|
destroy(person = false) {
|
|
57
|
-
|
|
57
|
+
this.http.delete(this.route('administration.users.destroy', this.userId),
|
|
58
58
|
{ params: { person: !!person } })
|
|
59
59
|
.then(({ data }) => this.$emit('destroyed', data))
|
|
60
60
|
.catch(this.errorHandler);
|
|
@@ -49,10 +49,10 @@ library.add(faPlus, faSync, faSearch);
|
|
|
49
49
|
export default {
|
|
50
50
|
name: 'Sessions',
|
|
51
51
|
|
|
52
|
-
inject: ['canAccess', 'errorHandler', 'i18n', 'route', 'toastr'],
|
|
53
|
-
|
|
54
52
|
components: { Fa, Session },
|
|
55
53
|
|
|
54
|
+
inject: ['canAccess', 'errorHandler', 'http', 'i18n', 'route', 'toastr'],
|
|
55
|
+
|
|
56
56
|
props: {
|
|
57
57
|
id: {
|
|
58
58
|
type: [Number, String],
|
|
@@ -73,7 +73,8 @@ export default {
|
|
|
73
73
|
const query = this.query.toLowerCase();
|
|
74
74
|
|
|
75
75
|
return query
|
|
76
|
-
? this.sessions.filter(({ ipAddress, OS, browser }) => OS
|
|
76
|
+
? this.sessions.filter(({ ipAddress, OS, browser }) => OS
|
|
77
|
+
.toLowerCase().indexOf(query) > -1
|
|
77
78
|
|| ipAddress.toLowerCase().indexOf(query) > -1
|
|
78
79
|
|| browser.toLowerCase().indexOf(query) > -1)
|
|
79
80
|
: this.sessions;
|
|
@@ -89,14 +90,14 @@ export default {
|
|
|
89
90
|
|
|
90
91
|
methods: {
|
|
91
92
|
fetch() {
|
|
92
|
-
|
|
93
|
+
this.http.get(this.route('administration.users.sessions.index', this.$route.params))
|
|
93
94
|
.then(({ data }) => {
|
|
94
95
|
this.sessions = data;
|
|
95
96
|
this.$emit('update');
|
|
96
97
|
}).catch(this.errorHandler);
|
|
97
98
|
},
|
|
98
99
|
destroy({ id }, index) {
|
|
99
|
-
|
|
100
|
+
this.http.delete(
|
|
100
101
|
this.route('administration.users.sessions.destroy', this.$route.params),
|
|
101
102
|
{ params: { id } },
|
|
102
103
|
).then(({ data }) => {
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
</p>
|
|
41
41
|
</div>
|
|
42
42
|
<div>
|
|
43
|
-
<div v-for="(
|
|
44
|
-
:key="
|
|
43
|
+
<div v-for="(filteredToken, index) in filtered"
|
|
44
|
+
:key="filteredToken.id">
|
|
45
45
|
<token :id="id"
|
|
46
|
-
:token="
|
|
47
|
-
@delete="destroy(
|
|
46
|
+
:token="filteredToken"
|
|
47
|
+
@delete="destroy(filteredToken, index)"/>
|
|
48
48
|
</div>
|
|
49
49
|
</div>
|
|
50
50
|
<token-form :path="create"
|
|
@@ -71,8 +71,6 @@ library.add(faPlus, faSync, faSearch);
|
|
|
71
71
|
export default {
|
|
72
72
|
name: 'Tokens',
|
|
73
73
|
|
|
74
|
-
inject: ['canAccess', 'errorHandler', 'i18n', 'route', 'toastr'],
|
|
75
|
-
|
|
76
74
|
components: {
|
|
77
75
|
Fa,
|
|
78
76
|
Token,
|
|
@@ -80,6 +78,8 @@ export default {
|
|
|
80
78
|
Url,
|
|
81
79
|
},
|
|
82
80
|
|
|
81
|
+
inject: ['canAccess', 'errorHandler', 'http', 'i18n', 'route', 'toastr'],
|
|
82
|
+
|
|
83
83
|
props: {
|
|
84
84
|
id: {
|
|
85
85
|
type: [Number, String],
|
|
@@ -121,14 +121,14 @@ export default {
|
|
|
121
121
|
|
|
122
122
|
methods: {
|
|
123
123
|
fetch() {
|
|
124
|
-
|
|
124
|
+
this.http.get(this.route('administration.users.tokens.index', this.$route.params))
|
|
125
125
|
.then(({ data }) => {
|
|
126
126
|
this.tokens = data;
|
|
127
127
|
this.$emit('update');
|
|
128
128
|
}).catch(this.errorHandler);
|
|
129
129
|
},
|
|
130
130
|
destroy({ id }, index) {
|
|
131
|
-
|
|
131
|
+
this.http.delete(
|
|
132
132
|
this.route('administration.users.tokens.destroy', this.$route.params),
|
|
133
133
|
{ params: { id } },
|
|
134
134
|
).then(({ data }) => {
|
|
@@ -149,9 +149,7 @@
|
|
|
149
149
|
</template>
|
|
150
150
|
|
|
151
151
|
<script>
|
|
152
|
-
import {
|
|
153
|
-
mapState, mapMutations, mapActions, mapGetters,
|
|
154
|
-
} from 'vuex';
|
|
152
|
+
import { mapState, mapMutations, mapGetters } from 'vuex';
|
|
155
153
|
import { FontAwesomeIcon as Fa } from '@fortawesome/vue-fontawesome';
|
|
156
154
|
import { library } from '@fortawesome/fontawesome-svg-core';
|
|
157
155
|
import {
|
|
@@ -169,7 +167,10 @@ export default {
|
|
|
169
167
|
|
|
170
168
|
components: { Divider, Fa, Uploader },
|
|
171
169
|
|
|
172
|
-
inject: [
|
|
170
|
+
inject: [
|
|
171
|
+
'canAccess', 'errorHandler', 'http', 'i18n',
|
|
172
|
+
'route', 'routerErrorHandler',
|
|
173
|
+
],
|
|
173
174
|
|
|
174
175
|
emits: ['start-impersonating'],
|
|
175
176
|
|
|
@@ -206,7 +207,7 @@ export default {
|
|
|
206
207
|
: null;
|
|
207
208
|
},
|
|
208
209
|
fetch() {
|
|
209
|
-
|
|
210
|
+
this.http.get(this.route(this.$route.name, this.$route.params.user))
|
|
210
211
|
.then(response => (this.profile = response.data.user))
|
|
211
212
|
.catch(this.errorHandler);
|
|
212
213
|
},
|
|
@@ -214,7 +215,7 @@ export default {
|
|
|
214
215
|
eventBus.$emit('start-impersonating', this.profile.id);
|
|
215
216
|
},
|
|
216
217
|
updateAvatar() {
|
|
217
|
-
|
|
218
|
+
this.http.patch(this.route('core.avatars.update', this.user.avatar.id))
|
|
218
219
|
.then(({ data }) => this.setUserAvatar(data.avatarId))
|
|
219
220
|
.catch(this.errorHandler);
|
|
220
221
|
},
|