@drax/identity-vue 3.19.0 → 3.21.0

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": "3.19.0",
6
+ "version": "3.21.0",
7
7
  "type": "module",
8
8
  "main": "./src/index.ts",
9
9
  "module": "./src/index.ts",
@@ -26,11 +26,11 @@
26
26
  "dependencies": {
27
27
  "@drax/common-front": "^3.19.0",
28
28
  "@drax/common-vue": "^3.19.0",
29
- "@drax/crud-front": "^3.11.0",
30
- "@drax/crud-share": "^3.19.0",
31
- "@drax/crud-vue": "^3.19.0",
32
- "@drax/identity-front": "^3.19.0",
33
- "@drax/identity-share": "^3.15.0"
29
+ "@drax/crud-front": "^3.21.0",
30
+ "@drax/crud-share": "^3.21.0",
31
+ "@drax/crud-vue": "^3.21.0",
32
+ "@drax/identity-front": "^3.21.0",
33
+ "@drax/identity-share": "^3.21.0"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "pinia": "^3.0.4",
@@ -55,5 +55,5 @@
55
55
  "vue-tsc": "^3.2.4",
56
56
  "vuetify": "^3.11.8"
57
57
  },
58
- "gitHead": "bf445c10758ee014b45c2d76d6fddd5c578c738f"
58
+ "gitHead": "9ceebbba20e7abf7337387e2a81d1475b9ba1bca"
59
59
  }
@@ -25,7 +25,6 @@ const store = useCrudStore(entity.name)
25
25
  const enablePassword = store.operation === 'create'
26
26
 
27
27
 
28
-
29
28
  const valid = ref()
30
29
  const formRef = ref()
31
30
 
@@ -33,12 +32,11 @@ const formRef = ref()
33
32
  const isTenantEnabled = computed(() => import.meta.env.VITE_DRAX_TENANT === 'ENABLE')
34
33
 
35
34
 
