iptdevs-design-system 3.2.1 → 3.2.2
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 +8 -88
- package/fesm2015/iptdevs-design-system.mjs +7 -87
- package/fesm2015/iptdevs-design-system.mjs.map +1 -1
- package/fesm2020/iptdevs-design-system.mjs +7 -87
- package/fesm2020/iptdevs-design-system.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1888,7 +1888,6 @@ class updateUserFormComponent {
|
|
|
1888
1888
|
this.stratums = [];
|
|
1889
1889
|
this.showConfirmDialog = false;
|
|
1890
1890
|
this.userRoleCommercial = false;
|
|
1891
|
-
// userUpdated = false;
|
|
1892
1891
|
this.initialFormValue = [];
|
|
1893
1892
|
this.pendingInit = false;
|
|
1894
1893
|
this.isStudent = false;
|
|
@@ -2234,7 +2233,7 @@ class updateUserFormComponent {
|
|
|
2234
2233
|
Validators.required,
|
|
2235
2234
|
Validators.minLength(5),
|
|
2236
2235
|
Validators.maxLength(20),
|
|
2237
|
-
Validators.pattern(/^[a-zA-Z0-9]*$/)
|
|
2236
|
+
Validators.pattern(/^[a-zA-Z0-9]*$/)
|
|
2238
2237
|
]);
|
|
2239
2238
|
}
|
|
2240
2239
|
else {
|
|
@@ -2242,7 +2241,7 @@ class updateUserFormComponent {
|
|
|
2242
2241
|
Validators.required,
|
|
2243
2242
|
Validators.minLength(5),
|
|
2244
2243
|
Validators.maxLength(20),
|
|
2245
|
-
Validators.pattern(/^[0-9]*$/)
|
|
2244
|
+
Validators.pattern(/^[0-9]*$/)
|
|
2246
2245
|
]);
|
|
2247
2246
|
}
|
|
2248
2247
|
idCardControl.updateValueAndValidity();
|
|
@@ -2352,84 +2351,6 @@ class updateUserFormComponent {
|
|
|
2352
2351
|
selectReason(reason) {
|
|
2353
2352
|
this.confirmForm.controls['reason'].setValue(reason ? reason : null);
|
|
2354
2353
|
}
|
|
2355
|
-
// updateUser(): void {
|
|
2356
|
-
// if (
|
|
2357
|
-
// this.updateUserForm.invalid ||
|
|
2358
|
-
// this.updateUserForm.hasError('mismatch') ||
|
|
2359
|
-
// !this.hasFormChanged()
|
|
2360
|
-
// ) {
|
|
2361
|
-
// this.updateUserForm.markAllAsTouched();
|
|
2362
|
-
// console.log('createUser - Validation failed:', {
|
|
2363
|
-
// invalid: this.updateUserForm.invalid,
|
|
2364
|
-
// mismatch: this.updateUserForm.hasError('mismatch'),
|
|
2365
|
-
// hasChanges: this.hasFormChanged()
|
|
2366
|
-
// });
|
|
2367
|
-
// return;
|
|
2368
|
-
// }
|
|
2369
|
-
// this.loader = true;
|
|
2370
|
-
// const formValue = this.updateUserForm.getRawValue();
|
|
2371
|
-
// const request:any = {
|
|
2372
|
-
// token: this.baseService.getUserToken(),
|
|
2373
|
-
// user: {
|
|
2374
|
-
// code: this.DataStudent.code,
|
|
2375
|
-
// name: formValue.name,
|
|
2376
|
-
// last_name: formValue.last_name,
|
|
2377
|
-
// id_card_type: formValue.id_card_type,
|
|
2378
|
-
// id_card: formValue.id_card,
|
|
2379
|
-
// phone_indicative: formValue.phone_indicative,
|
|
2380
|
-
// phone_number: formValue.phone_number,
|
|
2381
|
-
// email: formValue.email,
|
|
2382
|
-
// gender: formValue.gender,
|
|
2383
|
-
// city: formValue.city,
|
|
2384
|
-
// service_hour: formValue.service_hour,
|
|
2385
|
-
// role: this.DataStudent.role,
|
|
2386
|
-
// status: formValue.status,
|
|
2387
|
-
// ...(this.showEmailIpt ? { email_ipt: formValue.email_ipt } : {}),
|
|
2388
|
-
// ...(formValue.changePassword && formValue.password ? { password: formValue.password } : {})
|
|
2389
|
-
// },
|
|
2390
|
-
// parent: this.showParentSection
|
|
2391
|
-
// ? {
|
|
2392
|
-
// code: this.DataStudent.cods?.parent?.code || null,
|
|
2393
|
-
// name: formValue.parent_name || null,
|
|
2394
|
-
// last_name: formValue.parent_last_name || null,
|
|
2395
|
-
// id_card_type: formValue.parent_id_card_type || null,
|
|
2396
|
-
// id_card: formValue.parent_id_card || null,
|
|
2397
|
-
// phone_indicative: formValue.parent_phone_indicative || null,
|
|
2398
|
-
// phone_number: formValue.parent_phone_number || null,
|
|
2399
|
-
// occupation: formValue.parent_occupation || null,
|
|
2400
|
-
// office_adrress: formValue.parent_office_adrress || null,
|
|
2401
|
-
// email: formValue.parent_email || null
|
|
2402
|
-
// }
|
|
2403
|
-
// : null
|
|
2404
|
-
// };
|
|
2405
|
-
// console.log(request);
|
|
2406
|
-
// this.userService.updateUserAndParentByCode(request).subscribe((response) => {
|
|
2407
|
-
// // this.courseType = response.data;
|
|
2408
|
-
// if (response.message.code === 1) {
|
|
2409
|
-
// Swal.fire({
|
|
2410
|
-
// position: 'center',
|
|
2411
|
-
// icon: 'success',
|
|
2412
|
-
// title: 'usuario actualizado satisfactoriamente',
|
|
2413
|
-
// showConfirmButton: false,
|
|
2414
|
-
// timer: 2500,
|
|
2415
|
-
// });
|
|
2416
|
-
// // this.userUpdated = true
|
|
2417
|
-
// this.userUpdatedEvent.emit();
|
|
2418
|
-
// this.closeTable();
|
|
2419
|
-
// }else{
|
|
2420
|
-
// Swal.fire({
|
|
2421
|
-
// position: 'center',
|
|
2422
|
-
// icon: 'error',
|
|
2423
|
-
// title: 'Ha ocurrido un error inesperado',
|
|
2424
|
-
// text: response.data.message,
|
|
2425
|
-
// showConfirmButton: false,
|
|
2426
|
-
// timer: 2500,
|
|
2427
|
-
// });
|
|
2428
|
-
// // this.userUpdated = false
|
|
2429
|
-
// }
|
|
2430
|
-
// });
|
|
2431
|
-
// this.loader = false;
|
|
2432
|
-
// }
|
|
2433
2354
|
hasFormChanged() {
|
|
2434
2355
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
2435
2356
|
if (!this.initialFormValue || !this.DataStudent) {
|
|
@@ -2600,7 +2521,6 @@ class updateUserFormComponent {
|
|
|
2600
2521
|
reason: confirmValue.reason,
|
|
2601
2522
|
observation: confirmValue.observation,
|
|
2602
2523
|
};
|
|
2603
|
-
console.log(request);
|
|
2604
2524
|
this.userService.updateUserByCode(request).subscribe({
|
|
2605
2525
|
next: (response) => {
|
|
2606
2526
|
if (response.message.code === 1) {
|
|
@@ -2614,12 +2534,12 @@ class updateUserFormComponent {
|
|
|
2614
2534
|
this.userUpdatedEvent.emit();
|
|
2615
2535
|
this.closeTable();
|
|
2616
2536
|
}
|
|
2617
|
-
else {
|
|
2537
|
+
else if (response.message.code === 3) {
|
|
2618
2538
|
Swal.fire({
|
|
2619
2539
|
position: 'center',
|
|
2620
|
-
icon: '
|
|
2621
|
-
title:
|
|
2622
|
-
text: response.data.
|
|
2540
|
+
icon: 'warning',
|
|
2541
|
+
title: response.data.message,
|
|
2542
|
+
text: response.data.errors,
|
|
2623
2543
|
showConfirmButton: false,
|
|
2624
2544
|
timer: 2500,
|
|
2625
2545
|
});
|
|
@@ -2631,7 +2551,7 @@ class updateUserFormComponent {
|
|
|
2631
2551
|
Swal.fire({
|
|
2632
2552
|
position: 'center',
|
|
2633
2553
|
icon: 'error',
|
|
2634
|
-
title: '
|
|
2554
|
+
title: 'Ha ocurrido un error inesperado',
|
|
2635
2555
|
showConfirmButton: false,
|
|
2636
2556
|
timer: 2500,
|
|
2637
2557
|
});
|