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
|
@@ -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
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
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
|
-
|
|
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();
|
|
2653
|
-
this.showConfirmDialog = true;
|
|
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;
|