@drax/identity-vue 0.33.0 → 0.34.1
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 +8 -8
- package/src/components/IdentityProfileAvatar/IdentityProfileAvatar.vue +1 -1
- package/src/components/IdentityProfileView/IdentityProfileView.vue +1 -1
- package/src/components/PermissionSelector/PermissionSelector.vue +58 -33
- package/src/components/SwitchTenant/SwitchTenant.vue +1 -1
- package/src/composables/useAuth.ts +1 -1
- package/src/cruds/role-crud/RoleCrud.ts +8 -0
- package/src/cruds/role-crud/RoleForm.vue +18 -2
- package/src/cruds/tenant-crud/TenantCrud.ts +8 -0
- package/src/cruds/user-api-key-crud/UserApiKeyCrud.ts +8 -0
- package/src/cruds/user-crud/UserCrud.ts +19 -9
- package/src/cruds/user-crud/UserForm.vue +22 -8
- package/src/index.ts +3 -1
- package/src/pages/crud/RoleCrudPage.vue +4 -4
- package/src/pages/crud/TenantCrudPage.vue +3 -2
- package/src/pages/crud/UserApiKeyCrudPage.vue +4 -3
- package/src/pages/crud/UserCrudPage.vue +5 -4
- package/src/stores/IdentityCrudStore.ts +36 -0
- /package/src/stores/{auth/AuthStore.ts → AuthStore.ts} +0 -0
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.34.1",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./src/index.ts",
|
|
9
9
|
"module": "./src/index.ts",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"format": "prettier --write src/"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@drax/common-front": "^0.
|
|
28
|
-
"@drax/common-vue": "^0.
|
|
29
|
-
"@drax/crud-front": "^0.
|
|
30
|
-
"@drax/crud-share": "^0.
|
|
31
|
-
"@drax/crud-vue": "^0.
|
|
32
|
-
"@drax/identity-share": "^0.
|
|
27
|
+
"@drax/common-front": "^0.34.0",
|
|
28
|
+
"@drax/common-vue": "^0.34.0",
|
|
29
|
+
"@drax/crud-front": "^0.34.0",
|
|
30
|
+
"@drax/crud-share": "^0.34.0",
|
|
31
|
+
"@drax/crud-vue": "^0.34.0",
|
|
32
|
+
"@drax/identity-share": "^0.34.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"pinia": "^2.2.2",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"vue-tsc": "^2.1.6",
|
|
67
67
|
"vuetify": "^3.7.1"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "5c31e02383f5be9e2b647eff89bea7f33f461caa"
|
|
70
70
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {useAuthStore} from "../../stores/
|
|
2
|
+
import {useAuthStore} from "../../stores/AuthStore";
|
|
3
3
|
import IdentityProfileAvatarEdit from "../IdentityProfileAvatarEdit/IdentityProfileAvatarEdit.vue";
|
|
4
4
|
import {useI18n} from "vue-i18n";
|
|
5
5
|
defineEmits(['click'])
|
|
@@ -3,21 +3,39 @@
|
|
|
3
3
|
import {ref, onMounted, defineModel, computed} from 'vue'
|
|
4
4
|
import type {PropType} from 'vue'
|
|
5
5
|
import {useI18n} from "vue-i18n";
|
|
6
|
-
|
|
6
|
+
import { useTheme } from 'vuetify'
|
|
7
|
+
const {t, te} = useI18n()
|
|
7
8
|
|
|
8
9
|
defineProps({
|
|
9
10
|
errorMessages: {type: String as PropType<string | string[] | undefined>,},
|
|
10
11
|
readonly: {type: Boolean, default: false},
|
|
11
12
|
})
|
|
12
13
|
|
|
14
|
+
const theme = useTheme()
|
|
15
|
+
|
|
16
|
+
function hasCustomColor(colorName: string) {
|
|
17
|
+
return colorName in theme.current.value.colors
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let enableColor = ref(hasCustomColor('enable') ? 'enable' : 'green-darken-3')
|
|
21
|
+
|
|
22
|
+
|
|
13
23
|
const model = defineModel()
|
|
14
24
|
import {useRole} from "../../composables/useRole";
|
|
15
25
|
|
|
16
26
|
const {fetchPermissions} = useRole()
|
|
17
27
|
let items = ref([])
|
|
28
|
+
let loading = ref(false)
|
|
29
|
+
|
|
30
|
+
async function sleep(ms: number) {
|
|
31
|
+
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
32
|
+
}
|
|
18
33
|
|
|
19
34
|
onMounted(async () => {
|
|
35
|
+
loading.value = true
|
|
36
|
+
await sleep(1000) // simulate network delay
|
|
20
37
|
items.value = await fetchPermissions()
|
|
38
|
+
loading.value = false
|
|
21
39
|
})
|
|
22
40
|
|
|
23
41
|
interface PermissionGroups {
|
|
@@ -49,39 +67,46 @@ const permissionGroups = computed(() => {
|
|
|
49
67
|
</script>
|
|
50
68
|
|
|
51
69
|
<template>
|
|
52
|
-
<v-sheet
|
|
53
|
-
<h5 class="text-h5 mb-2">{{te('permission.permissions') ? t('permission.permissions') : 'Permissions'}}</h5>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
<v-sheet class="pa-2">
|
|
71
|
+
<h5 class="text-h5 mb-2">{{ te('permission.permissions') ? t('permission.permissions') : 'Permissions' }}</h5>
|
|
72
|
+
<v-skeleton-loader
|
|
73
|
+
:loading="loading"
|
|
74
|
+
height="340"
|
|
75
|
+
type="list-item-two-line, list-item-two-line, list-item-two-line, list-item-two-line, list-item-two-line"
|
|
76
|
+
>
|
|
77
|
+
|
|
78
|
+
<v-item-group
|
|
79
|
+
v-model="model"
|
|
80
|
+
variant="outlined"
|
|
81
|
+
divided
|
|
82
|
+
multiple
|
|
83
|
+
color="green"
|
|
84
|
+
>
|
|
85
|
+
<template v-for="(permissions, entity) in permissionGroups" :key="entity">
|
|
86
|
+
<v-card class="mb-2" variant="outlined">
|
|
87
|
+
<v-card-title class="text-capitalize">
|
|
88
|
+
{{ t ? t('permission.' + entity) : entity }}
|
|
89
|
+
</v-card-title>
|
|
90
|
+
<v-card-text>
|
|
91
|
+
<v-item
|
|
92
|
+
v-for="permission in permissions"
|
|
93
|
+
v-slot="{ isSelected, toggle }"
|
|
94
|
+
:value="permission" :disabled="readonly"
|
|
95
|
+
>
|
|
96
|
+
|
|
97
|
+
<v-btn
|
|
98
|
+
:color="isSelected? enableColor : 'grey-darken-3'" :readonly="readonly"
|
|
99
|
+
@click="toggle" variant="flat" :rounded="false" border
|
|
100
|
+
>
|
|
101
|
+
{{ te('permission.' + permission) ? t('permission.' + permission) : permission }}
|
|
102
|
+
</v-btn>
|
|
103
|
+
</v-item>
|
|
104
|
+
</v-card-text>
|
|
105
|
+
</v-card>
|
|
106
|
+
</template>
|
|
107
|
+
</v-item-group>
|
|
84
108
|
|
|
109
|
+
</v-skeleton-loader>
|
|
85
110
|
</v-sheet>
|
|
86
111
|
</template>
|
|
87
112
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {ref} from "vue"
|
|
3
3
|
import TenantCombobox from "../../combobox/TenantCombobox.vue";
|
|
4
4
|
import {useAuth} from "../../composables/useAuth"
|
|
5
|
-
import {useAuthStore} from "../../stores/
|
|
5
|
+
import {useAuthStore} from "../../stores/AuthStore"
|
|
6
6
|
import {useI18n} from "vue-i18n"
|
|
7
7
|
|
|
8
8
|
const authStore = useAuthStore()
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import {useFormUtils, useCrudStore} from "@drax/crud-vue";
|
|
3
|
-
import {defineEmits, defineModel, ref} from "vue";
|
|
3
|
+
import {computed, defineEmits, defineModel, ref} from "vue";
|
|
4
4
|
import {useI18nValidation} from "@drax/common-vue";
|
|
5
5
|
import PermissionSelector from "../../components/PermissionSelector/PermissionSelector.vue";
|
|
6
6
|
import RoleCombobox from "../../combobox/RoleCombobox.vue";
|
|
7
|
+
import {useIdentityCrudStore} from "../../stores/IdentityCrudStore";
|
|
7
8
|
import {useI18n} from "vue-i18n";
|
|
8
9
|
|
|
9
10
|
const {$ta} = useI18nValidation()
|
|
@@ -14,6 +15,8 @@ const valueModel = defineModel({type: [Object]})
|
|
|
14
15
|
const emit = defineEmits(['submit', 'cancel'])
|
|
15
16
|
|
|
16
17
|
const store = useCrudStore()
|
|
18
|
+
const identityCrudStore = useIdentityCrudStore()
|
|
19
|
+
const entity = identityCrudStore.roleCrud
|
|
17
20
|
|
|
18
21
|
const valid = ref()
|
|
19
22
|
const formRef = ref()
|
|
@@ -33,8 +36,21 @@ function cancel() {
|
|
|
33
36
|
emit('cancel')
|
|
34
37
|
}
|
|
35
38
|
|
|
39
|
+
const variant = computed(() => {
|
|
40
|
+
if (store.operation === 'create') {
|
|
41
|
+
return entity.inputVariantCreate
|
|
42
|
+
} else if (store.operation === 'edit') {
|
|
43
|
+
return entity.inputVariantEdit
|
|
44
|
+
} else if (store.operation === 'delete') {
|
|
45
|
+
return entity.inputVariantDelete
|
|
46
|
+
} else if (store.operation === 'view') {
|
|
47
|
+
return entity.inputVariantView
|
|
48
|
+
}
|
|
49
|
+
return 'outlined'
|
|
50
|
+
})
|
|
51
|
+
|
|
36
52
|
const {
|
|
37
|
-
|
|
53
|
+
submitColor, readonly
|
|
38
54
|
} = useFormUtils(store.operation)
|
|
39
55
|
|
|
40
56
|
</script>
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
import {EntityCrud} from "@drax/crud-vue";
|
|
4
2
|
import {UserSystemFactory} from "@drax/identity-front";
|
|
5
3
|
import {RoleCrud} from '../role-crud/RoleCrud'
|
|
6
4
|
import {TenantCrud} from '../tenant-crud/TenantCrud'
|
|
7
|
-
import {useAuthStore} from '../../stores/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import {useAuthStore} from '../../stores/AuthStore'
|
|
11
6
|
|
|
12
7
|
import type {
|
|
13
8
|
IEntityCrud,
|
|
@@ -17,7 +12,6 @@ import type {
|
|
|
17
12
|
IEntityCrudRefs
|
|
18
13
|
} from "@drax/crud-share";
|
|
19
14
|
|
|
20
|
-
|
|
21
15
|
class UserCrud extends EntityCrud implements IEntityCrud {
|
|
22
16
|
|
|
23
17
|
static singleton: UserCrud
|
|
@@ -46,7 +40,6 @@ class UserCrud extends EntityCrud implements IEntityCrud {
|
|
|
46
40
|
|
|
47
41
|
get headers():IEntityCrudHeader[] {
|
|
48
42
|
return [
|
|
49
|
-
//{title: 'id',key:'_id', align: 'start'},
|
|
50
43
|
{ title: 'name', key: 'name', align: 'start' },
|
|
51
44
|
{ title: 'username', key: 'username', align: 'start' },
|
|
52
45
|
{ title: 'email', key: 'email', align: 'start' },
|
|
@@ -118,13 +111,30 @@ class UserCrud extends EntityCrud implements IEntityCrud {
|
|
|
118
111
|
|
|
119
112
|
isItemEditable(item?:any) {
|
|
120
113
|
const authStore = useAuthStore()
|
|
121
|
-
if(authStore?.authUser?.role?.childRoles){
|
|
114
|
+
if(authStore?.authUser?.role?.childRoles && authStore?.authUser?.role?.childRoles.length > 0){
|
|
122
115
|
return authStore.authUser.role.childRoles.some(role => role.name === item.role.name)
|
|
123
116
|
}else{
|
|
124
117
|
return true
|
|
125
118
|
}
|
|
126
119
|
}
|
|
127
120
|
|
|
121
|
+
isItemDeletable(item?:any) {
|
|
122
|
+
const authStore = useAuthStore()
|
|
123
|
+
if(authStore?.authUser?.role?.childRoles && authStore?.authUser?.role?.childRoles.length > 0){
|
|
124
|
+
return authStore.authUser.role.childRoles.some(role => role.name === item.role.name)
|
|
125
|
+
}else{
|
|
126
|
+
return true
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
get searchEnable() {
|
|
131
|
+
return true
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
get filterButtons() {
|
|
135
|
+
return false
|
|
136
|
+
}
|
|
137
|
+
|
|
128
138
|
}
|
|
129
139
|
|
|
130
140
|
export default UserCrud
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import {useFormUtils, useCrudStore} from "@drax/crud-vue";
|
|
3
|
-
import {defineEmits, defineModel,
|
|
3
|
+
import {computed, defineEmits, defineModel, ref} from "vue";
|
|
4
4
|
import {useI18nValidation} from "@drax/common-vue";
|
|
5
5
|
import RoleCombobox from "../../combobox/RoleCombobox.vue";
|
|
6
6
|
import TenantCombobox from "../../combobox/TenantCombobox.vue";
|
|
7
7
|
import {useAuth} from "../../composables/useAuth";
|
|
8
8
|
import {useI18n} from "vue-i18n";
|
|
9
|
-
import
|
|
9
|
+
import {useIdentityCrudStore} from "../../stores/IdentityCrudStore";
|
|
10
10
|
|
|
11
11
|
const {$ta} = useI18nValidation()
|
|
12
12
|
const {t, te} = useI18n()
|
|
13
13
|
|
|
14
14
|
const {hasPermission} = useAuth()
|
|
15
15
|
|
|
16
|
-
const {operation} = defineProps({
|
|
17
|
-
operation: {type: String as PropType<IEntityCrudOperation>, required: true},
|
|
18
|
-
enablePassword: {type: Boolean, default: false}
|
|
19
|
-
})
|
|
20
16
|
|
|
21
17
|
const valueModel = defineModel({type: [Object]})
|
|
22
18
|
|
|
23
19
|
const emit = defineEmits(['submit', 'cancel'])
|
|
24
20
|
|
|
25
21
|
const store = useCrudStore()
|
|
22
|
+
const enablePassword = store.operation === 'create'
|
|
23
|
+
|
|
24
|
+
const identityCrudStore = useIdentityCrudStore()
|
|
25
|
+
const entity = identityCrudStore.userCrud
|
|
26
26
|
|
|
27
27
|
const valid = ref()
|
|
28
28
|
const formRef = ref()
|
|
@@ -31,7 +31,7 @@ const formRef = ref()
|
|
|
31
31
|
async function submit() {
|
|
32
32
|
store.resetErrors()
|
|
33
33
|
|
|
34
|
-
if(operation === 'delete') {
|
|
34
|
+
if(store.operation === 'delete') {
|
|
35
35
|
emit('submit',valueModel.value)
|
|
36
36
|
return
|
|
37
37
|
}
|
|
@@ -49,10 +49,24 @@ function cancel() {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
const {
|
|
52
|
-
|
|
52
|
+
submitColor, readonly
|
|
53
53
|
} = useFormUtils(store.operation)
|
|
54
54
|
|
|
55
55
|
|
|
56
|
+
const variant = computed(() => {
|
|
57
|
+
if (store.operation === 'create') {
|
|
58
|
+
return entity.inputVariantCreate
|
|
59
|
+
} else if (store.operation === 'edit') {
|
|
60
|
+
return entity.inputVariantEdit
|
|
61
|
+
} else if (store.operation === 'delete') {
|
|
62
|
+
return entity.inputVariantDelete
|
|
63
|
+
} else if (store.operation === 'view') {
|
|
64
|
+
return entity.inputVariantView
|
|
65
|
+
}
|
|
66
|
+
return 'outlined'
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
|
|
56
70
|
let passwordVisibility = ref(false)
|
|
57
71
|
|
|
58
72
|
</script>
|
package/src/index.ts
CHANGED
|
@@ -38,7 +38,8 @@ import RoleCrud from "./cruds/role-crud/RoleCrud"
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
import {useAuthStore} from "./stores/
|
|
41
|
+
import {useAuthStore} from "./stores/AuthStore.js";
|
|
42
|
+
import {useIdentityCrudStore} from "./stores/IdentityCrudStore.js";
|
|
42
43
|
|
|
43
44
|
import IdentityAuthRoutes from "./routes/IdentityAuthRoutes.js";
|
|
44
45
|
import IdentityCrudRoutes from "./routes/IdentityCrudRoutes.js";
|
|
@@ -92,6 +93,7 @@ export {
|
|
|
92
93
|
|
|
93
94
|
//Stores
|
|
94
95
|
useAuthStore,
|
|
96
|
+
useIdentityCrudStore,
|
|
95
97
|
|
|
96
98
|
//Routes
|
|
97
99
|
IdentityCrudRoutes,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import {Crud, useCrud} from "@drax/crud-vue";
|
|
3
|
-
import RoleCrud from "../../cruds/role-crud/RoleCrud";
|
|
4
3
|
import RoleForm from "../../cruds/role-crud/RoleForm.vue";
|
|
5
4
|
import {useI18n} from "vue-i18n";
|
|
6
|
-
|
|
5
|
+
import {useIdentityCrudStore} from "../../stores/IdentityCrudStore"
|
|
6
|
+
const identityCrudStore = useIdentityCrudStore();
|
|
7
7
|
const {t, te} = useI18n()
|
|
8
8
|
|
|
9
9
|
const {
|
|
10
10
|
onCancel, onSubmit,form
|
|
11
|
-
} = useCrud(
|
|
11
|
+
} = useCrud(identityCrudStore.roleCrud);
|
|
12
12
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<template>
|
|
16
|
-
<crud :entity="
|
|
16
|
+
<crud :entity="identityCrudStore.roleCrud">
|
|
17
17
|
|
|
18
18
|
<template v-slot:form>
|
|
19
19
|
<role-form
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import {useIdentityCrudStore} from "../../stores/IdentityCrudStore"
|
|
3
|
+
const identityCrudStore = useIdentityCrudStore();
|
|
3
4
|
import {Crud} from "@drax/crud-vue";
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
7
|
<template>
|
|
7
|
-
<crud :entity="
|
|
8
|
+
<crud :entity="identityCrudStore.tenantCrud">
|
|
8
9
|
|
|
9
10
|
</crud>
|
|
10
11
|
</template>
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
|
|
3
|
-
import UserApiKeyCrud from "../../cruds/user-api-key-crud/UserApiKeyCrud";
|
|
4
3
|
import UserApiKeyForm from "../../cruds/user-api-key-crud/UserApiKeyForm.vue";
|
|
5
4
|
import {Crud, useCrud} from "@drax/crud-vue";
|
|
6
5
|
import type {IUserApiKey} from "@drax/identity-share";
|
|
7
6
|
import {formatDateTime} from "@drax/common-front";
|
|
8
7
|
import UserApiKeyCreated from "../../cruds/user-api-key-crud/UserApiKeyCreated.vue";
|
|
9
8
|
import {ref} from "vue";
|
|
9
|
+
import {useIdentityCrudStore} from "../../stores/IdentityCrudStore"
|
|
10
|
+
const identityCrudStore = useIdentityCrudStore();
|
|
10
11
|
|
|
11
12
|
const {
|
|
12
13
|
onCancel, onSubmit,form
|
|
13
|
-
} = useCrud(
|
|
14
|
+
} = useCrud(identityCrudStore.userApiKeyCrud);
|
|
14
15
|
|
|
15
16
|
const userApiKeyCreated = ref<IUserApiKey>();
|
|
16
17
|
const userApiKeyCreatedDialog = ref<boolean>(false);
|
|
@@ -37,7 +38,7 @@ function onCreated(item:IUserApiKey) {
|
|
|
37
38
|
v-model="userApiKeyCreatedDialog"
|
|
38
39
|
/>
|
|
39
40
|
|
|
40
|
-
<crud :entity="
|
|
41
|
+
<crud :entity="identityCrudStore.userApiKeyCrud" @created="onCreated">
|
|
41
42
|
|
|
42
43
|
<template v-slot:form>
|
|
43
44
|
<user-api-key-form
|
|
@@ -7,8 +7,11 @@ import UserForm from "../../cruds/user-crud/UserForm.vue";
|
|
|
7
7
|
import PasswordUpdateButton from "../../cruds/user-crud/PasswordUpdateButton.vue";
|
|
8
8
|
import UserPasswordDialog from "../../cruds/user-crud/UserPasswordDialog.vue";
|
|
9
9
|
import type {IUser} from "@drax/identity-share";
|
|
10
|
+
import {useIdentityCrudStore} from "../../stores/IdentityCrudStore"
|
|
10
11
|
|
|
11
|
-
const
|
|
12
|
+
const identityCrudStore = useIdentityCrudStore();
|
|
13
|
+
|
|
14
|
+
const {onCancel, onSubmit, form } = useCrud(UserCrud.instance);
|
|
12
15
|
|
|
13
16
|
const dialogPassword = ref(false);
|
|
14
17
|
const userSelected = ref();
|
|
@@ -31,12 +34,10 @@ function onChangePassword(user:IUser){
|
|
|
31
34
|
:user="userSelected"
|
|
32
35
|
/>
|
|
33
36
|
|
|
34
|
-
<crud :entity="
|
|
37
|
+
<crud :entity="identityCrudStore.userCrud">
|
|
35
38
|
|
|
36
39
|
<template v-slot:form>
|
|
37
40
|
<user-form
|
|
38
|
-
:enable-password="operation === 'create'"
|
|
39
|
-
:operation="operation"
|
|
40
41
|
v-model="form"
|
|
41
42
|
@submit="onSubmit"
|
|
42
43
|
@cancel="onCancel"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Utilities
|
|
2
|
+
import { defineStore } from 'pinia'
|
|
3
|
+
import UserCrud from "../cruds/user-crud/UserCrud";
|
|
4
|
+
import UserApiKeyCrud from "../cruds/user-api-key-crud/UserApiKeyCrud";
|
|
5
|
+
import RoleCrud from "../cruds/role-crud/RoleCrud";
|
|
6
|
+
import TenantCrud from "../cruds/tenant-crud/TenantCrud";
|
|
7
|
+
import type {IEntityCrud} from "@drax/crud-share";
|
|
8
|
+
|
|
9
|
+
export const useIdentityCrudStore = defineStore('IdentityCrudStore', {
|
|
10
|
+
state: (): {
|
|
11
|
+
userCrud: IEntityCrud;
|
|
12
|
+
userApiKeyCrud: IEntityCrud;
|
|
13
|
+
roleCrud: IEntityCrud;
|
|
14
|
+
tenantCrud: IEntityCrud;
|
|
15
|
+
} => ({
|
|
16
|
+
userCrud: UserCrud.instance,
|
|
17
|
+
userApiKeyCrud: UserApiKeyCrud.instance,
|
|
18
|
+
roleCrud: RoleCrud.instance,
|
|
19
|
+
tenantCrud: TenantCrud.instance,
|
|
20
|
+
}),
|
|
21
|
+
actions:{
|
|
22
|
+
setUserCrud(userCrud: IEntityCrud){
|
|
23
|
+
this.userCrud = userCrud
|
|
24
|
+
},
|
|
25
|
+
setUserApiKeyCrud(userApiKeyCrud: IEntityCrud){
|
|
26
|
+
this.userApiKeyCrud = userApiKeyCrud
|
|
27
|
+
},
|
|
28
|
+
setRoleCrud(roleCrud:IEntityCrud){
|
|
29
|
+
this.roleCrud = roleCrud
|
|
30
|
+
},
|
|
31
|
+
setTenantCrud(tenantCrud:IEntityCrud){
|
|
32
|
+
this.tenantCrud = tenantCrud
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
})
|
|
File without changes
|