36
-
37
35
  async function submit() {
38
36
  store.resetErrors()
39
37
 
40
- if(store.operation === 'delete') {
41
- emit('submit',valueModel.value)
38
+ if (store.operation === 'delete') {
39
+ emit('submit', valueModel.value)
42
40
  return
43
41
  }
44
42
 
@@ -55,7 +53,7 @@ function cancel() {
55
53
  }
56
54
 
57
55
  const {
58
- submitColor, readonly
56
+ submitColor, readonly
59
57
  } = useFormUtils(store.operation)
60
58
 
61
59
 
@@ -74,6 +72,11 @@ const variant = computed(() => {
74
72
 
75
73
 
76
74
  let passwordVisibility = ref(false)
75
+ const confirmPassword = ref('')
76
+
77
+ function confirmPasswordRule(value: string) {
78
+ return value === valueModel.value.password || t('validation.password.confirmed')
79
+ }
77
80
 
78
81
  </script>
79
82
 
@@ -93,96 +96,134 @@ let passwordVisibility = ref(false)
93
96
 
94
97
  <v-card-text>
95
98
 
96
- <v-text-field
97
- id="name-input"
98
- :label="t('user.field.name')"
99
- v-model="valueModel.name"
100
- prepend-inner-icon="mdi-card-account-details"
101
- :variant="variant"
102
- :rules="[v => !!v || t('validation.required')]"
103
- :error-messages="$ta(store.inputErrors?.name)"
104
- :readonly="readonly"
105
- ></v-text-field>
106
-
107
- <v-text-field
108
- id="username-input"
109
- :label="t('user.field.username')"
110
- v-model="valueModel.username"
111
- prepend-inner-icon="mdi-account-question"
112
- :variant="variant"
113
- :rules="[v => !!v || t('validation.required')]"
114
- autocomplete="new-username"
115
- :error-messages="$ta(store.inputErrors?.username)"
116
- :readonly="readonly"
117
- ></v-text-field>
118
-
119
- <v-text-field
120
- v-if="enablePassword"
121
- id="password-input"
122
- :label="t('user.field.password')"
123
- v-model="valueModel.password"
124
- :type="passwordVisibility ? 'text': 'password'"
125
- :variant="variant"
126
- :rules="[v => !!v || t('validation.required')]"
127
- prepend-inner-icon="mdi-lock-outline"
128
- :append-inner-icon="passwordVisibility ? 'mdi-eye-off': 'mdi-eye'"
129
- @click:append-inner="passwordVisibility = !passwordVisibility"
130
- autocomplete="new-password"
131
- :error-messages="$ta(store.inputErrors?.password)"
132
- :readonly="readonly"
133
- ></v-text-field>
134
-
135
- <RoleCombobox
136
- v-model="valueModel.role"
137
- :label="t('user.field.role')"
138
- :variant="variant"
139
- :rules="[(v:any) => !!v || t('validation.required')]"
140
- :error-messages="$ta(store.inputErrors?.role)"
141
- :readonly="readonly"
142
- ></RoleCombobox>
143
-
144
- <TenantCombobox
145
- v-if="isTenantEnabled && hasPermission('tenant:manage')"
146
- v-model="valueModel.tenant"
147
- :label="t('user.field.tenant')"
148
- :variant="variant"
149
- :error-messages="$ta(store.inputErrors?.tenant)"
150
- clearable
151
- :readonly="readonly"
152
- ></TenantCombobox>
153
-
154
- <v-text-field
155
- v-model="valueModel.email"
156
- :variant="variant"
157
- id="email-input"
158
- :label="t('user.field.email')"
159
- prepend-inner-icon="mdi-email"
160
- :rules="[(v:any) => !!v || t('validation.required')]"
161
- :error-messages="$ta(store.inputErrors?.email)"
162
- :readonly="readonly"
163
- ></v-text-field>
164
-
165
- <v-text-field
166
- v-model="valueModel.phone"
167
- :variant="variant"
168
- id="phone-input"
169
- :label="t('user.field.phone')"
170
- prepend-inner-icon="mdi-phone"
171
- :rules="[(v:any) => !!v || t('validation.required')]"
172
- :error-messages="$ta(store.inputErrors?.phone)"
173
- :readonly="readonly"
174
- ></v-text-field>
175
-
176
- <v-switch
177
- id="active-input"
178
- v-model="valueModel.active"
179
- color="primary"
180
- label="Active"
181
- :true-value="true"
182
- :false-value="false"
183
- :readonly="readonly"
184
- ></v-switch>
185
-
99
+ <v-row>
100
+
101
+ <v-col cols="12">
102
+ <v-text-field
103
+ id="name-input"
104
+ :label="t('user.field.name')"
105
+ v-model="valueModel.name"
106
+ prepend-inner-icon="mdi-card-account-details"
107
+ :variant="variant"
108
+ :rules="[v => !!v || t('validation.required')]"
109
+ :error-messages="$ta(store.inputErrors?.name)"
110
+ :readonly="readonly"
111
+ ></v-text-field>
112
+ </v-col>
113
+
114
+ <v-col cols="12">
115
+ <v-text-field
116
+ id="username-input"
117
+ :label="t('user.field.username')"
118
+ v-model="valueModel.username"
119
+ prepend-inner-icon="mdi-account-question"
120
+ :variant="variant"
121
+ :rules="[v => !!v || t('validation.required')]"
122
+ autocomplete="new-username"
123
+ :error-messages="$ta(store.inputErrors?.username)"
124
+ :readonly="readonly"
125
+ ></v-text-field>
126
+ </v-col>
127
+
128
+ <v-col cols="12">
129
+ <v-text-field
130
+ v-if="enablePassword"
131
+ id="password-input"
132
+ :label="t('user.field.password')"
133
+ v-model="valueModel.password"
134
+ :type="passwordVisibility ? 'text': 'password'"
135
+ :variant="variant"
136
+ :rules="[v => !!v || t('validation.required')]"
137
+ prepend-inner-icon="mdi-lock-outline"
138
+ :append-inner-icon="passwordVisibility ? 'mdi-eye-off': 'mdi-eye'"
139
+ @click:append-inner="passwordVisibility = !passwordVisibility"
140
+ autocomplete="new-password"
141
+ :error-messages="$ta(store.inputErrors?.password)"
142
+ :readonly="readonly"
143
+ ></v-text-field>
144
+ </v-col>
145
+
146
+ <v-col cols="12">
147
+ <v-text-field
148
+ v-if="enablePassword"
149
+ id="confirm-password-input"
150
+ :label="t('user.field.confirmPassword')"
151
+ v-model="confirmPassword"
152
+ :type="passwordVisibility ? 'text': 'password'"
153
+ :variant="variant"
154
+ :rules="[
155
+ v => !!v || t('validation.required'),
156
+ confirmPasswordRule
157
+ ]"
158
+ prepend-inner-icon="mdi-lock-outline"
159
+ :append-inner-icon="passwordVisibility ? 'mdi-eye-off': 'mdi-eye'"
160
+ @click:append-inner="passwordVisibility = !passwordVisibility"
161
+ autocomplete="new-password"
162
+ :readonly="readonly"
163
+ ></v-text-field>
164
+ </v-col>
165
+
166
+ <v-col cols="12">
167
+ <RoleCombobox
168
+ v-model="valueModel.role"
169
+ :label="t('user.field.role')"
170
+ :variant="variant"
171
+ :rules="[(v:any) => !!v || t('validation.required')]"
172
+ :error-messages="$ta(store.inputErrors?.role)"
173
+ :readonly="readonly"
174
+ ></RoleCombobox>
175
+ </v-col>
176
+
177
+ <v-col cols="12">
178
+ <TenantCombobox
179
+ v-if="isTenantEnabled && hasPermission('tenant:manage')"
180
+ v-model="valueModel.tenant"
181
+ :label="t('user.field.tenant')"
182
+ :variant="variant"
183
+ :error-messages="$ta(store.inputErrors?.tenant)"
184
+ clearable
185
+ :readonly="readonly"
186
+ ></TenantCombobox>
187
+ </v-col>
188
+
189
+ <v-col cols="12">
190
+ <v-text-field
191
+ v-model="valueModel.email"
192
+ :variant="variant"
193
+ id="email-input"
194
+ :label="t('user.field.email')"
195
+ prepend-inner-icon="mdi-email"
196
+ :rules="[(v:any) => !!v || t('validation.required')]"
197
+ :error-messages="$ta(store.inputErrors?.email)"
198
+ :readonly="readonly"
199
+ ></v-text-field>
200
+ </v-col>
201
+
202
+ <v-col cols="12">
203
+ <v-text-field
204
+ v-model="valueModel.phone"
205
+ :variant="variant"
206
+ id="phone-input"
207
+ :label="t('user.field.phone')"
208
+ prepend-inner-icon="mdi-phone"
209
+ :rules="[(v:any) => !!v || t('validation.required')]"
210
+ :error-messages="$ta(store.inputErrors?.phone)"
211
+ :readonly="readonly"
212
+ ></v-text-field>
213
+ </v-col>
214
+
215
+ <v-col cols="12">
216
+ <v-switch
217
+ id="active-input"
218
+ v-model="valueModel.active"
219
+ color="primary"
220
+ label="Active"
221
+ :true-value="true"
222
+ :false-value="false"
223
+ :readonly="readonly"
224
+ ></v-switch>
225
+ </v-col>
226
+ </v-row>
186
227
  </v-card-text>
187
228
 
188
229
  <v-card-actions>
@@ -42,6 +42,9 @@ const rules = computed(() => {
42
42
  },
43
43
  {
44
44
  label: 'Debe incluir al menos un carácter especial',
45
+ description: policy.value.allowedSpecialChars
46
+ ? `Permitidos: ${policy.value.allowedSpecialChars}`
47
+ : undefined,
45
48
  enabled: policy.value.requireSpecialChar,
46
49
  icon: 'mdi-asterisk'
47
50
  },
@@ -58,7 +61,7 @@ const metadata = computed(() => {
58
61
  return []
59
62
  }
60
63
 
61
- return [
64
+ const items = [
62
65
  {
63
66
  label: 'Reutilización',
64
67
  value: policy.value.preventReuse > 0
@@ -72,6 +75,15 @@ const metadata = computed(() => {
72
75
  : 'Sin expiración configurada'
73
76
  }
74
77
  ]
78
+
79
+ if (policy.value.requireSpecialChar && policy.value.allowedSpecialChars) {
80
+ items.push({
81
+ label: 'Caracteres especiales',
82
+ value: policy.value.allowedSpecialChars
83
+ })
84
+ }
85
+
86
+ return items
75
87
  })
76
88
 
77
89
  async function loadPolicy() {
@@ -122,6 +134,9 @@ onMounted(loadPolicy)
122
134
  :prepend-icon="rule.icon"
123
135
  >
124
136
  <v-list-item-title>{{ rule.label }}</v-list-item-title>
137
+ <v-list-item-subtitle v-if="rule.enabled && rule.description">
138
+ {{ rule.description }}
139
+ </v-list-item-subtitle>
125
140
  <template #append>
126
141
  <v-chip
127
142
  :color="rule.enabled ? 'success' : 'default'"