@drax/identity-vue 0.4.0 → 0.5.2

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
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.4.0",
6
+ "version": "0.5.2",
7
7
  "type": "module",
8
8
  "main": "./src/index.ts",
9
9
  "module": "./src/index.ts",
@@ -24,10 +24,10 @@
24
24
  "format": "prettier --write src/"
25
25
  },
26
26
  "dependencies": {
27
- "@drax/common-front": "^0.4.0",
28
- "@drax/common-share": "^0.4.0",
29
- "@drax/common-vue": "^0.4.0",
30
- "@drax/identity-share": "^0.4.0"
27
+ "@drax/common-front": "^0.5.1",
28
+ "@drax/common-vue": "^0.5.1",
29
+ "@drax/crud-share": "^0.5.2",
30
+ "@drax/identity-share": "^0.5.1"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "pinia": "^2.2.2",
@@ -64,5 +64,5 @@
64
64
  "vue-tsc": "^2.1.6",
65
65
  "vuetify": "^3.7.1"
66
66
  },
67
- "gitHead": "481b302fe72f403abf092806ceca540dd2765dfa"
67
+ "gitHead": "6f854dbeb2af7bca32ed35bcec2f8e48790a73b9"
68
68
  }
@@ -2,6 +2,8 @@
2
2
 
3
3
  import {ref, onMounted, defineModel} from 'vue'
4
4
  import type { PropType } from 'vue'
