iptdevs-design-system 3.1.950 → 3.1.952
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/steps/cod-form-step-two/cod-form-step-two.component.mjs +29 -21
- package/fesm2015/iptdevs-design-system.mjs +33 -24
- package/fesm2015/iptdevs-design-system.mjs.map +1 -1
- package/fesm2020/iptdevs-design-system.mjs +28 -20
- package/fesm2020/iptdevs-design-system.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -4797,10 +4797,10 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
4797
4797
|
this.hasErrors = false;
|
|
4798
4798
|
this.idTypes = [];
|
|
4799
4799
|
this.genders = [];
|
|
4800
|
-
// Controls del formulario
|
|
4801
4800
|
this.controls = new CodFormControls().controls[1];
|
|
4802
4801
|
}
|
|
4803
4802
|
ngOnChanges(changes) {
|
|
4803
|
+
console.log('ngOnChanges called, parametersAll:', this.parametersAll, 'initialData:', this.initialData);
|
|
4804
4804
|
this.initForm();
|
|
4805
4805
|
this.startLocalStorageWork();
|
|
4806
4806
|
this.validateErrors();
|
|
@@ -4818,6 +4818,7 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
4818
4818
|
}
|
|
4819
4819
|
}
|
|
4820
4820
|
setDataFromUserHistory() {
|
|
4821
|
+
console.log('setDataFromUserHistory called, id_card:', this.initialData?.id_card);
|
|
4821
4822
|
this.codFormStepTwo.controls['student_name'].setValue(this.initialData.name);
|
|
4822
4823
|
this.codFormStepTwo.controls['student_last_name'].setValue(this.initialData.last_name);
|
|
4823
4824
|
this.codFormStepTwo.controls['student_id_card_type'].setValue(this.initialData.id_card_type);
|
|
@@ -4833,9 +4834,10 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
4833
4834
|
this.codFormStepTwo.controls['student_email'].setValue(this.initialData.email);
|
|
4834
4835
|
this.codFormStepTwo.controls['password'].setValue(this.initialData.id_card);
|
|
4835
4836
|
this.codFormStepTwo.controls['re_password'].setValue(this.initialData.id_card);
|
|
4836
|
-
this.updateIdTypes(this.initialData
|
|
4837
|
+
this.updateIdTypes(this.initialData?.id_card || '');
|
|
4837
4838
|
}
|
|
4838
4839
|
setDataFromPreviusCod() {
|
|
4840
|
+
console.log('setDataFromPreviusCod called, id_card:', this.initialData?.student?.id_card); // Depuración
|
|
4839
4841
|
this.codFormStepTwo.controls['student_name'].setValue(this.initialData.student.name);
|
|
4840
4842
|
this.codFormStepTwo.controls['student_last_name'].setValue(this.initialData.student.last_name);
|
|
4841
4843
|
this.codFormStepTwo.controls['student_id_card_type'].setValue(this.initialData.student.id_card_type);
|
|
@@ -4856,13 +4858,13 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
4856
4858
|
this.codFormStepTwo.controls['student_email'].setValue(this.initialData.student.email);
|
|
4857
4859
|
this.codFormStepTwo.controls['password'].setValue(this.initialData.student.id_card);
|
|
4858
4860
|
this.codFormStepTwo.controls['re_password'].setValue(this.initialData.student.id_card);
|
|
4859
|
-
this.updateIdTypes(this.initialData
|
|
4861
|
+
this.updateIdTypes(this.initialData?.student?.id_card || '');
|
|
4860
4862
|
}
|
|
4861
4863
|
cleanComponent() {
|
|
4862
4864
|
this.resetLocalStorage(this.controls);
|
|
4863
4865
|
this.codFormStepTwo.reset();
|
|
4864
|
-
this.idTypes = [...(this.parametersAll?.TypeIdCardByCountryCol || [])];
|
|
4865
|
-
console.log('idTypes after clean:', this.idTypes);
|
|
4866
|
+
this.idTypes = [...(this.parametersAll?.TypeIdCardByCountryCol || [])];
|
|
4867
|
+
console.log('idTypes after clean:', this.idTypes);
|
|
4866
4868
|
}
|
|
4867
4869
|
validateErrors() {
|
|
4868
4870
|
this.codFormStepTwo.valueChanges.subscribe(changes => {
|
|
@@ -4921,7 +4923,6 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
4921
4923
|
this.codFormStepTwo.patchValue({
|
|
4922
4924
|
birthdate: currentDate
|
|
4923
4925
|
});
|
|
4924
|
-
// Calcular edad y setear valor
|
|
4925
4926
|
this.codFormStepTwo.controls['birthdate'].valueChanges.subscribe({
|
|
4926
4927
|
next: (change) => {
|
|
4927
4928
|
let today = new Date();
|
|
@@ -4943,8 +4944,14 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
4943
4944
|
});
|
|
4944
4945
|
}
|
|
4945
4946
|
getParameters() {
|
|
4946
|
-
|
|
4947
|
-
|
|
4947
|
+
if (this.parametersAll?.TypeIdCardByCountryCol) {
|
|
4948
|
+
this.idTypes = [...this.parametersAll.TypeIdCardByCountryCol];
|
|
4949
|
+
console.log('Initial idTypes:', this.idTypes);
|
|
4950
|
+
}
|
|
4951
|
+
else {
|
|
4952
|
+
this.idTypes = [];
|
|
4953
|
+
console.log('TypeIdCardByCountryCol is undefined');
|
|
4954
|
+
}
|
|
4948
4955
|
this.indicatives = this.parametersAll?.indicatives;
|
|
4949
4956
|
this.countries = this.parametersAll?.country;
|
|
4950
4957
|
this.stratums = this.parametersAll?.stratum;
|
|
@@ -5067,28 +5074,29 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
5067
5074
|
}
|
|
5068
5075
|
}
|
|
5069
5076
|
trackStudentIdCardChanges() {
|
|
5070
|
-
console.log('trackStudentIdCardChanges called');
|
|
5071
|
-
const
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5077
|
+
console.log('trackStudentIdCardChanges called');
|
|
5078
|
+
const controlOne = this.codFormStepTwo.get('student_id_card');
|
|
5079
|
+
console.log('control 1', controlOne);
|
|
5080
|
+
this.updateIdTypes(controlOne?.value || '');
|
|
5081
|
+
const controlTwo = localStorage.getItem('COD FORM - step2(student_id_card)');
|
|
5082
|
+
console.log('control 2', controlTwo);
|
|
5083
|
+
this.updateIdTypes(controlTwo || '');
|
|
5076
5084
|
}
|
|
5077
5085
|
updateIdTypes(value) {
|
|
5078
|
-
console.log('updateIdTypes called with value:', value);
|
|
5086
|
+
console.log('updateIdTypes called with value:', value);
|
|
5079
5087
|
if (this.parametersAll?.TypeIdCardByCountryCol) {
|
|
5080
5088
|
if (value && /[a-zA-Z]/.test(value)) {
|
|
5081
|
-
console.log('Contains letters, filtering idTypes');
|
|
5089
|
+
console.log('Contains letters, filtering idTypes');
|
|
5082
5090
|
this.idTypes = this.parametersAll.TypeIdCardByCountryCol.filter((_, index) => ![0, 1, 2, 7].includes(index));
|
|
5083
5091
|
}
|
|
5084
5092
|
else {
|
|
5085
|
-
console.log('No letters, restoring idTypes');
|
|
5086
|
-
this.idTypes = [...this.parametersAll.TypeIdCardByCountryCol];
|
|
5093
|
+
console.log('No letters, restoring idTypes');
|
|
5094
|
+
this.idTypes = [...this.parametersAll.TypeIdCardByCountryCol];
|
|
5087
5095
|
}
|
|
5088
|
-
console.log('Current idTypes:', this.idTypes);
|
|
5096
|
+
console.log('Current idTypes:', this.idTypes);
|
|
5089
5097
|
}
|
|
5090
5098
|
else {
|
|
5091
|
-
console.log('TypeIdCardByCountryCol is undefined');
|
|
5099
|
+
console.log('TypeIdCardByCountryCol is undefined');
|
|
5092
5100
|
this.idTypes = [];
|
|
5093
5101
|
}
|
|
5094
5102
|
}
|