iptdevs-design-system 3.2.9 → 3.2.11
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/esm2020/lib/components/forms/update-user-form/update-user-form.component.mjs +1 -25
- package/fesm2015/iptdevs-design-system.mjs +0 -24
- package/fesm2015/iptdevs-design-system.mjs.map +1 -1
- package/fesm2020/iptdevs-design-system.mjs +0 -24
- package/fesm2020/iptdevs-design-system.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -2061,7 +2061,6 @@ class updateUserFormComponent {
|
|
|
2061
2061
|
initializeForm() {
|
|
2062
2062
|
var _a, _b, _c;
|
|
2063
2063
|
this.showParentSection = !!((_c = (_b = (_a = this.DataStudent) === null || _a === void 0 ? void 0 : _a.cods) === null || _b === void 0 ? void 0 : _b.parent) === null || _c === void 0 ? void 0 : _c.code);
|
|
2064
|
-
// this.showEmailIpt = !!this.DataStudent?.email_ipt && this.DataStudent.email_ipt !== false;
|
|
2065
2064
|
this.checkRoleForAdditionalFields(this.DataStudent.role);
|
|
2066
2065
|
this.initForm();
|
|
2067
2066
|
this.populateForm();
|
|
@@ -2190,9 +2189,7 @@ class updateUserFormComponent {
|
|
|
2190
2189
|
country: (_a = this.DataStudent.city) === null || _a === void 0 ? void 0 : _a.country,
|
|
2191
2190
|
state: (_b = this.DataStudent.city) === null || _b === void 0 ? void 0 : _b.state,
|
|
2192
2191
|
city: (_c = this.DataStudent.city) === null || _c === void 0 ? void 0 : _c.code,
|
|
2193
|
-
// role: this.transformRole(this.DataStudent.role) || '',
|
|
2194
2192
|
role: this.canEditRole ? this.DataStudent.role : this.transformRole(this.DataStudent.role) || '',
|
|
2195
|
-
// service_hour: this.DataStudent.service_hour || 0,
|
|
2196
2193
|
changePassword: false,
|
|
2197
2194
|
password: '',
|
|
2198
2195
|
re_password: '',
|
|
@@ -2206,9 +2203,6 @@ class updateUserFormComponent {
|
|
|
2206
2203
|
else {
|
|
2207
2204
|
formValue.service_hour = this.DataStudent.service_hour || 0;
|
|
2208
2205
|
}
|
|
2209
|
-
// if (this.showEmailIpt) {
|
|
2210
|
-
// formValue.email_ipt = this.DataStudent.email_ipt || '';
|
|
2211
|
-
// }
|
|
2212
2206
|
if (this.showParentSection) {
|
|
2213
2207
|
Object.assign(formValue, {
|
|
2214
2208
|
parent_name: ((_e = (_d = this.DataStudent.cods) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.name) || '',
|
|
@@ -2416,7 +2410,6 @@ class updateUserFormComponent {
|
|
|
2416
2410
|
var _a, _b;
|
|
2417
2411
|
if (role !== null) {
|
|
2418
2412
|
(_a = this.updateUserForm.get('role')) === null || _a === void 0 ? void 0 : _a.setValue(role);
|
|
2419
|
-
// Verificar si se deben mostrar los campos adicionales
|
|
2420
2413
|
const previousShowEmailIptAndServiceHour = this.showEmailIptAndServiceHour;
|
|
2421
2414
|
this.checkRoleForAdditionalFields(role);
|
|
2422
2415
|
// Si showEmailIptAndServiceHour cambió, actualizar los validadores
|
|
@@ -2443,7 +2436,6 @@ class updateUserFormComponent {
|
|
|
2443
2436
|
}
|
|
2444
2437
|
}
|
|
2445
2438
|
else {
|
|
2446
|
-
// Remover validadores si los campos no son necesarios
|
|
2447
2439
|
if (emailIptControl) {
|
|
2448
2440
|
emailIptControl.clearValidators();
|
|
2449
2441
|
emailIptControl.setValue('');
|
|
@@ -2453,7 +2445,6 @@ class updateUserFormComponent {
|
|
|
2453
2445
|
serviceHourControl.setValue(0);
|
|
2454
2446
|
}
|
|
2455
2447
|
}
|
|
2456
|
-
// Actualizar la validez de los controles
|
|
2457
2448
|
emailIptControl === null || emailIptControl === void 0 ? void 0 : emailIptControl.updateValueAndValidity();
|
|
2458
2449
|
serviceHourControl === null || serviceHourControl === void 0 ? void 0 : serviceHourControl.updateValueAndValidity();
|
|
2459
2450
|
}
|
|
@@ -2529,7 +2520,6 @@ class updateUserFormComponent {
|
|
|
2529
2520
|
originalValue = this.DataStudent.email || '';
|
|
2530
2521
|
break;
|
|
2531
2522
|
case 'email_ipt':
|
|
2532
|
-
// originalValue = this.DataStudent.email_ipt || '';
|
|
2533
2523
|
originalValue = this.showEmailIptAndServiceHour ? (this.DataStudent.email_ipt || '') : '';
|
|
2534
2524
|
break;
|
|
2535
2525
|
case 'gender':
|
|
@@ -2557,11 +2547,9 @@ class updateUserFormComponent {
|
|
|
2557
2547
|
originalValue = ((_c = this.DataStudent.city) === null || _c === void 0 ? void 0 : _c.code) || '';
|
|
2558
2548
|
break;
|
|
2559
2549
|
case 'role':
|
|
2560
|
-
// originalValue = this.transformRole(this.DataStudent.role) || '';
|
|
2561
2550
|
originalValue = this.canEditRole ? this.DataStudent.role : this.transformRole(this.DataStudent.role) || '';
|
|
2562
2551
|
break;
|
|
2563
2552
|
case 'service_hour':
|
|
2564
|
-
// originalValue = this.DataStudent.service_hour || '' ;
|
|
2565
2553
|
originalValue = this.showEmailIptAndServiceHour ? (this.DataStudent.service_hour || 0) : 0;
|
|
2566
2554
|
break;
|
|
2567
2555
|
case 'status':
|
|
@@ -2610,11 +2598,6 @@ class updateUserFormComponent {
|
|
|
2610
2598
|
this.updateUserForm.hasError('mismatch') ||
|
|
2611
2599
|
!this.hasFormChanged()) {
|
|
2612
2600
|
this.updateUserForm.markAllAsTouched();
|
|
2613
|
-
console.log('Validation failed:', {
|
|
2614
|
-
invalid: this.updateUserForm.invalid,
|
|
2615
|
-
mismatch: this.updateUserForm.hasError('mismatch'),
|
|
2616
|
-
hasChanges: this.hasFormChanged()
|
|
2617
|
-
});
|
|
2618
2601
|
return;
|
|
2619
2602
|
}
|
|
2620
2603
|
this.showConfirmSection = true;
|
|
@@ -2691,11 +2674,6 @@ class updateUserFormComponent {
|
|
|
2691
2674
|
this.updateUserForm.hasError('mismatch') ||
|
|
2692
2675
|
!this.hasFormChanged()) {
|
|
2693
2676
|
this.updateUserForm.markAllAsTouched();
|
|
2694
|
-
console.log('Validation failed:', {
|
|
2695
|
-
invalid: this.updateUserForm.invalid,
|
|
2696
|
-
mismatch: this.updateUserForm.hasError('mismatch'),
|
|
2697
|
-
hasChanges: this.hasFormChanged()
|
|
2698
|
-
});
|
|
2699
2677
|
return;
|
|
2700
2678
|
}
|
|
2701
2679
|
this.confirmForm.reset();
|
|
@@ -2721,9 +2699,7 @@ class updateUserFormComponent {
|
|
|
2721
2699
|
// Agregar este método para verificar el rol y mostrar/ocultar campos
|
|
2722
2700
|
checkRoleForAdditionalFields(role) {
|
|
2723
2701
|
const roleNumber = typeof role === 'string' ? parseInt(role, 10) : role;
|
|
2724
|
-
// Roles que NO requieren email_ipt y service_hour: estudiante (13), posible estudiante (15), proveedor (60)
|
|
2725
2702
|
const rolesWithoutAdditionalFields = [13, 15, 60];
|
|
2726
|
-
// Si el rol actual NO está en la lista de roles sin campos adicionales, mostramos los campos
|
|
2727
2703
|
this.showEmailIptAndServiceHour = !rolesWithoutAdditionalFields.includes(roleNumber);
|
|
2728
2704
|
}
|
|
2729
2705
|
}
|