5
+ import {useI18n} from "vue-i18n";
6
+ const {t} = useI18n()
5
7
  defineProps({
6
8
  errorMessages: {
7
9
  type: String as PropType<string | string[] | undefined>,
@@ -27,7 +29,7 @@ onMounted(async () => {
27
29
  <template>
28
30
  <v-select
29
31
  v-model="model"
30
- :label="$t ? $t('tenant.entity') : 'Tenant'"
32
+ :label="t ? t('tenant.entity') : 'Tenant'"
31
33
  :items="items"
32
34
  item-title="name"
33
35
  item-value="id"
@@ -6,7 +6,7 @@ import type {IClientInputError} from "@drax/common-front";
6
6
  import {useI18nValidation} from "@drax/common-vue";
7
7
  import {useI18n} from "vue-i18n";
8
8
 
9
- const {t} = useI18n()
9
+ const {t,te} = useI18n()
10
10
  const {$ta} = useI18nValidation()
11
11
 
12
12
  const {changeOwnPassword} = useAuth()
@@ -57,7 +57,7 @@ async function submitChangePassowrd() {
57
57
 
58
58
  <template v-if="changed">
59
59
  <v-alert type="success">
60
- {{ $t('user.passwordChanged') }}
60
+ {{ t('user.passwordChanged') }}
61
61
  </v-alert>
62
62
  </template>
63
63
 
@@ -65,14 +65,14 @@ async function submitChangePassowrd() {
65
65
 
66
66
  <v-form @submit.prevent="submitChangePassowrd">
67
67
  <v-card variant="elevated">
68
- <v-card-title class="pa-4 text-center">{{ $t('user.changeOwnPassword') }}</v-card-title>
68
+ <v-card-title class="pa-4 text-center">{{ t('user.changeOwnPassword') }}</v-card-title>
69
69
  <v-card-text v-if="errorMsg">
70
70
  <v-alert type="error">
71
- {{ $t ? $t(errorMsg) : errorMsg }}
71
+ {{ te(errorMsg) ?t(errorMsg) : errorMsg }}
72
72
  </v-alert>
73
73
  </v-card-text>
74
74
  <v-card-text>
75
- <div class="text-subtitle-1 text-medium-emphasis">{{ $t('user.currentPassword') }}</div>
75
+ <div class="text-subtitle-1 text-medium-emphasis">{{ t('user.currentPassword') }}</div>
76
76
  <v-text-field
77
77
  variant="outlined"
78
78
  id="current-password-input"
@@ -85,7 +85,7 @@ async function submitChangePassowrd() {
85
85
  autocomplete="new-password"
86
86
  :error-messages="$ta(inputErrors?.currentPassword)"
87
87
  ></v-text-field>
88
- <div class="text-subtitle-1 text-medium-emphasis">{{ $t('user.newPassword') }}</div>
88
+ <div class="text-subtitle-1 text-medium-emphasis">{{ t('user.newPassword') }}</div>
89
89
  <v-text-field
90
90
  variant="outlined"
91
91
  id="new-password-input"
@@ -98,7 +98,7 @@ async function submitChangePassowrd() {
98
98
  autocomplete="new-password"
99
99
  :error-messages="$ta(inputErrors?.newPassword)"
100
100
  ></v-text-field>
101
- <div class="text-subtitle-1 text-medium-emphasis">{{ $t('user.confirmPassword') }}</div>
101
+ <div class="text-subtitle-1 text-medium-emphasis">{{ t('user.confirmPassword') }}</div>
102
102
  <v-text-field
103
103
  variant="outlined"
104
104
  id="confirm-password-input"
@@ -125,7 +125,7 @@ async function submitChangePassowrd() {
125
125
  block
126
126
  :disabled="!isFormValid"
127
127
  >
128
- {{ $t('action.sent') }}
128
+ {{ t('action.sent') }}
129
129
  </v-btn>
130
130
  </v-card-actions>
131
131
  </v-card>
@@ -2,6 +2,8 @@
2
2
  import {computed, ref, defineEmits} from 'vue'
3
3
  import {useAuth} from '../../composables/useAuth.js'
4
4
  import IdentityProfileView from "../IdentityProfileView/IdentityProfileView.vue";
5
+ import {useI18n} from "vue-i18n";
6
+ const {t, te} = useI18n()
5
7
 
6
8
  const {login, isAuthenticated} = useAuth()
7
9
 
@@ -50,14 +52,14 @@ function togglePasswordVisibility() {
50
52
 
51
53
  <v-form @submit.prevent="submitLogin">
52
54
  <v-card variant="elevated" class="pa-6">
53
- <v-card-title class="pa-4 text-center">{{ $t ? $t('auth.signIn') : 'Sign In' }}</v-card-title>
55
+ <v-card-title class="pa-4 text-center">{{ te('auth.signIn') ? t('auth.signIn') : 'Sign In' }}</v-card-title>
54
56
  <v-card-text v-if="authError">
55
57
  <v-alert type="error">
56
- {{ $t ? $t(authError) : authError }}
58
+ {{te(authError) ? t(authError) : authError }}
57
59
  </v-alert>
58
60
  </v-card-text>
59
61
  <v-card-text>
60
- <div class="text-subtitle-1 text-medium-emphasis">{{ $t ? $t('auth.username') : 'Username' }}</div>
62
+ <div class="text-subtitle-1 text-medium-emphasis">{{ te('auth.username') ? t('auth.username') : 'Username' }}</div>
61
63
  <v-text-field
62
64
  variant="outlined"
63
65
  id="username-input"
@@ -66,7 +68,7 @@ function togglePasswordVisibility() {
66
68
  required
67
69
  autocomplete="new-username"
68
70
  ></v-text-field>
69
- <div class="text-subtitle-1 text-medium-emphasis">{{ $t ? $t('auth.password') : 'Password' }}</div>
71
+ <div class="text-subtitle-1 text-medium-emphasis">{{ te('auth.password') ? t('auth.password') : 'Password' }}</div>
70
72
  <v-text-field
71
73
  variant="outlined"
72
74
  id="password-input"
@@ -92,7 +94,7 @@ function togglePasswordVisibility() {
92
94
  :disabled="!isFormValid"
93
95
  :loading="loading"
94
96
  >
95
- {{ $t ? $t('auth.login') : 'Login' }}
97
+ {{ te('auth.login') ? t('auth.login') : 'Login' }}
96
98
  </v-btn>
97
99
  </v-card-actions>
98
100
  </v-card>
@@ -3,7 +3,9 @@ import {useAuth} from "../../composables/useAuth";
3
3
  import {defineModel} from "vue";
4
4
  import IdentityProfileView from "../IdentityProfileView/IdentityProfileView.vue";
5
5
  import {useRouter} from "vue-router";
6
+ import {useI18n} from "vue-i18n";
6
7
 
8
+ const {t} = useI18n()
7
9
  const router = useRouter()
8
10
 
9
11
 
@@ -29,13 +31,13 @@ const valueModel = defineModel<boolean>()
29
31
  <v-list-item
30
32
  @click="router.push({name:'Profile'})"
31
33
  prepend-icon="mdi-account-cog"
32
- :title="$t('user.profile')"
34
+ :title="t('user.profile')"
33
35
  >
34
36
  </v-list-item>
35
37
  <v-list-item
36
38
  @click="auth.logout()"
37
39
  prepend-icon="mdi-logout"
38
- :title="$t('user.logout')"
40
+ :title="t('user.logout')"
39
41
  >
40
42
  </v-list-item>
41
43
  </v-list>
@@ -46,7 +48,7 @@ const valueModel = defineModel<boolean>()
46
48
  <v-list-item
47
49
  href="/login"
48
50
  prepend-icon="mdi-login"
49
- :title="$t('user.login')"
51
+ :title="t('user.login')"
50
52
  >
51
53
  </v-list-item>
52
54
  </v-list>
@@ -2,6 +2,8 @@
2
2
 
3
3
  import {ref, onMounted, defineModel, computed} from 'vue'
4
4
  import type {PropType} from 'vue'
5
+ import {useI18n} from "vue-i18n";
6
+ const {t,te} = useI18n()
5
7
 
6
8
  defineProps({
7
9
  errorMessages: {
@@ -49,7 +51,7 @@ const permissionGroups = computed(() => {
49
51
 
50
52
  <template>
51
53
  <v-sheet class="pa-2">
52
- <h5 class="text-h5 mb-2">{{$t ? $t('permission.permissions') : 'Permissions'}}</h5>
54
+ <h5 class="text-h5 mb-2">{{te('permission.permissions') ? t('permission.permissions') : 'Permissions'}}</h5>
53
55
  <v-item-group
54
56
  v-model="model"
55
57
  variant="outlined"
@@ -60,7 +62,7 @@ const permissionGroups = computed(() => {
60
62
  <template v-for="(permissions, entity) in permissionGroups" :key="entity">
61
63
  <v-card class="mb-2" variant="outlined">
62
64
  <v-card-title class="text-capitalize">
63
- {{ $t ? $t('permission.'+entity) : entity }}
65
+ {{ t ? t('permission.'+entity) : entity }}
64
66
  </v-card-title>
65
67
  <v-card-text>
66
68
  <v-item
@@ -73,7 +75,7 @@ const permissionGroups = computed(() => {
73
75
  :color="isSelected? 'green' : 'grey-darken-3'" class=""
74
76
  @click="toggle" variant="flat" :rounded="false" border
75
77
  >
76
- {{ $t ? $t('permission.'+permission) : permission }}
78
+ {{ te('permission.'+permission) ? t('permission.'+permission) : permission }}
77
79
  </v-chip>
78
80
 
79
81
 
@@ -5,7 +5,8 @@ import {useRole} from "../../composables/useRole";
5
5
  import type {IRole, IRoleBase} from "@drax/identity-share";
6
6
  import RoleForm from "../../forms/RoleForm.vue";
7
7
  import RoleView from "../../views/RoleView.vue";
8
-
8
+ import {useI18n} from "vue-i18n";
9
+ const {t} = useI18n()
9
10
  const {createRole, editRole, deleteRole, loading, roleError, inputErrors} = useRole()
10
11
 
11
12
  interface RoleList {
@@ -110,13 +111,13 @@ function toDelete(item: IRole) {
110
111
 
111
112
  <v-card border rounded>
112
113
  <v-toolbar class="bg-toolbar">
113
- <v-toolbar-title>{{$t('role.managing')}}</v-toolbar-title>
114
+ <v-toolbar-title>{{t('role.managing')}}</v-toolbar-title>
114
115
  <v-spacer></v-spacer>
115
116
  <v-btn icon @click="filterEnable = !filterEnable">
116
117
  <v-icon>{{ filterEnable ? 'mdi-filter' : 'mdi-filter-off' }}</v-icon>
117
118
  </v-btn>
118
119
  <v-btn color="primary" @click="toCreate">
119
- {{$t('action.create') }}
120
+ {{t('action.create') }}
120
121
  </v-btn>
121
122
  </v-toolbar>
122
123
  <v-theme-provider with-background class="pa-2 rounded-b">
@@ -132,7 +133,7 @@ function toDelete(item: IRole) {
132
133
  <v-dialog v-model="dialog" max-width="800">
133
134
  <v-sheet border>
134
135
  <v-toolbar>
135
- <v-toolbar-title>{{ dialogTitle ? $t(dialogTitle) : '-' }}</v-toolbar-title>
136
+ <v-toolbar-title>{{ dialogTitle ? t(dialogTitle) : '-' }}</v-toolbar-title>
136
137
  </v-toolbar>
137
138
  <v-card class="pa-10">
138
139
  <v-card-text v-if="roleError">
@@ -154,7 +155,7 @@ function toDelete(item: IRole) {
154
155
  @click="save"
155
156
  :loading="loading"
156
157
  >
157
- {{ $t(buttonText) }}
158
+ {{ t(buttonText) }}
158
159
  </v-btn>
159
160
  </v-card-actions>
160
161
 
@@ -8,7 +8,7 @@ import type {IRole} from "@drax/identity-share";
8
8
 
9
9
  const {hasPermission} = useAuth()
10
10
  const {paginateRole} = useRole()
11
- const {t} = useI18n()
11
+ const {t,te} = useI18n()
12
12
 
13
13
  defineProps({
14
14
  filterEnable: {
@@ -77,13 +77,13 @@ defineExpose({
77
77
  >
78
78
  <template v-slot:top>
79
79
  <v-toolbar density="compact" v-if="filterEnable">
80
- <v-toolbar-title>{{ $t('action.filters') }}</v-toolbar-title>
80
+ <v-toolbar-title>{{ t('action.filters') }}</v-toolbar-title>
81
81
  <v-spacer></v-spacer>
82
82
  <v-text-field v-model="search" hide-details
83
83
  density="compact" class="mr-2"
84
84
  variant="outlined"
85
85
  append-inner-icon="mdi-magnify"
86
- :label="$t('action.search')"
86
+ :label="t('action.search')"
87
87
  single-line clearable @click:clear="() => search = ''"
88
88
  />
89
89
 
@@ -94,7 +94,7 @@ defineExpose({
94
94
  :key="permission" color="green"
95
95
  class="ma-1"
96
96
  >
97
- {{$t ? $t(`permission.${permission}`) : permission }}
97
+ {{te(`permission.${permission}`) ? t(`permission.${permission}`) : permission }}
98
98
  </v-chip>
99
99
  </template>
100
100
 
@@ -0,0 +1,73 @@
1
+
2
+ import {EntityCrud} from "@drax/crud-vue";
3
+ import {TenantSystemFactory} from "@drax/identity-front";
4
+ import type {IEntityCrud, IEntityCrudField, IEntityCrudHeader} from "@drax/crud-share";
5
+
6
+
7
+ class TenantCrud extends EntityCrud implements IEntityCrud {
8
+
9
+ static singleton: TenantCrud
10
+
11
+ constructor() {
12
+ super();
13
+ this.name = 'Tenant'
14
+ }
15
+
16
+ static get instance(): TenantCrud {
17
+ if(!TenantCrud.singleton){
18
+ TenantCrud.singleton = new TenantCrud()
19
+ }
20
+ return TenantCrud.singleton
21
+ }
22
+
23
+ get permissions(){
24
+ return {
25
+ manage: 'tenant:manage',
26
+ view: 'tenant:view',
27
+ create: 'tenant:create',
28
+ update: 'tenant:update',
29
+ delete: 'tenant:delete'
30
+ }
31
+ }
32
+
33
+ get headers():IEntityCrudHeader[] {
34
+ return [
35
+ //{title: 'id',key:'_id', align: 'start'},
36
+ {title: 'name',key:'name', align: 'start'}
37
+ ]
38
+ }
39
+
40
+ get provider(){
41
+ return TenantSystemFactory.getInstance()
42
+ }
43
+
44
+ get refs(){
45
+ return {
46
+
47
+ }
48
+ }
49
+
50
+ get rules(){
51
+ return {
52
+ name: [(v: any) => !!v || 'Requerido']
53
+ }
54
+ }
55
+
56
+ get fields(): IEntityCrudField[]{
57
+ return [
58
+ {name: 'name', type: 'string', label: 'name', default:'' }
59
+ ]
60
+ }
61
+
62
+ get dialogFullscreen(){
63
+ return false
64
+ }
65
+
66
+ get exportHeaders(){
67
+ return ['_id', 'name']
68
+ }
69
+
70
+ }
71
+
72
+ export default TenantCrud
73
+
@@ -5,7 +5,8 @@ import {useTenant} from "../../composables/useTenant";
5
5
  import type {ITenant, ITenantBase} from "@drax/identity-share";
6
6
  import TenantForm from "../../forms/TenantForm.vue";
7
7
  import TenantView from "../../views/TenantView.vue";
8
-
8
+ import {useI18n} from "vue-i18n";
9
+ const {t} = useI18n()
9
10
  const {createTenant, editTenant, deleteTenant, loading, tenantError, inputErrors} = useTenant()
10
11
 
11
12
  interface TenantList {
@@ -107,13 +108,13 @@ function toDelete(item: ITenant) {
107
108
 
108
109
  <v-card border rounded >
109
110
  <v-toolbar class="bg-toolbar">
110
- <v-toolbar-title>{{ $t('tenant.managing') }}</v-toolbar-title>
111
+ <v-toolbar-title>{{ t('tenant.managing') }}</v-toolbar-title>
111
112
  <v-spacer></v-spacer>
112
113
  <v-btn icon @click="filterEnable = !filterEnable">
113
114
  <v-icon>{{ filterEnable ? 'mdi-filter' : 'mdi-filter-off' }}</v-icon>
114
115
  </v-btn>
115
116
  <v-btn class="font-weight-bold" color="primary" @click="toCreate">
116
- {{ $t('action.create') }}
117
+ {{ t('action.create') }}
117
118
  </v-btn>
118
119
  </v-toolbar>
119
120
  <v-theme-provider with-background class="pa-2 rounded-b">
@@ -129,7 +130,7 @@ function toDelete(item: ITenant) {
129
130
  <v-dialog v-model="dialog" max-width="800">
130
131
  <v-sheet border>
131
132
  <v-toolbar>
132
- <v-toolbar-title>{{ dialogTitle ? $t(dialogTitle) : '-' }}</v-toolbar-title>
133
+ <v-toolbar-title>{{ dialogTitle ? t(dialogTitle) : '-' }}</v-toolbar-title>
133
134
  </v-toolbar>
134
135
  <v-card class="pa-10">
135
136
  <v-card-text v-if="tenantError">
@@ -151,7 +152,7 @@ function toDelete(item: ITenant) {
151
152
  @click="save"
152
153
  :loading="loading"
153
154
  >
154
- {{ $t(buttonText) }}
155
+ {{ t(buttonText) }}
155
156
  </v-btn>
156
157
  </v-card-actions>
157
158
 
@@ -77,13 +77,13 @@ defineExpose({
77
77
  >
78
78
  <template v-slot:top>
79
79
  <v-toolbar density="compact" v-if="filterEnable">
80
- <v-toolbar-title>{{ $t('action.filters') }}</v-toolbar-title>
80
+ <v-toolbar-title>{{ t('action.filters') }}</v-toolbar-title>
81
81
  <v-spacer></v-spacer>
82
82
  <v-text-field v-model="search" hide-details
83
83
  density="compact" class="mr-2"
84
84
  variant="outlined"
85
85
  append-inner-icon="mdi-magnify"
86
- :label="$t('action.search')"
86
+ :label="t('action.search')"
87
87
  single-line clearable @click:clear="() => search = ''"
88
88
  />
89
89
 
@@ -6,7 +6,8 @@ import type {IUserApiKey, IUserApiKeyBase} from "@drax/identity-share";
6
6
  import {useCopy} from "@drax/common-vue";
7
7
  import UserApiKeyForm from "../../forms/UserApiKeyForm.vue";
8
8
  import UserApiKeyView from "../../views/UserApiKeyView.vue";
9
-
9
+ import {useI18n} from "vue-i18n";
10
+ const {t} = useI18n()
10
11
  const {createUserApiKey, editUserApiKey, deleteUserApiKey, loading, userApiKeyError, inputErrors} = useUserApiKey()
11
12
 
12
13
 
@@ -120,13 +121,13 @@ function toDelete(item: IUserApiKey) {
120
121
 
121
122
  <v-card border rounded>
122
123
  <v-toolbar class="bg-toolbar">
123
- <v-toolbar-title>{{ $t('userApiKey.managing') }}</v-toolbar-title>
124
+ <v-toolbar-title>{{ t('userApiKey.managing') }}</v-toolbar-title>
124
125
  <v-spacer></v-spacer>
125
126
  <v-btn icon @click="filterEnable = !filterEnable">
126
127
  <v-icon>{{ filterEnable ? 'mdi-filter' : 'mdi-filter-off' }}</v-icon>
127
128
  </v-btn>
128
129
  <v-btn class="font-weight-bold" color="primary" @click="toCreate">
129
- {{ $t('action.create') }}
130
+ {{ t('action.create') }}
130
131
  </v-btn>
131
132
  </v-toolbar>
132
133
  <v-theme-provider with-background class="pa-2 rounded-b">
@@ -142,14 +143,14 @@ function toDelete(item: IUserApiKey) {
142
143
  <v-dialog v-model="dialog" max-width="800">
143
144
  <v-sheet border>
144
145
  <v-toolbar>
145
- <v-toolbar-title>{{ dialogTitle ? $t(dialogTitle) : '-' }}</v-toolbar-title>
146
+ <v-toolbar-title>{{ dialogTitle ? t(dialogTitle) : '-' }}</v-toolbar-title>
146
147
  </v-toolbar>
147
148
  <v-card class="pa-10">
148
149
  <v-card-text v-if="userApiKeyError">
149
150
  <v-alert type="error">{{ userApiKeyError }}</v-alert>
150
151
  </v-card-text>
151
152
  <v-card-text v-if="success">
152
- <v-alert type="success">{{ $t('action.success') }}</v-alert>
153
+ <v-alert type="success">{{ t('action.success') }}</v-alert>
153
154
  </v-card-text>
154
155
  <v-card-text>
155
156
  <UserApiKeyForm v-if="dialogMode === 'create' || dialogMode === 'edit'"
@@ -165,7 +166,7 @@ function toDelete(item: IUserApiKey) {
165
166
  base-color="success"
166
167
  variant="outlined"
167
168
  @click:append="copy(userApiKeyCreated.secret)"
168
- :hint="$t('userApiKey.secretWarning')"
169
+ :hint="t('userApiKey.secretWarning')"
169
170
  persistent-hint
170
171
  >
171
172
  <template v-slot:append>
@@ -178,7 +179,7 @@ function toDelete(item: IUserApiKey) {
178
179
  <v-card-actions>
179
180
  <v-spacer></v-spacer>
180
181
  <v-btn variant="text" @click="cancel" :loading="loading">
181
- {{success ? $t('action.close') : $t('action.cancel')}}
182
+ {{success ? t('action.close') : t('action.cancel')}}
182
183
  </v-btn>
183
184
  <v-btn
184
185
  v-if="!success"
@@ -187,7 +188,7 @@ function toDelete(item: IUserApiKey) {
187
188
  @click="save"
188
189
  :loading="loading"
189
190
  >
190
- {{ $t(buttonText) }}
191
+ {{ t(buttonText) }}
191
192
  </v-btn>
192
193
  </v-card-actions>
193
194
 
@@ -79,13 +79,13 @@ defineExpose({
79
79
  >
80
80
  <template v-slot:top>
81
81
  <v-toolbar density="compact" v-if="filterEnable">
82
- <v-toolbar-title>{{ $t('action.filters') }}</v-toolbar-title>
82
+ <v-toolbar-title>{{ t('action.filters') }}</v-toolbar-title>
83
83
  <v-spacer></v-spacer>
84
84
  <v-text-field v-model="search" hide-details
85
85
  density="compact" class="mr-2"
86
86
  variant="outlined"
87
87
  append-inner-icon="mdi-magnify"
88
- :label="$t('action.search')"
88
+ :label="t('action.search')"
89
89
  single-line clearable @click:clear="() => search = ''"
90
90
  />
91
91
 
@@ -8,6 +8,9 @@ import UserCreateForm from "../../forms/UserCreateForm.vue";
8
8
  import UserEditForm from "../../forms/UserEditForm.vue";
9
9
  import UserPasswordForm from "../../forms/UserPasswordForm.vue";
10
10
  import UserView from "../../views/UserView.vue";
11
+ import {useI18n} from "vue-i18n";
12
+
13
+ const {t} = useI18n()
11
14
 
12
15
  const {createUser, editUser, changeUserPassword, deleteUser, loading, userError, inputErrors} = useUser()
13
16
 
@@ -141,13 +144,13 @@ function toChangePassword(item: IUser) {
141
144
 
142
145
  <v-card border rounded>
143
146
  <v-toolbar class="bg-toolbar">
144
- <v-toolbar-title>{{ $t('user.managing') }}</v-toolbar-title>
147
+ <v-toolbar-title>{{ t('user.managing') }}</v-toolbar-title>
145
148
  <v-spacer></v-spacer>
146
149
  <v-btn icon @click="filterEnable = !filterEnable">
147
150
  <v-icon>{{ filterEnable ? 'mdi-filter' : 'mdi-filter-off' }}</v-icon>
148
151
  </v-btn>
149
152
  <v-btn color="primary" @click="toCreate">
150
- {{$t('action.create') }}
153
+ {{t('action.create') }}
151
154
  </v-btn>
152
155
  </v-toolbar>
153
156
  <v-theme-provider with-background class="pa-2 rounded-b">
@@ -164,7 +167,7 @@ function toChangePassword(item: IUser) {
164
167
  <v-dialog v-model="dialog" max-width="800">
165
168
  <v-sheet border>
166
169
  <v-toolbar>
167
- <v-toolbar-title>{{ dialogTitle ? $t(dialogTitle) : '-' }}</v-toolbar-title>
170
+ <v-toolbar-title>{{ dialogTitle ? t(dialogTitle) : '-' }}</v-toolbar-title>
168
171
  </v-toolbar>
169
172
  <v-card class="pa-10">
170
173
  <v-card-text v-if="userError">
@@ -206,7 +209,7 @@ function toChangePassword(item: IUser) {
206
209
  variant="text"
207
210
  @click="cancel"
208
211
  :loading="loading">
209
- {{ actionButtonEnable ? $t('action.cancel') : $t('action.close') }}
212
+ {{ actionButtonEnable ? t('action.cancel') : t('action.close') }}
210
213
  </v-btn>
211
214
  <v-btn
212
215
  v-if="actionButtonEnable"
@@ -215,7 +218,7 @@ function toChangePassword(item: IUser) {
215
218
  @click="save"
216
219
  :loading="loading"
217
220
  >
218
- {{ $t(buttonText) }}
221
+ {{ t(buttonText) }}
219
222
  </v-btn>
220
223
  </v-card-actions>
221
224
 
@@ -79,13 +79,13 @@ defineExpose({
79
79
  >
80
80
  <template v-slot:top>
81
81
  <v-toolbar density="compact" v-if="filterEnable">
82
- <v-toolbar-title>{{ $t('action.filters') }}</v-toolbar-title>
82
+ <v-toolbar-title>{{ t('action.filters') }}</v-toolbar-title>
83
83
  <v-spacer></v-spacer>
84
84
  <v-text-field v-model="search" hide-details
85
85
  density="compact" class="mr-2"
86
86
  variant="outlined"
87
87
  append-inner-icon="mdi-magnify"
88
- :label="$t('action.search')"
88
+ :label="t('action.search')"
89
89
  single-line clearable @click:clear="() => search = ''"
90
90
  />
91
91
  </v-toolbar>
@@ -46,7 +46,7 @@ const ipv6Address = [
46
46
  <v-text-field
47
47
  variant="outlined"
48
48
  id="name-input"
49
- :label="$t('userApiKey.name')"
49
+ :label="t('userApiKey.name')"
50
50
  v-model="form.name"
51
51
  prepend-inner-icon="mdi-card-account-details"
52
52
  required
@@ -55,7 +55,7 @@ const ipv6Address = [
55
55
 
56
56
  <v-combobox
57
57
  v-model="form.ipv4 as string[]"
58
- :label="$t('userApiKey.ipv4')"
58
+ :label="t('userApiKey.ipv4')"
59
59
  variant="outlined"
60
60
  multiple chips
61
61
  validate-on="blur"
@@ -64,7 +64,7 @@ const ipv6Address = [
64
64
 
65
65
  <v-combobox
66
66
  v-model="form.ipv6 as string[]"
67
- :label="$t('userApiKey.ipv6')"
67
+ :label="t('userApiKey.ipv6')"
68
68
  variant="outlined"
69
69
  multiple chips
70
70
  validate-on="blur"
@@ -44,13 +44,13 @@ const onSubmit = () => {
44
44
 
45
45
  <v-sheet v-if="passwordChanged">
46
46
  <v-alert type="success">
47
- {{ $t('user.passwordChanged') }}
47
+ {{ t('user.passwordChanged') }}
48
48
  </v-alert>
49
49
  </v-sheet>
50
50
  <v-sheet v-else>
51
51
  <form ref="changeUserPassword" @submit.prevent="onSubmit">
52
52
 
53
- <div class="text-subtitle-1 text-medium-emphasis">{{ $t('user.newPassword') }}</div>
53
+ <div class="text-subtitle-1 text-medium-emphasis">{{ t('user.newPassword') }}</div>
54
54
  <v-text-field
55
55
  variant="outlined"
56
56
  id="new-password-input"
@@ -63,7 +63,7 @@ const onSubmit = () => {
63
63
  autocomplete="new-password"
64
64
  :error-messages="$ta(inputErrors.newPassword)"
65
65
  ></v-text-field>
66
- <div class="text-subtitle-1 text-medium-emphasis">{{ $t('user.confirmPassword') }}</div>
66
+ <div class="text-subtitle-1 text-medium-emphasis">{{ t('user.confirmPassword') }}</div>
67
67
  <v-text-field
68
68
  variant="outlined"
69
69
  id="confirm-password-input"
@@ -2,7 +2,8 @@
2
2
  import IdentityProfileView from "../components/IdentityProfileView/IdentityProfileView.vue";
3
3
  import {useRouter} from "vue-router";
4
4
  const router = useRouter();
5
-
5
+ import { useI18n } from 'vue-i18n';
6
+ const { t } = useI18n();
6
7
  </script>
7
8
 
8
9
  <template>
@@ -14,7 +15,9 @@ const router = useRouter();
14
15
  <v-card>
15
16
  <identity-profile-view> </identity-profile-view>
16
17
  <v-card-text class="text-center">
17
- <v-btn color="blue" variant="tonal" @click="router.push({name: 'Password'})">{{$t('user.changeOwnPassword')}}</v-btn>
18
+ <v-btn color="blue" variant="tonal" @click="router.push({name: 'Password'})">
19
+ {{t('user.changeOwnPassword')}}
20
+ </v-btn>
18
21
  </v-card-text>
19
22
  </v-card>
20
23
  </v-col>
@@ -1,10 +1,12 @@
1
1
  <script setup lang="ts">
2
-
3
- import TenantCrud from "../cruds/tenant-crud/TenantCrud.vue";
2
+ import TenantCrud from '../cruds/tenant-crud/TenantCrud'
3
+ import {Crud} from "@drax/crud-vue";
4
4
  </script>
5
5
 
6
6
  <template>
7
- <TenantCrud></TenantCrud>
7
+ <crud :entity="TenantCrud.instance">
8
+
9
+ </crud>
8
10
  </template>
9
11
 
10
12
  <style scoped>
@@ -0,0 +1,12 @@
1
+ <script setup lang="ts">
2
+
3
+ import TenantCrud from "../cruds/tenant-crud/TenantCrud.vue";
4
+ </script>
5
+
6
+ <template>
7
+ <TenantCrud></TenantCrud>
8
+ </template>
9
+
10
+ <style scoped>
11
+
12
+ </style>
@@ -1,6 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import type {PropType} from "vue";
3
3
  import type {IRole} from "@drax/identity-share";
4
+ import { useI18n } from 'vue-i18n';
5
+ const { t, te } = useI18n();
4
6
 
5
7
  defineProps({
6
8
  role:{
@@ -13,14 +15,14 @@ defineProps({
13
15
  <template>
14
16
  <v-sheet border class="position-relative d-flex justify-center align-center" height="150">
15
17
  <v-sheet class="text-center">
16
- <h6 class="text-h6">{{$t ? $t('role.name') : 'Name'}} : {{ role.name }}</h6>
18
+ <h6 class="text-h6">{{te('role.name') ? t('role.name') : 'Name'}} : {{ role.name }}</h6>
17
19
  <h6 class="text-h6 text-grey">Permisos</h6>
18
20
 
19
21
  <v-chip v-for="permission in role.permissions"
20
22
  :key="permission" color="green"
21
23
  class="ma-1"
22
24
  >
23
- {{$t ? $t(`permission.${permission}`) : permission }}
25
+ {{te(`permission.${permission}`) ? t(`permission.${permission}`) : permission }}
24
26
  </v-chip>
25
27
  </v-sheet>
26
28
  </v-sheet>
@@ -1,6 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import type {PropType} from "vue";
3
3
  import type {ITenant} from "@drax/identity-share";
4
+ import { useI18n } from 'vue-i18n';
5
+ const { t, te } = useI18n();
4
6
 
5
7
  defineProps({
6
8
  tenant:{
@@ -13,7 +15,7 @@ defineProps({
13
15
  <template>
14
16
  <v-sheet border class="position-relative d-flex justify-center align-center" height="150">
15
17
  <v-sheet class="text-center">
16
- <h6 class="text-h6">{{$t ? $t('tenant.name') : 'Name'}} : {{ tenant.name }}</h6>
18
+ <h6 class="text-h6">{{te('tenant.name') ? t('tenant.name') : 'Name'}} : {{ tenant.name }}</h6>
17
19
  </v-sheet>
18
20
  </v-sheet>
19
21
 
@@ -1,6 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import type {PropType} from "vue";
3
3
  import type {IUserApiKey} from "@drax/identity-share";
4
+ import { useI18n } from 'vue-i18n';
5
+ const { t, te } = useI18n();
4
6
 
5
7
  defineProps({
6
8
  userApiKey:{
@@ -13,7 +15,7 @@ defineProps({
13
15
  <template>
14
16
  <v-sheet border class="position-relative d-flex justify-center align-center" height="150">
15
17
  <v-sheet class="text-center">
16
- <h6 class="text-h6">{{$t ? $t('userApiKey.name') : 'Name'}} : {{ userApiKey.name }}</h6>
18
+ <h6 class="text-h6">{{te('userApiKey.name') ? t('userApiKey.name') : 'Name'}} : {{ userApiKey.name }}</h6>
17
19
  </v-sheet>
18
20
  </v-sheet>
19
21