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.
- package/esm2020/lib/components/forms/update-user-form/update-user-form.component.mjs +83 -82
- package/fesm2015/iptdevs-design-system.mjs +82 -66
- package/fesm2015/iptdevs-design-system.mjs.map +1 -1
- package/fesm2020/iptdevs-design-system.mjs +82 -81
- package/fesm2020/iptdevs-design-system.mjs.map +1 -1
- package/lib/components/forms/update-user-form/update-user-form.component.d.ts +0 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
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();
|
|
2639
|
-
this.showConfirmDialog = true;
|
|
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;
|