iptdevs-design-system 3.1.880 → 3.1.882
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/cod/cod-form/cod-form.component.mjs +1 -1
- package/esm2020/lib/cod/steps/cod-form-step-one/cod-form-step-one.component.mjs +88 -25
- package/fesm2015/iptdevs-design-system.mjs +88 -24
- package/fesm2015/iptdevs-design-system.mjs.map +1 -1
- package/fesm2020/iptdevs-design-system.mjs +87 -24
- package/fesm2020/iptdevs-design-system.mjs.map +1 -1
- package/lib/cod/steps/cod-form-step-one/cod-form-step-one.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -3695,33 +3695,90 @@ class CodFormStepOneComponent extends CodFormSteps {
|
|
|
3695
3695
|
this.codFormStepOne.controls['course_type'].valueChanges
|
|
3696
3696
|
.subscribe(value => this.communicatorService.setCurrentCourseType(value));
|
|
3697
3697
|
this.communicatorService.setCurrentAgreement(this.localStorageCOD.getCodFormData(1, 'agreement_by_category'));
|
|
3698
|
-
|
|
3698
|
+
console.log('Changes detected:', changes);
|
|
3699
|
+
console.log("this.initialData", this.initialData);
|
|
3700
|
+
console.log("this.dataPreviusCodData", this.dataPreviusCodData);
|
|
3701
|
+
console.log("this.isEditCod", this.isEditCod);
|
|
3702
|
+
console.log("this.isRenovation", this.isRenovation);
|
|
3703
|
+
// Lógica principal de cambios
|
|
3704
|
+
if (changes['initialData'] || changes['dataPreviusCodData']) {
|
|
3705
|
+
this.handleDataChanges(changes);
|
|
3706
|
+
}
|
|
3707
|
+
this.cdRef.detectChanges();
|
|
3708
|
+
// const shouldProcessInitialData = changes['initialData'] &&
|
|
3709
|
+
// this.initialData != null &&
|
|
3710
|
+
// this.dataPreviusCodData === null;
|
|
3711
|
+
// const shouldProcessPreviusData = this.dataPreviusCodData != null &&
|
|
3712
|
+
// this.isEditCod === false &&
|
|
3713
|
+
// this.isRenovation === false;
|
|
3714
|
+
// if (shouldProcessInitialData || shouldProcessPreviusData) {
|
|
3715
|
+
// this.processData(this.initialData);
|
|
3716
|
+
// this.cdRef.detectChanges();
|
|
3717
|
+
// console.log("Entro en this.processData con initialData");
|
|
3718
|
+
// } else {
|
|
3719
|
+
// // Manejo más controlado del "else"
|
|
3720
|
+
// console.log("entre en el else que borra todo en null");
|
|
3721
|
+
// this.codFormStepOne.controls['academic_plan'].setValue(null);
|
|
3722
|
+
// this.codFormStepOne.controls['course_type'].setValue(null);
|
|
3723
|
+
// this.codFormStepOne.controls['agreement_by_category'].setValue(null);
|
|
3724
|
+
// this.codFormStepOne.controls['english_level'].setValue(null);
|
|
3725
|
+
// this.codFormStepOne.controls['availible_courses'].setValue(null);
|
|
3726
|
+
// this.codFormStepOne.controls['course_modality'].setValue(null);
|
|
3727
|
+
// }
|
|
3728
|
+
// if (changes['initialData'] && this.initialData != null && this.dataPreviusCodData === null || this.dataPreviusCodData != null && this.isEditCod === false && this.isRenovation === false) {
|
|
3729
|
+
// this.processData(this.initialData);
|
|
3730
|
+
// console.log("Entro en this.processData con initialData");
|
|
3731
|
+
// this.cdRef.detectChanges();
|
|
3732
|
+
// }else{
|
|
3733
|
+
// this.codFormStepOne.controls['academic_plan'].setValue(null);
|
|
3734
|
+
// this.codFormStepOne.controls['course_type'].setValue(null);
|
|
3735
|
+
// this.codFormStepOne.controls['agreement_by_category'].setValue(null);
|
|
3736
|
+
// this.codFormStepOne.controls['english_level'].setValue(null);
|
|
3737
|
+
// this.codFormStepOne.controls['availible_courses'].setValue(null);
|
|
3738
|
+
// this.codFormStepOne.controls['course_modality'].setValue(null);
|
|
3739
|
+
// }
|
|
3740
|
+
// if (changes['dataPreviusCodData'] && this.dataPreviusCodData != null && this.isEditCod && this.isRenovation === false ) {
|
|
3741
|
+
// this.processData(this.dataPreviusCodData);
|
|
3742
|
+
// console.log("Entro en this.processData con dataPreviusCodData");
|
|
3743
|
+
// if (this.isEditCod && !this.dataPreviusCodData.edit_course_payment) {
|
|
3744
|
+
// this.isDisabledSel = true;
|
|
3745
|
+
// } else {
|
|
3746
|
+
// this.isDisabledSel = false;
|
|
3747
|
+
// }
|
|
3748
|
+
// this.cdRef.detectChanges();
|
|
3749
|
+
// }else if(changes['dataPreviusCodData'] && this.dataPreviusCodData != null && !this.isEditCod && this.courseSelectRenovation && this.isRenovation === true ){
|
|
3750
|
+
// this.setDataCodRenovationSelect();
|
|
3751
|
+
// this.isDisabledSel= true
|
|
3752
|
+
// this.cdRef.detectChanges();
|
|
3753
|
+
// }
|
|
3754
|
+
}
|
|
3755
|
+
handleDataChanges(changes) {
|
|
3756
|
+
// Caso 1: Hay initialData y NO hay dataPreviusCodData
|
|
3757
|
+
if (changes['initialData']?.currentValue && !this.dataPreviusCodData) {
|
|
3758
|
+
console.log("Procesando initialData");
|
|
3699
3759
|
this.processData(this.initialData);
|
|
3700
|
-
|
|
3701
|
-
}
|
|
3702
|
-
else {
|
|
3703
|
-
this.codFormStepOne.controls['academic_plan'].setValue(null);
|
|
3704
|
-
this.codFormStepOne.controls['course_type'].setValue(null);
|
|
3705
|
-
this.codFormStepOne.controls['agreement_by_category'].setValue(null);
|
|
3706
|
-
this.codFormStepOne.controls['english_level'].setValue(null);
|
|
3707
|
-
this.codFormStepOne.controls['availible_courses'].setValue(null);
|
|
3708
|
-
this.codFormStepOne.controls['course_modality'].setValue(null);
|
|
3760
|
+
return;
|
|
3709
3761
|
}
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3762
|
+
// Caso 2: Hay dataPreviusCodData
|
|
3763
|
+
if (changes['dataPreviusCodData']?.currentValue) {
|
|
3764
|
+
// Subcaso 2.1: Es edición
|
|
3765
|
+
if (this.isEditCod && !this.isRenovation) {
|
|
3766
|
+
console.log("Procesando dataPreviusCodData en modo edición");
|
|
3767
|
+
this.processData(this.dataPreviusCodData);
|
|
3768
|
+
this.isDisabledSel = !this.dataPreviusCodData.edit_course_payment;
|
|
3769
|
+
return;
|
|
3714
3770
|
}
|
|
3715
|
-
|
|
3716
|
-
|
|
3771
|
+
// Subcaso 2.2: Es renovación
|
|
3772
|
+
if (!this.isEditCod && this.isRenovation && this.courseSelectRenovation) {
|
|
3773
|
+
console.log("Procesando dataPreviusCodData en modo renovación");
|
|
3774
|
+
this.setDataCodRenovationSelect();
|
|
3775
|
+
this.isDisabledSel = true;
|
|
3776
|
+
return;
|
|
3717
3777
|
}
|
|
3718
|
-
this.cdRef.detectChanges();
|
|
3719
|
-
}
|
|
3720
|
-
else if (changes['dataPreviusCodData'] && this.dataPreviusCodData != null && !this.isEditCod && this.courseSelectRenovation && this.isRenovation === true) {
|
|
3721
|
-
this.setDataCodRenovationSelect();
|
|
3722
|
-
this.isDisabledSel = true;
|
|
3723
|
-
this.cdRef.detectChanges();
|
|
3724
3778
|
}
|
|
3779
|
+
// Caso 3: Ninguna condición anterior se cumplió (reset controlado)
|
|
3780
|
+
console.log("Reseteando formulario (condición no reconocida)");
|
|
3781
|
+
this.resetForm();
|
|
3725
3782
|
}
|
|
3726
3783
|
processData(data) {
|
|
3727
3784
|
const { codFormStepOne } = this;
|
|
@@ -3822,8 +3879,14 @@ class CodFormStepOneComponent extends CodFormSteps {
|
|
|
3822
3879
|
this.changeStepEvent.emit(1);
|
|
3823
3880
|
}
|
|
3824
3881
|
resetForm() {
|
|
3825
|
-
this.resetLocalStorage(this.controls);
|
|
3826
|
-
this.codFormStepOne.reset();
|
|
3882
|
+
// this.resetLocalStorage(this.controls);
|
|
3883
|
+
// this.codFormStepOne.reset();
|
|
3884
|
+
this.codFormStepOne.controls['academic_plan'].setValue(null);
|
|
3885
|
+
this.codFormStepOne.controls['course_type'].setValue(null);
|
|
3886
|
+
this.codFormStepOne.controls['agreement_by_category'].setValue(null);
|
|
3887
|
+
this.codFormStepOne.controls['english_level'].setValue(null);
|
|
3888
|
+
this.codFormStepOne.controls['availible_courses'].setValue(null);
|
|
3889
|
+
this.codFormStepOne.controls['course_modality'].setValue(null);
|
|
3827
3890
|
}
|
|
3828
3891
|
// Eventos de los selects
|
|
3829
3892
|
selectAcademicPlan(academic_plan) {
|