iptdevs-design-system 3.1.992 → 3.1.995

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.
@@ -1928,7 +1928,7 @@ class updateUserFormComponent {
1928
1928
  initConfirmForm() {
1929
1929
  this.confirmForm = this.fb.group({
1930
1930
  reason: [null, Validators.required],
1931
- observation: ['', Validators.required, Validators.maxLength(250)]
1931
+ observation: ['', [Validators.required, Validators.maxLength(250)]]
1932
1932
  });
1933
1933
  }
1934
1934
  setJustifyOptions() {
@@ -2187,6 +2187,7 @@ class updateUserFormComponent {
2187
2187
  closeTable() {
2188
2188
  this.visibleModal = false;
2189
2189
  this.showConfirmDialog = false;
2190
+ this.confirmForm.reset();
2190
2191
  this.updateUserForm.reset();
2191
2192
  this.idTypes = [];
2192
2193
  this.countries = [];
@@ -2337,83 +2338,84 @@ class updateUserFormComponent {
2337
2338
  if (type === 'treasure')
2338
2339
  this.photo = '/platform/treasure/assets/administrativo.jpg';
2339
2340
  }
2340
- updateUser() {
2341
- if (this.updateUserForm.invalid ||
2342
- this.updateUserForm.hasError('mismatch') ||
2343
- !this.hasFormChanged()) {
2344
- this.updateUserForm.markAllAsTouched();
2345
- console.log('createUser - Validation failed:', {
2346
- invalid: this.updateUserForm.invalid,
2347
- mismatch: this.updateUserForm.hasError('mismatch'),
2348
- hasChanges: this.hasFormChanged()
2349
- });
2350
- return;
2351
- }
2352
- this.loader = true;
2353
- const formValue = this.updateUserForm.getRawValue();
2354
- const request = {
2355
- token: this.baseService.getUserToken(),
2356
- user: {
2357
- code: this.DataStudent.code,
2358
- name: formValue.name,
2359
- last_name: formValue.last_name,
2360
- id_card_type: formValue.id_card_type,
2361
- id_card: formValue.id_card,
2362
- phone_indicative: formValue.phone_indicative,
2363
- phone_number: formValue.phone_number,
2364
- email: formValue.email,
2365
- gender: formValue.gender,
2366
- city: formValue.city,
2367
- service_hour: formValue.service_hour,
2368
- role: this.DataStudent.role,
2369
- status: formValue.status,
2370
- ...(this.showEmailIpt ? { email_ipt: formValue.email_ipt } : {}),
2371
- ...(formValue.changePassword && formValue.password ? { password: formValue.password } : {})
2372
- },
2373
- parent: this.showParentSection
2374
- ? {
2375
- code: this.DataStudent.cods?.parent?.code || null,
2376
- name: formValue.parent_name || null,
2377
- last_name: formValue.parent_last_name || null,
2378
- id_card_type: formValue.parent_id_card_type || null,
2379
- id_card: formValue.parent_id_card || null,
2380
- phone_indicative: formValue.parent_phone_indicative || null,
2381
- phone_number: formValue.parent_phone_number || null,
2382
- occupation: formValue.parent_occupation || null,
2383
- office_adrress: formValue.parent_office_adrress || null,
2384
- email: formValue.parent_email || null
2385
- }
2386
- : null
2387
- };
2388
- console.log(request);
2389
- this.userService.updateUserAndParentByCode(request).subscribe((response) => {
2390
- // this.courseType = response.data;
2391
- if (response.message.code === 1) {
2392
- Swal.fire({
2393
- position: 'center',
2394
- icon: 'success',
2395
- title: 'usuario actualizado satisfactoriamente',
2396
- showConfirmButton: false,
2397
- timer: 2500,
2398
- });
2399
- // this.userUpdated = true
2400
- this.userUpdatedEvent.emit();
2401
- this.closeTable();
2402
- }
2403
- else {
2404
- Swal.fire({
2405
- position: 'center',
2406
- icon: 'error',
2407
- title: 'Ha ocurrido un error inesperado',
2408
- text: response.data.message,
2409
- showConfirmButton: false,
2410
- timer: 2500,
2411
- });
2412
- // this.userUpdated = false
2413
- }
2414
- });
2415
- this.loader = false;
2416
- }
2341
+ // updateUser(): void {
2342
+ // if (
2343
+ // this.updateUserForm.invalid ||
2344
+ // this.updateUserForm.hasError('mismatch') ||
2345
+ // !this.hasFormChanged()
2346
+ // ) {
2347
+ // this.updateUserForm.markAllAsTouched();
2348
+ // console.log('createUser - Validation failed:', {
2349
+ // invalid: this.updateUserForm.invalid,
2350
+ // mismatch: this.updateUserForm.hasError('mismatch'),
2351
+ // hasChanges: this.hasFormChanged()
2352
+ // });
2353
+ // return;
2354
+ // }
2355
+ // this.loader = true;
2356
+ // const formValue = this.updateUserForm.getRawValue();
2357
+ // const request:any = {
2358
+ // token: this.baseService.getUserToken(),
2359
+ // user: {
2360
+ // code: this.DataStudent.code,
2361
+ // name: formValue.name,
2362
+ // last_name: formValue.last_name,
2363
+ // id_card_type: formValue.id_card_type,
2364
+ // id_card: formValue.id_card,
2365
+ // phone_indicative: formValue.phone_indicative,
2366
+ // phone_number: formValue.phone_number,
2367
+ // email: formValue.email,
2368
+ // gender: formValue.gender,
2369
+ // city: formValue.city,
2370
+ // service_hour: formValue.service_hour,
2371
+ // role: this.DataStudent.role,
2372
+ // status: formValue.status,
2373
+ // ...(this.showEmailIpt ? { email_ipt: formValue.email_ipt } : {}),
2374
+ // ...(formValue.changePassword && formValue.password ? { password: formValue.password } : {})
2375
+ // },
2376
+ // parent: this.showParentSection
2377
+ // ? {
2378
+ // code: this.DataStudent.cods?.parent?.code || null,
2379
+ // name: formValue.parent_name || null,
2380
+ // last_name: formValue.parent_last_name || null,
2381
+ // id_card_type: formValue.parent_id_card_type || null,
2382
+ // id_card: formValue.parent_id_card || null,
2383
+ // phone_indicative: formValue.parent_phone_indicative || null,
2384
+ // phone_number: formValue.parent_phone_number || null,
2385
+ // occupation: formValue.parent_occupation || null,
2386
+ // office_adrress: formValue.parent_office_adrress || null,
2387
+ // email: formValue.parent_email || null
2388
+ // }
2389
+ // : null
2390
+ // };
2391
+ // console.log(request);
2392
+ // this.userService.updateUserAndParentByCode(request).subscribe((response) => {
2393
+ // // this.courseType = response.data;
2394
+ // if (response.message.code === 1) {
2395
+ // Swal.fire({
2396
+ // position: 'center',
2397
+ // icon: 'success',
2398
+ // title: 'usuario actualizado satisfactoriamente',
2399
+ // showConfirmButton: false,
2400
+ // timer: 2500,
2401
+ // });
2402
+ // // this.userUpdated = true
2403
+ // this.userUpdatedEvent.emit();
2404
+ // this.closeTable();
2405
+ // }else{
2406
+ // Swal.fire({
2407
+ // position: 'center',
2408
+ // icon: 'error',
2409
+ // title: 'Ha ocurrido un error inesperado',
2410
+ // text: response.data.message,
2411
+ // showConfirmButton: false,
2412
+ // timer: 2500,
2413
+ // });
2414
+ // // this.userUpdated = false
2415
+ // }
2416
+ // });
2417
+ // this.loader = false;
2418
+ // }
2417
2419
  hasFormChanged() {
2418
2420
  if (!this.initialFormValue || !this.DataStudent) {
2419
2421
  return false;
@@ -2649,8 +2651,8 @@ class updateUserFormComponent {
2649
2651
  });
2650
2652
  return;
2651
2653
  }
2652
- this.confirmForm.reset(); // Resetear el formulario de confirmación
2653
- this.showConfirmDialog = true; // Abrir la p-dialog
2654
+ this.confirmForm.reset();
2655
+ this.showConfirmDialog = true;
2654
2656
  }
2655
2657
  acceptConfirmDialog() {
2656
2658
  if (this.confirmForm.invalid) {
@@ -2661,7 +2663,6 @@ class updateUserFormComponent {
2661
2663
  }
2662
2664
  rejectConfirmDialog() {
2663
2665
  this.confirmForm.reset();
2664
- console.log('Confirm dialog rejected');
2665
2666
  }
2666
2667
  closeConfirmDialog() {
2667
2668
  this.showConfirmDialog = false;