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.
@@ -2056,7 +2056,6 @@ class updateUserFormComponent {
2056
2056
  }
2057
2057
  initializeForm() {
2058
2058
  this.showParentSection = !!this.DataStudent?.cods?.parent?.code;
2059
- // this.showEmailIpt = !!this.DataStudent?.email_ipt && this.DataStudent.email_ipt !== false;
2060
2059
  this.checkRoleForAdditionalFields(this.DataStudent.role);
2061
2060
  this.initForm();
2062
2061
  this.populateForm();
@@ -2182,9 +2181,7 @@ class updateUserFormComponent {
2182
2181
  country: this.DataStudent.city?.country,
2183
2182
  state: this.DataStudent.city?.state,
2184
2183
  city: this.DataStudent.city?.code,
2185
- // role: this.transformRole(this.DataStudent.role) || '',
2186
2184
  role: this.canEditRole ? this.DataStudent.role : this.transformRole(this.DataStudent.role) || '',
2187
- // service_hour: this.DataStudent.service_hour || 0,
2188
2185
  changePassword: false,
2189
2186
  password: '',
2190
2187
  re_password: '',
@@ -2198,9 +2195,6 @@ class updateUserFormComponent {
2198
2195
  else {
2199
2196
  formValue.service_hour = this.DataStudent.service_hour || 0;
2200
2197
  }
2201
- // if (this.showEmailIpt) {
2202
- // formValue.email_ipt = this.DataStudent.email_ipt || '';
2203
- // }
2204
2198
  if (this.showParentSection) {
2205
2199
  Object.assign(formValue, {
2206
2200
  parent_name: this.DataStudent.cods?.parent?.name || '',
@@ -2401,7 +2395,6 @@ class updateUserFormComponent {
2401
2395
  selectRole(role) {
2402
2396
  if (role !== null) {
2403
2397
  this.updateUserForm.get('role')?.setValue(role);
2404
- // Verificar si se deben mostrar los campos adicionales
2405
2398
  const previousShowEmailIptAndServiceHour = this.showEmailIptAndServiceHour;
2406
2399
  this.checkRoleForAdditionalFields(role);
2407
2400
  // Si showEmailIptAndServiceHour cambió, actualizar los validadores
@@ -2428,7 +2421,6 @@ class updateUserFormComponent {
2428
2421
  }
2429
2422
  }
2430
2423
  else {
2431
- // Remover validadores si los campos no son necesarios
2432
2424
  if (emailIptControl) {
2433
2425
  emailIptControl.clearValidators();
2434
2426
  emailIptControl.setValue('');
@@ -2438,7 +2430,6 @@ class updateUserFormComponent {
2438
2430
  serviceHourControl.setValue(0);
2439
2431
  }
2440
2432
  }
2441
- // Actualizar la validez de los controles
2442
2433
  emailIptControl?.updateValueAndValidity();
2443
2434
  serviceHourControl?.updateValueAndValidity();
2444
2435
  }
@@ -2513,7 +2504,6 @@ class updateUserFormComponent {
2513
2504
  originalValue = this.DataStudent.email || '';
2514
2505
  break;
2515
2506
  case 'email_ipt':
2516
- // originalValue = this.DataStudent.email_ipt || '';
2517
2507
  originalValue = this.showEmailIptAndServiceHour ? (this.DataStudent.email_ipt || '') : '';
2518
2508
  break;
2519
2509
  case 'gender':
@@ -2541,11 +2531,9 @@ class updateUserFormComponent {
2541
2531
  originalValue = this.DataStudent.city?.code || '';
2542
2532
  break;
2543
2533
  case 'role':
2544
- // originalValue = this.transformRole(this.DataStudent.role) || '';
2545
2534
  originalValue = this.canEditRole ? this.DataStudent.role : this.transformRole(this.DataStudent.role) || '';
2546
2535
  break;
2547
2536
  case 'service_hour':
2548
- // originalValue = this.DataStudent.service_hour || '' ;
2549
2537
  originalValue = this.showEmailIptAndServiceHour ? (this.DataStudent.service_hour || 0) : 0;
2550
2538
  break;
2551
2539
  case 'status':
@@ -2594,11 +2582,6 @@ class updateUserFormComponent {
2594
2582
  this.updateUserForm.hasError('mismatch') ||
2595
2583
  !this.hasFormChanged()) {
2596
2584
  this.updateUserForm.markAllAsTouched();
2597
- console.log('Validation failed:', {
2598
- invalid: this.updateUserForm.invalid,
2599
- mismatch: this.updateUserForm.hasError('mismatch'),
2600
- hasChanges: this.hasFormChanged()
2601
- });
2602
2585
  return;
2603
2586
  }
2604
2587
  this.showConfirmSection = true;
@@ -2690,11 +2673,6 @@ class updateUserFormComponent {
2690
2673
  this.updateUserForm.hasError('mismatch') ||
2691
2674
  !this.hasFormChanged()) {
2692
2675
  this.updateUserForm.markAllAsTouched();
2693
- console.log('Validation failed:', {
2694
- invalid: this.updateUserForm.invalid,
2695
- mismatch: this.updateUserForm.hasError('mismatch'),
2696
- hasChanges: this.hasFormChanged()
2697
- });
2698
2676
  return;
2699
2677
  }
2700
2678
  this.confirmForm.reset();
@@ -2719,9 +2697,7 @@ class updateUserFormComponent {
2719
2697
  // Agregar este método para verificar el rol y mostrar/ocultar campos
2720
2698
  checkRoleForAdditionalFields(role) {
2721
2699
  const roleNumber = typeof role === 'string' ? parseInt(role, 10) : role;
2722
- // Roles que NO requieren email_ipt y service_hour: estudiante (13), posible estudiante (15), proveedor (60)
2723
2700
  const rolesWithoutAdditionalFields = [13, 15, 60];
2724
- // Si el rol actual NO está en la lista de roles sin campos adicionales, mostramos los campos
2725
2701
  this.showEmailIptAndServiceHour = !rolesWithoutAdditionalFields.includes(roleNumber);
2726
2702
  }
2727
2703
  }