@enso-ui/users 3.0.3 → 3.0.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enso-ui/users",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "description": "Basic users package",
5
5
  "main": "bulma/index.js",
6
6
  "scripts": {
@@ -5,7 +5,7 @@
5
5
  ref="form"
6
6
  @ready="
7
7
  ready = true;
8
- pivotParams.userGroups.id = $refs.form.field('group_id').value;
8
+ pivotParams.userGroups.id = $event.form.field('group_id').value;
9
9
  ">
10
10
  <template #group_id="props">
11
11
  <form-field v-bind="props"
@@ -33,20 +33,6 @@
33
33
  v-if="!props.field.meta.hidden"/>
34
34
  </template>
35
35
  <template #actions-left>
36
- <div class="level-item"
37
- v-if="canAccess('administration.users.destroy')">
38
- <a class="button is-danger"
39
- @click="deletableUser = Number.parseInt($route.params.user, 10)"
40
- v-if="ready">
41
- <span class="is-hidden-mobile">
42
- {{ i18n('Delete') }}
43
- </span>
44
- <span class="icon">
45
- <fa icon="trash-alt"/>
46
- </span>
47
- <span class="is-hidden-mobile"/>
48
- </a>
49
- </div>
50
36
  <div class="level-item">
51
37
  <a class="button is-warning"
52
38
  @click="$router.push({
@@ -105,10 +91,6 @@
105
91
  </tab>
106
92
  </template>
107
93
  </accessories>
108
- <delete-modal :user-id="deletableUser"
109
- @close="deletableUser = null"
110
- @destroyed="navigateToIndex"
111
- v-if="!!deletableUser"/>
112
94
  </div>
113
95
  </div>
114
96
  </template>
@@ -124,7 +106,6 @@ import Accessories from '@enso-ui/accessories/bulma';
124
106
  import { Tab } from '@enso-ui/tabs/bulma';
125
107
  import { mapState } from 'vuex';
126
108
  import { PasswordStrength } from '@enso-ui/auth';
127
- import DeleteModal from './components/DeleteModal.vue';
128
109
  import Tokens from './components/Tokens.vue';
129
110
  import Sessions from './components/Sessions.vue';
130
111
 
@@ -135,7 +116,6 @@ export default {
135
116
 
136
117
  components: {
137
118
  Accessories,
138
- DeleteModal,
139
119
  EnsoForm,
140
120
  Fa,
141
121
  FormField,
@@ -153,7 +133,6 @@ export default {
153
133
  emits: ['update'],
154
134
 
155
135
  data: () => ({
156
- deletableUser: null,
157
136
  ready: false,
158
137
  pivotParams: { userGroups: { id: null } },
159
138
  password: null,
@@ -174,8 +153,6 @@ export default {
174
153
 
175
154
  methods: {
176
155
  navigateToIndex() {
177
- this.deletableUser = null;
178
-
179
156
  this.$nextTick(() => this.$router
180
157
  .push({ name: 'administration.users.index' })
181
158
  .catch(this.routerErrorHandler));
@@ -1,46 +1,21 @@
1
1
  <template>
2
2
  <div>
3
- <enso-table class="box is-paddingless raises-on-hover"
3
+ <EnsoTable class="box is-paddingless raises-on-hover"
4
4
  id="users"
5
5
  ref="table">
6
6
  <template #avatarId="{ row }">
7
7
  <avatar class="is-24x24"
8
8
  :user="row"/>
9
9
  </template>
10
- <template #destroy-button="{ icon, cssClass, row }">
11
- <a class="button is-small is-table-button ml-1"
12
- :class="cssClass"
13
- @click="deletableUser = row.id">
14
- <span class="icon is-small">
15
- <fa :icon="icon"/>
16
- </span>
17
- </a>
18
- </template>
19
- </enso-table>
20
- <delete-modal :user-id="deletableUser"
21
- @close="deletableUser = null"
22
- @destroyed="deletableUser = null; $refs.table.fetch()"
23
- v-if="!!deletableUser"/>
10
+ </EnsoTable>
24
11
  </div>
25
12
  </template>
26
13
 
27
- <script>
28
- import { FontAwesomeIcon as Fa } from '@fortawesome/vue-fontawesome';
14
+ <script setup>
15
+ import { inject } from 'vue';
29
16
  import { EnsoTable } from '@enso-ui/tables/bulma';
30
17
  import Avatar from './components/Avatar.vue';
31
- import DeleteModal from './components/DeleteModal.vue';
32
-
33
- export default {
34
- name: 'Index',
35
-
36
- components: {
37
- Avatar, DeleteModal, EnsoTable, Fa,
38
- },
39
-
40
- inject: ['canAccess', 'i18n'],
41
18
 
42
- data: () => ({
43
- deletableUser: null,
44
- }),
45
- };
19
+ const canAccess = inject('canAccess');
20
+ const i18n = inject('i18n');
46
21
  </script>
@@ -1,64 +0,0 @@
1
- <template>
2
- <modal>
3
- <div class="box">
4
- <h5 class="subtitle is-5">
5
- {{ i18n("The selected user is about to be deleted. Are you sure?") }}
6
- </h5>
7
- <hr>
8
- <div class="level">
9
- <div class="level-left"/>
10
- <div class="level-right">
11
- <div class="level-item">
12
- <button class="button is-outlined"
13
- @click="$emit('close')">
14
- {{ i18n("Cancel") }}
15
- </button>
16
- <button class="button is-danger ml-1"
17
- v-focus
18
- @click="destroy()">
19
- {{ i18n("Delete User") }}
20
- </button>
21
- <button class="button is-danger ml-1"
22
- v-focus
23
- @click="destroy(true)">
24
- {{ i18n("Delete User and Person") }}
25
- </button>
26
- </div>
27
- </div>
28
- </div>
29
- </div>
30
- </modal>
31
- </template>
32
-
33
- <script>
34
- import { focus } from '@enso-ui/directives';
35
- import { Modal } from '@enso-ui/modal/bulma';
36
-
37
- export default {
38
- name: 'DeleteModal',
39
-
40
- components: { Modal },
41
-
42
- directives: { focus },
43
-
44
- inject: ['http', 'i18n', 'errorHandler', 'route'],
45
-
46
- props: {
47
- userId: {
48
- type: Number,
49
- required: true,
50
- },
51
- },
52
-
53
- emits: ['close', 'destroyed'],
54
-
55
- methods: {
56
- destroy(person = false) {
57
- this.http.delete(this.route('administration.users.destroy', this.userId),
58
- { params: { person: !!person } })
59
- .then(({ data }) => this.$emit('destroyed', data))
60
- .catch(this.errorHandler);
61
- },
62
- },
63
- };
64
- </script>