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.
@@ -1930,7 +1930,7 @@ class updateUserFormComponent {
1930
1930
  initConfirmForm() {
1931
1931
  this.confirmForm = this.fb.group({
1932
1932
  reason: [null, Validators.required],
1933
- observation: ['', Validators.required, Validators.maxLength(250)]
1933
+ observation: ['', [Validators.required, Validators.maxLength(250)]]
1934
1934
  });
1935
1935
  }
1936
1936
  setJustifyOptions() {
@@ -2195,6 +2195,7 @@ class updateUserFormComponent {
2195
2195
  closeTable() {
2196
2196
  this.visibleModal = false;
2197
2197
  this.showConfirmDialog = false;
2198
+ this.confirmForm.reset();
2198
2199
  this.updateUserForm.reset();
2199
2200
  this.idTypes = [];
2200
2201
  this.countries = [];
@@ -2352,68 +2353,84 @@ class updateUserFormComponent {
2352
2353
  if (type === 'treasure')
2353
2354
  this.photo = '/platform/treasure/assets/administrativo.jpg';
2354
2355
  }
2355
- updateUser() {
2356
- var _a, _b;
2357
- if (this.updateUserForm.invalid ||
2358
- this.updateUserForm.hasError('mismatch') ||
2359
- !this.hasFormChanged()) {
2360
- this.updateUserForm.markAllAsTouched();
2361
- console.log('createUser - Validation failed:', {
2362
- invalid: this.updateUserForm.invalid,
2363
- mismatch: this.updateUserForm.hasError('mismatch'),
2364
- hasChanges: this.hasFormChanged()
2365
- });
2366
- return;
2367
- }
2368
- this.loader = true;
2369
- const formValue = this.updateUserForm.getRawValue();
2370
- const request = {
2371
- token: this.baseService.getUserToken(),
2372
- user: Object.assign(Object.assign({ code: this.DataStudent.code, name: formValue.name, last_name: formValue.last_name, id_card_type: formValue.id_card_type, id_card: formValue.id_card, phone_indicative: formValue.phone_indicative, phone_number: formValue.phone_number, email: formValue.email, gender: formValue.gender, city: formValue.city, service_hour: formValue.service_hour, role: this.DataStudent.role, status: formValue.status }, (this.showEmailIpt ? { email_ipt: formValue.email_ipt } : {})), (formValue.changePassword && formValue.password ? { password: formValue.password } : {})),
2373
- parent: this.showParentSection
2374
- ? {
2375
- code: ((_b = (_a = this.DataStudent.cods) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.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
- }
2356
+ // updateUser(): void {
2357
+ // if (
2358
+ // this.updateUserForm.invalid ||
2359
+ // this.updateUserForm.hasError('mismatch') ||
2360
+ // !this.hasFormChanged()
2361
+ // ) {
2362
+ // this.updateUserForm.markAllAsTouched();
2363
+ // console.log('createUser - Validation failed:', {
2364
+ // invalid: this.updateUserForm.invalid,
2365
+ // mismatch: this.updateUserForm.hasError('mismatch'),
2366
+ // hasChanges: this.hasFormChanged()
2367
+ // });
2368
+ // return;
2369
+ // }
2370
+ // this.loader = true;
2371
+ // const formValue = this.updateUserForm.getRawValue();
2372
+ // const request:any = {
2373
+ // token: this.baseService.getUserToken(),
2374
+ // user: {
2375
+ // code: this.DataStudent.code,
2376
+ // name: formValue.name,
2377
+ // last_name: formValue.last_name,
2378
+ // id_card_type: formValue.id_card_type,
2379
+ // id_card: formValue.id_card,
2380
+ // phone_indicative: formValue.phone_indicative,
2381
+ // phone_number: formValue.phone_number,
2382
+ // email: formValue.email,
2383
+ // gender: formValue.gender,
2384
+ // city: formValue.city,
2385
+ // service_hour: formValue.service_hour,
2386
+ // role: this.DataStudent.role,
2387
+ // status: formValue.status,
2388
+ // ...(this.showEmailIpt ? { email_ipt: formValue.email_ipt } : {}),
2389
+ // ...(formValue.changePassword && formValue.password ? { password: formValue.password } : {})
2390
+ // },
2391
+ // parent: this.showParentSection
2392
+ // ? {
2393
+ // code: this.DataStudent.cods?.parent?.code || null,
2394
+ // name: formValue.parent_name || null,
2395
+ // last_name: formValue.parent_last_name || null,
2396
+ // id_card_type: formValue.parent_id_card_type || null,
2397
+ // id_card: formValue.parent_id_card || null,
2398
+ // phone_indicative: formValue.parent_phone_indicative || null,
2399
+ // phone_number: formValue.parent_phone_number || null,
2400
+ // occupation: formValue.parent_occupation || null,
2401
+ // office_adrress: formValue.parent_office_adrress || null,
2402
+ // email: formValue.parent_email || null
2403
+ // }
2404
+ // : null
2405
+ // };
2406
+ // console.log(request);
2407
+ // this.userService.updateUserAndParentByCode(request).subscribe((response) => {
2408
+ // // this.courseType = response.data;
2409
+ // if (response.message.code === 1) {
2410
+ // Swal.fire({
2411
+ // position: 'center',
2412
+ // icon: 'success',
2413
+ // title: 'usuario actualizado satisfactoriamente',
2414
+ // showConfirmButton: false,
2415
+ // timer: 2500,
2416
+ // });
2417
+ // // this.userUpdated = true
2418
+ // this.userUpdatedEvent.emit();
2419
+ // this.closeTable();
2420
+ // }else{
2421
+ // Swal.fire({
2422
+ // position: 'center',
2423
+ // icon: 'error',
2424
+ // title: 'Ha ocurrido un error inesperado',
2425
+ // text: response.data.message,
2426
+ // showConfirmButton: false,
2427
+ // timer: 2500,
2428
+ // });
2429
+ // // this.userUpdated = false
2430
+ // }
2431
+ // });
2432
+ // this.loader = false;
2433
+ // }
2417
2434
  hasFormChanged() {
2418
2435
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
2419
2436
  if (!this.initialFormValue || !this.DataStudent) {
@@ -2635,8 +2652,8 @@ class updateUserFormComponent {
2635
2652
  });
2636
2653
  return;
2637
2654
  }
2638
- this.confirmForm.reset(); // Resetear el formulario de confirmación
2639
- this.showConfirmDialog = true; // Abrir la p-dialog
2655
+ this.confirmForm.reset();
2656
+ this.showConfirmDialog = true;
2640
2657
  }
2641
2658
  acceptConfirmDialog() {
2642
2659
  if (this.confirmForm.invalid) {
@@ -2647,7 +2664,6 @@ class updateUserFormComponent {
2647
2664
  }
2648
2665
  rejectConfirmDialog() {
2649
2666
  this.confirmForm.reset();
2650
- console.log('Confirm dialog rejected');
2651
2667
  }
2652
2668
  closeConfirmDialog() {
2653
2669
  var _a, _b;