@drax/identity-vue 0.0.20 → 0.0.22
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 -3
- package/src/combobox/PermissionCombobox.vue +2 -2
- package/src/combobox/RoleCombobox.vue +2 -2
- package/src/combobox/TenantCombobox.vue +2 -2
- package/src/components/IdentityChangeOwnPassword/IdentityChangeOwnPassword.vue +3 -3
- package/src/components/IdentityProfileAvatar/IdentityProfileAvatar.vue +1 -1
- package/src/components/IdentityProfileDrawer/IdentityProfileDrawer.vue +2 -2
- package/src/components/IdentityProfileView/IdentityProfileView.vue +1 -3
- package/src/components/PermissionSelector/PermissionSelector.vue +2 -3
- package/src/composables/useRole.ts +4 -3
- package/src/composables/useTenant.ts +3 -3
- package/src/composables/useUser.ts +1 -1
- package/src/cruds/role-crud/RoleCrud.vue +10 -6
- package/src/cruds/role-crud/RoleList.vue +9 -8
- package/src/cruds/tenant-crud/TenantCrud.vue +6 -5
- package/src/cruds/tenant-crud/TenantList.vue +8 -8
- package/src/cruds/user-crud/UserCrud.vue +10 -5
- package/src/cruds/user-crud/UserList.vue +11 -10
- package/src/forms/RoleForm.vue +3 -3
- package/src/forms/TenantForm.vue +3 -3
- package/src/forms/UserCreateForm.vue +1 -1
- package/src/forms/UserEditForm.vue +1 -1
- package/src/forms/UserPasswordForm.vue +3 -3
- package/src/stores/auth/AuthStore.ts +1 -0
- package/src/views/RoleView.vue +1 -1
- package/src/views/TenantView.vue +1 -1
- package/src/views/UserView.vue +1 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.22",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./src/index.ts",
|
|
9
9
|
"module": "./src/index.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"format": "prettier --write src/"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@drax/common-front": "^0.0.
|
|
27
|
+
"@drax/common-front": "^0.0.22",
|
|
28
28
|
"vue-i18n": "^9.13.1"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"vue-tsc": "^2.0.11",
|
|
62
62
|
"vuetify": "^3.6.4"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "2ff21dad6e1e9cc9119bf3c3095c3b291d850e53"
|
|
65
65
|
}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import {ref, onMounted, defineModel} from 'vue'
|
|
4
4
|
import type { PropType } from 'vue'
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
defineProps({
|
|
7
7
|
errorMessages: {
|
|
8
8
|
type: String as PropType<string | string[] | undefined>,
|
|
9
9
|
}
|
|
10
10
|
})
|
|
11
11
|
|
|
12
|
-
const model = defineModel()
|
|
12
|
+
const model = defineModel<any>()
|
|
13
13
|
import {useRole} from "../composables/useRole";
|
|
14
14
|
const {fetchPermissions} = useRole()
|
|
15
15
|
let items = ref([])
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import {ref, onMounted, defineModel} from 'vue'
|
|
4
4
|
import type { PropType } from 'vue'
|
|
5
|
-
|
|
5
|
+
defineProps({
|
|
6
6
|
errorMessages: {
|
|
7
7
|
type: String as PropType<string | string[] | undefined>,
|
|
8
8
|
},
|
|
@@ -16,7 +16,7 @@ const props = defineProps({
|
|
|
16
16
|
}
|
|
17
17
|
})
|
|
18
18
|
|
|
19
|
-
const model = defineModel()
|
|
19
|
+
const model = defineModel<any>()
|
|
20
20
|
import {useRole} from "../composables/useRole";
|
|
21
21
|
const {fetchRole} = useRole()
|
|
22
22
|
let items = ref([])
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import {ref, onMounted, defineModel} from 'vue'
|
|
4
4
|
import type { PropType } from 'vue'
|
|
5
|
-
|
|
5
|
+
defineProps({
|
|
6
6
|
errorMessages: {
|
|
7
7
|
type: String as PropType<string | string[] | undefined>,
|
|
8
8
|
}
|
|
9
9
|
})
|
|
10
10
|
|
|
11
|
-
const model = defineModel()
|
|
11
|
+
const model = defineModel<any>()
|
|
12
12
|
import {useTenant} from "../composables/useTenant";
|
|
13
13
|
const {fetchTenant} = useTenant()
|
|
14
14
|
let items = ref([])
|
|
@@ -83,7 +83,7 @@ async function submitChangePassowrd() {
|
|
|
83
83
|
:append-inner-icon="currentPasswordVisibility ? 'mdi-eye-off': 'mdi-eye'"
|
|
84
84
|
@click:append-inner="currentPasswordVisibility = !currentPasswordVisibility"
|
|
85
85
|
autocomplete="new-password"
|
|
86
|
-
:error-messages="$ta(inputErrors
|
|
86
|
+
:error-messages="$ta(inputErrors?.currentPassword)"
|
|
87
87
|
></v-text-field>
|
|
88
88
|
<div class="text-subtitle-1 text-medium-emphasis">{{ $t('user.newPassword') }}</div>
|
|
89
89
|
<v-text-field
|
|
@@ -96,7 +96,7 @@ async function submitChangePassowrd() {
|
|
|
96
96
|
:append-inner-icon="newPasswordVisibility ? 'mdi-eye-off': 'mdi-eye'"
|
|
97
97
|
@click:append-inner="newPasswordVisibility = !newPasswordVisibility"
|
|
98
98
|
autocomplete="new-password"
|
|
99
|
-
:error-messages="$ta(inputErrors
|
|
99
|
+
:error-messages="$ta(inputErrors?.newPassword)"
|
|
100
100
|
></v-text-field>
|
|
101
101
|
<div class="text-subtitle-1 text-medium-emphasis">{{ $t('user.confirmPassword') }}</div>
|
|
102
102
|
<v-text-field
|
|
@@ -109,7 +109,7 @@ async function submitChangePassowrd() {
|
|
|
109
109
|
:append-inner-icon="newPasswordVisibility ? 'mdi-eye-off': 'mdi-eye'"
|
|
110
110
|
@click:append-inner="newPasswordVisibility = !newPasswordVisibility"
|
|
111
111
|
autocomplete="new-password"
|
|
112
|
-
:error-messages="$ta(inputErrors
|
|
112
|
+
:error-messages="$ta(inputErrors?.confirmPassword)"
|
|
113
113
|
:rules="[confirmPasswordRule]"
|
|
114
114
|
></v-text-field>
|
|
115
115
|
</v-card-text>
|
|
@@ -5,7 +5,7 @@ import IdentityProfileView from "../IdentityProfileView/IdentityProfileView.vue"
|
|
|
5
5
|
import IdentityChangeOwnPassword from "../../components/IdentityChangeOwnPassword/IdentityChangeOwnPassword.vue";
|
|
6
6
|
|
|
7
7
|
const auth = useAuth()
|
|
8
|
-
const valueModel = defineModel()
|
|
8
|
+
const valueModel = defineModel<boolean>()
|
|
9
9
|
const profile = ref(false)
|
|
10
10
|
const changePassword = ref(false)
|
|
11
11
|
|
|
@@ -51,7 +51,7 @@ const changePassword = ref(false)
|
|
|
51
51
|
</v-list>
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
|
-
<v-dialog v-model="profile" fullscreen :on-after-leave="changePassword=false">
|
|
54
|
+
<v-dialog v-model="profile" fullscreen :on-after-leave="() => changePassword=false">
|
|
55
55
|
<v-toolbar>
|
|
56
56
|
<v-toolbar-title>
|
|
57
57
|
{{$t('user.profile')}}
|
|
@@ -3,9 +3,7 @@ import {useAuthStore} from "../../stores/auth/AuthStore.js";
|
|
|
3
3
|
import IdentityProfileAvatar from "../IdentityProfileAvatar/IdentityProfileAvatar.vue";
|
|
4
4
|
const emit = defineEmits(['click'])
|
|
5
5
|
const authStore = useAuthStore()
|
|
6
|
-
|
|
7
|
-
emit('click')
|
|
8
|
-
}
|
|
6
|
+
|
|
9
7
|
</script>
|
|
10
8
|
|
|
11
9
|
<template>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {ref, onMounted, defineModel, computed} from 'vue'
|
|
4
4
|
import type {PropType} from 'vue'
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
defineProps({
|
|
7
7
|
errorMessages: {
|
|
8
8
|
type: String as PropType<string | string[] | undefined>,
|
|
9
9
|
}
|
|
@@ -26,13 +26,12 @@ interface PermissionGroups {
|
|
|
26
26
|
const permissionGroups = computed(() => {
|
|
27
27
|
const groups = items.value.reduce((acc: PermissionGroups, permission: string) => {
|
|
28
28
|
if (permission.includes(':')) {
|
|
29
|
-
const [entity
|
|
29
|
+
const [entity] = permission.split(':');
|
|
30
30
|
if (!acc[entity]) {
|
|
31
31
|
acc[entity] = [];
|
|
32
32
|
}
|
|
33
33
|
acc[entity].push(permission);
|
|
34
34
|
} else {
|
|
35
|
-
// Si el permiso no sigue el formato entidad:acción, lo asignamos al grupo 'general'
|
|
36
35
|
const generalGroup = 'general';
|
|
37
36
|
if (!acc[generalGroup]) {
|
|
38
37
|
acc[generalGroup] = [];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {inject, ref} from "vue";
|
|
2
|
-
import
|
|
2
|
+
import {RoleSystem} from "@drax/identity-front";
|
|
3
|
+
import type {IRole, IRoleBase} from "@drax/identity-front";
|
|
3
4
|
import {ClientError} from "@drax/common-front";
|
|
4
5
|
import type { IClientInputError} from "@drax/common-front";
|
|
5
6
|
|
|
@@ -33,7 +34,7 @@ export function useRole() {
|
|
|
33
34
|
return paginatedrole
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
async function createRole(roleData:
|
|
37
|
+
async function createRole(roleData: IRoleBase) {
|
|
37
38
|
try {
|
|
38
39
|
loading.value = true
|
|
39
40
|
let role: IRole = await roleSystem.createRole(roleData)
|
|
@@ -51,7 +52,7 @@ export function useRole() {
|
|
|
51
52
|
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
async function editRole(id: string, roleData:
|
|
55
|
+
async function editRole(id: string, roleData: IRoleBase) {
|
|
55
56
|
try {
|
|
56
57
|
loading.value = true
|
|
57
58
|
let role: IRole = await roleSystem.editRole(id, roleData)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {inject, ref} from "vue";
|
|
2
|
-
import type {ITenant, TenantSystem} from "@drax/identity-front";
|
|
2
|
+
import type {ITenant, ITenantBase, TenantSystem} from "@drax/identity-front";
|
|
3
3
|
import {ClientError} from "@drax/common-front";
|
|
4
4
|
import type { IClientInputError} from "@drax/common-front";
|
|
5
5
|
|
|
@@ -26,7 +26,7 @@ export function useTenant() {
|
|
|
26
26
|
return paginatedtenant
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
async function createTenant(tenantData:
|
|
29
|
+
async function createTenant(tenantData: ITenantBase) {
|
|
30
30
|
try {
|
|
31
31
|
loading.value = true
|
|
32
32
|
let tenant: ITenant = await tenantSystem.createTenant(tenantData)
|
|
@@ -44,7 +44,7 @@ export function useTenant() {
|
|
|
44
44
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
async function editTenant(id: string, tenantData:
|
|
47
|
+
async function editTenant(id: string, tenantData: ITenantBase) {
|
|
48
48
|
try {
|
|
49
49
|
loading.value = true
|
|
50
50
|
let tenant: ITenant = await tenantSystem.editTenant(id, tenantData)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {inject, ref} from "vue";
|
|
2
|
-
import type {
|
|
2
|
+
import type {UserSystem} from "@drax/identity-front";
|
|
3
3
|
import type {IUser} from "@drax/identity-front";
|
|
4
4
|
import type {IClientInputError} from "@drax/common-front";
|
|
5
5
|
import {ClientError} from "@drax/common-front";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {computed, ref} from 'vue'
|
|
3
3
|
import RoleList from "./RoleList.vue";
|
|
4
4
|
import {useRole} from "../../composables/useRole";
|
|
5
|
-
import type {IRole} from "@drax/identity-front";
|
|
5
|
+
import type {IRole, IRoleBase} from "@drax/identity-front";
|
|
6
6
|
import RoleForm from "../../forms/RoleForm.vue";
|
|
7
7
|
import RoleView from "../../views/RoleView.vue";
|
|
8
8
|
|
|
@@ -20,7 +20,7 @@ let dialog = ref(false);
|
|
|
20
20
|
let dialogMode = ref<DialogMode>(null);
|
|
21
21
|
let dialogTitle = ref('');
|
|
22
22
|
const roleList = ref<RoleList | null>(null);
|
|
23
|
-
let form = ref<
|
|
23
|
+
let form = ref<IRoleBase>({name: "", permissions: [], childRoles:[], readonly: false})
|
|
24
24
|
let target = ref<IRole>();
|
|
25
25
|
let targetId = ref<string>('');
|
|
26
26
|
let filterEnable = ref(false);
|
|
@@ -82,10 +82,14 @@ function toCreate() {
|
|
|
82
82
|
function toEdit(item: IRole) {
|
|
83
83
|
dialogMode.value = 'edit';
|
|
84
84
|
dialogTitle.value = 'role.updating';
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
targetId.value = item.id;
|
|
86
|
+
form.value = {
|
|
87
|
+
name: item.name,
|
|
88
|
+
permissions: item.permissions,
|
|
89
|
+
childRoles: item.childRoles ? item.childRoles.map(c => c.id) : [],
|
|
90
|
+
readonly: item.readonly
|
|
91
|
+
|
|
92
|
+
}
|
|
89
93
|
dialog.value = true;
|
|
90
94
|
}
|
|
91
95
|
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
|
|
3
|
-
import {defineProps, ref} from "vue";
|
|
3
|
+
import {defineProps, type Ref, ref} from "vue";
|
|
4
4
|
import {useRole} from "../../composables/useRole";
|
|
5
5
|
import {useAuth} from "../../composables/useAuth";
|
|
6
6
|
import {useI18n} from "vue-i18n";
|
|
7
|
+
import type {IRole} from "@drax/identity-front";
|
|
7
8
|
|
|
8
9
|
const {hasPermission} = useAuth()
|
|
9
10
|
const {paginateRole} = useRole()
|
|
10
11
|
const {t} = useI18n()
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
defineProps({
|
|
13
14
|
filterEnable: {
|
|
14
15
|
type: Boolean,
|
|
15
16
|
default: false,
|
|
@@ -18,16 +19,16 @@ const props = defineProps({
|
|
|
18
19
|
|
|
19
20
|
const itemsPerPage = ref(5)
|
|
20
21
|
const page = ref(1)
|
|
21
|
-
const headers = ref([
|
|
22
|
+
const headers = ref<any>([
|
|
22
23
|
//{title: 'ID', align: 'start', sortable: false, key: 'id'},
|
|
23
|
-
{ title: t('role.name'), key: 'name', align: 'start' },
|
|
24
|
-
{ title: t('role.childRoles'), key: 'childRoles', align: 'start' },
|
|
25
|
-
{ title: t('role.permissions'), key: 'permissions', align: 'start' },
|
|
26
|
-
{ title: t('role.readonly'), key: 'readonly', align: 'start' },
|
|
24
|
+
{ title: t('role.name') as string, key: 'name', align: 'start' },
|
|
25
|
+
{ title: t('role.childRoles') as string, key: 'childRoles', align: 'start' },
|
|
26
|
+
{ title: t('role.permissions') as string, key: 'permissions', align: 'start' },
|
|
27
|
+
{ title: t('role.readonly') as string, key: 'readonly', align: 'start' },
|
|
27
28
|
{ title: '', key: 'actions', align: 'end', minWidth: '150px' },
|
|
28
29
|
])
|
|
29
30
|
|
|
30
|
-
const serverItems = ref([])
|
|
31
|
+
const serverItems: Ref<IRole[]> = ref([]);
|
|
31
32
|
const totalItems = ref(0)
|
|
32
33
|
const loading = ref(false)
|
|
33
34
|
const search = ref('')
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {computed, ref} from 'vue'
|
|
3
3
|
import TenantList from "./TenantList.vue";
|
|
4
4
|
import {useTenant} from "../../composables/useTenant";
|
|
5
|
-
import type {ITenant} from "@drax/identity-front";
|
|
5
|
+
import type {ITenant, ITenantBase} from "@drax/identity-front";
|
|
6
6
|
import TenantForm from "../../forms/TenantForm.vue";
|
|
7
7
|
import TenantView from "../../views/TenantView.vue";
|
|
8
8
|
|
|
@@ -20,7 +20,7 @@ let dialog = ref(false);
|
|
|
20
20
|
let dialogMode = ref<DialogMode>(null);
|
|
21
21
|
let dialogTitle = ref('');
|
|
22
22
|
const tenantList = ref<TenantList | null>(null);
|
|
23
|
-
let form = ref<
|
|
23
|
+
let form = ref<ITenantBase>({name: ""})
|
|
24
24
|
let target = ref<ITenant>();
|
|
25
25
|
let targetId = ref<string>('');
|
|
26
26
|
let filterEnable = ref(false);
|
|
@@ -83,9 +83,10 @@ function toEdit(item: ITenant) {
|
|
|
83
83
|
console.log('toEdit', item)
|
|
84
84
|
dialogMode.value = 'edit';
|
|
85
85
|
dialogTitle.value = 'tenant.updating';
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
targetId.value = item.id;
|
|
87
|
+
form.value = {
|
|
88
|
+
name: item.name
|
|
89
|
+
}
|
|
89
90
|
dialog.value = true;
|
|
90
91
|
}
|
|
91
92
|
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
|
|
3
|
-
import {defineProps, ref} from "vue";
|
|
3
|
+
import {defineProps, type Ref, ref} from "vue";
|
|
4
4
|
import {useTenant} from "../../composables/useTenant";
|
|
5
5
|
import {useAuth} from "../../composables/useAuth";
|
|
6
6
|
import {useI18n} from "vue-i18n";
|
|
7
|
+
import type {ITenant} from "@drax/identity-front";
|
|
7
8
|
|
|
8
9
|
const {hasPermission} = useAuth()
|
|
9
10
|
const {paginateTenant} = useTenant()
|
|
10
11
|
const {t} = useI18n()
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
defineProps({
|
|
13
14
|
filterEnable: {
|
|
14
15
|
type: Boolean,
|
|
15
16
|
default: false,
|
|
@@ -18,13 +19,12 @@ const props = defineProps({
|
|
|
18
19
|
|
|
19
20
|
const itemsPerPage = ref(5)
|
|
20
21
|
const page = ref(1)
|
|
21
|
-
const headers = ref([
|
|
22
|
-
|
|
23
|
-
{ title: t('tenant.name'), key: 'name', align: 'start' },
|
|
22
|
+
const headers = ref<any>([
|
|
23
|
+
{ title: t('tenant.name') as string, key: 'name', align: 'start' },
|
|
24
24
|
{ title: '', key: 'actions', align: 'end', minWidth: '150px' },
|
|
25
25
|
])
|
|
26
26
|
|
|
27
|
-
const serverItems = ref([])
|
|
27
|
+
const serverItems: Ref<ITenant[]> = ref([]);
|
|
28
28
|
const totalItems = ref(0)
|
|
29
29
|
const loading = ref(false)
|
|
30
30
|
const search = ref('')
|
|
@@ -80,8 +80,8 @@ defineExpose({
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
<template v-slot:item.actions="{item}" >
|
|
83
|
-
<v-btn v-if="hasPermission('tenant:update')"
|
|
84
|
-
<v-btn v-if="hasPermission('tenant:delete')"
|
|
83
|
+
<v-btn v-if="hasPermission('tenant:update')" icon="mdi-pencil" variant="text" color="primary" @click="$emit('toEdit', item)"></v-btn>
|
|
84
|
+
<v-btn v-if="hasPermission('tenant:delete')" icon="mdi-delete" class="mr-1" variant="text" color="red" @click="$emit('toDelete', item)"></v-btn>
|
|
85
85
|
</template>
|
|
86
86
|
|
|
87
87
|
</v-data-table-server>
|
|
@@ -100,11 +100,16 @@ function toEdit(item: IUser) {
|
|
|
100
100
|
actionButtonEnable.value = true
|
|
101
101
|
dialogMode.value = 'edit';
|
|
102
102
|
dialogTitle.value = 'user.updating';
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
targetId.value = item.id;
|
|
104
|
+
editForm.value = {
|
|
105
|
+
name: item.name,
|
|
106
|
+
username: item.username,
|
|
107
|
+
email: item.email,
|
|
108
|
+
phone: item.phone,
|
|
109
|
+
role: item.role.id,
|
|
110
|
+
tenant: item.tenant.id,
|
|
111
|
+
active: item.active
|
|
112
|
+
};
|
|
108
113
|
dialog.value = true;
|
|
109
114
|
}
|
|
110
115
|
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
|
|
3
|
-
import {ref, defineProps} from "vue";
|
|
3
|
+
import {ref, defineProps, type Ref} from "vue";
|
|
4
4
|
import {useUser} from "../../composables/useUser";
|
|
5
5
|
import {useAuth} from "../../composables/useAuth";
|
|
6
6
|
import {useI18n} from "vue-i18n";
|
|
7
|
+
import type {IUser} from "@drax/identity-front";
|
|
7
8
|
|
|
8
9
|
const {hasPermission} = useAuth()
|
|
9
10
|
const {paginateUser} = useUser()
|
|
10
11
|
const {t} = useI18n()
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
defineProps({
|
|
13
14
|
filterEnable: {
|
|
14
15
|
type: Boolean,
|
|
15
16
|
default: false,
|
|
@@ -18,18 +19,18 @@ const props = defineProps({
|
|
|
18
19
|
|
|
19
20
|
const itemsPerPage = ref(5)
|
|
20
21
|
const page = ref(1)
|
|
21
|
-
const headers = ref([
|
|
22
|
+
const headers = ref<any>([
|
|
22
23
|
//{title: 'ID', align: 'start', sortable: false, key: 'id'},
|
|
23
|
-
{ title: t('user.name'), key: 'name', align: 'start' },
|
|
24
|
-
{ title: t('user.username'), key: 'username', align: 'start' },
|
|
25
|
-
{ title: t('user.email'), key: 'email', align: 'start' },
|
|
26
|
-
{ title: t('user.role'), key: 'role.name', align: 'start' },
|
|
27
|
-
{ title: t('user.tenant'), key: 'tenant.name', align: 'start' },
|
|
28
|
-
{ title: t('user.active'), key: 'active', align: 'start' },
|
|
24
|
+
{ title: t('user.name') as string, key: 'name', align: 'start' },
|
|
25
|
+
{ title: t('user.username') as string, key: 'username', align: 'start' },
|
|
26
|
+
{ title: t('user.email') as string, key: 'email', align: 'start' },
|
|
27
|
+
{ title: t('user.role') as string, key: 'role.name', align: 'start' },
|
|
28
|
+
{ title: t('user.tenant') as string, key: 'tenant.name', align: 'start' },
|
|
29
|
+
{ title: t('user.active') as string, key: 'active', align: 'start' },
|
|
29
30
|
{ title: '', key: 'actions', align: 'end', fixed:true },
|
|
30
31
|
])
|
|
31
32
|
|
|
32
|
-
const serverItems = ref([])
|
|
33
|
+
const serverItems: Ref<IUser[]> = ref([]);
|
|
33
34
|
const totalItems = ref(0)
|
|
34
35
|
const loading = ref(false)
|
|
35
36
|
const search = ref('')
|
package/src/forms/RoleForm.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import {defineModel, type PropType} from "vue";
|
|
3
|
-
import type {
|
|
3
|
+
import type {IRoleBase} from "@drax/identity-front";
|
|
4
4
|
import {useI18nValidation} from "../composables/useI18nValidation";
|
|
5
5
|
import type {IClientInputError} from "@drax/common-front";
|
|
6
6
|
import PermissionSelector from "../components/PermissionSelector/PermissionSelector.vue";
|
|
@@ -8,14 +8,14 @@ import RoleCombobox from "../combobox/RoleCombobox.vue";
|
|
|
8
8
|
|
|
9
9
|
const {$ta} = useI18nValidation()
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
defineProps({
|
|
12
12
|
inputErrors: {
|
|
13
13
|
type: Object as PropType<IClientInputError>,
|
|
14
14
|
default: () => ({name: "", permissions: "", readonly: ""})
|
|
15
15
|
}
|
|
16
16
|
})
|
|
17
17
|
|
|
18
|
-
const form = defineModel<
|
|
18
|
+
const form = defineModel<IRoleBase>({
|
|
19
19
|
type: Object,
|
|
20
20
|
default: () => ({name: "", permissions: [], readonly: false})
|
|
21
21
|
})
|
package/src/forms/TenantForm.vue
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import {defineModel, type PropType} from "vue";
|
|
3
|
-
import type {
|
|
3
|
+
import type {ITenantBase} from "@drax/identity-front";
|
|
4
4
|
import {useI18nValidation} from "../composables/useI18nValidation";
|
|
5
5
|
import type {IClientInputError} from "@drax/common-front";
|
|
6
6
|
|
|
7
7
|
const {$ta} = useI18nValidation()
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
defineProps({
|
|
10
10
|
inputErrors: {
|
|
11
11
|
type: Object as PropType<IClientInputError>,
|
|
12
12
|
default: () => ({name: ""})
|
|
13
13
|
}
|
|
14
14
|
})
|
|
15
15
|
|
|
16
|
-
const form = defineModel<
|
|
16
|
+
const form = defineModel<ITenantBase>({
|
|
17
17
|
type: Object,
|
|
18
18
|
default: () => ({name: ""})
|
|
19
19
|
})
|
|
@@ -8,7 +8,7 @@ import {useI18nValidation} from "../composables/useI18nValidation";
|
|
|
8
8
|
|
|
9
9
|
const {$ta} = useI18nValidation()
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
defineProps({
|
|
12
12
|
inputErrors: {
|
|
13
13
|
type: Object as PropType<IClientInputError>,
|
|
14
14
|
default: () => ({name: "", username: "", password: "", email: "", phone: "", role: "", tenant: "", active: ""})
|
|
@@ -7,7 +7,7 @@ import type {IUserUpdate} from "@drax/identity-front/src/interfaces/IUser";
|
|
|
7
7
|
import {useI18nValidation} from "../composables/useI18nValidation";
|
|
8
8
|
const {$ta} = useI18nValidation()
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
defineProps({
|
|
11
11
|
inputErrors: {
|
|
12
12
|
type: Object as PropType<IClientInputError>,
|
|
13
13
|
default: () => ({name: "", username: "", email: "", phone: "", role: "", tenant: "", active: ""})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {ref, defineModel, type PropType
|
|
2
|
+
import {ref, defineModel, type PropType} from "vue";
|
|
3
3
|
import type {IClientInputError} from "@drax/common-front";
|
|
4
|
-
import type {
|
|
4
|
+
import type {IUserPassword} from "@drax/identity-front";
|
|
5
5
|
import {useI18nValidation} from "../composables/useI18nValidation";
|
|
6
6
|
import {useI18n} from "vue-i18n";
|
|
7
7
|
|
|
@@ -11,7 +11,7 @@ const {$ta} = useI18nValidation()
|
|
|
11
11
|
let newPasswordVisibility = ref(false)
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
defineProps({
|
|
15
15
|
inputErrors: {
|
|
16
16
|
type: Object as PropType<IClientInputError>,
|
|
17
17
|
default: () => ({id: "", newPassword: ""})
|
package/src/views/RoleView.vue
CHANGED
package/src/views/TenantView.vue
CHANGED
package/src/views/UserView.vue
CHANGED
|
@@ -3,7 +3,7 @@ import type {PropType} from "vue";
|
|
|
3
3
|
import type {IUser} from "@drax/identity-front";
|
|
4
4
|
import IdentityProfileAvatar from "../components/IdentityProfileAvatar/IdentityProfileAvatar.vue";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
defineProps({
|
|
7
7
|
user:{
|
|
8
8
|
type: Object as PropType<IUser>,
|
|
9
9
|
required: true,
|