iptdevs-design-system 3.1.855 → 3.1.857

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.
@@ -3849,36 +3849,32 @@ class CodFormStepOneComponent extends CodFormSteps {
3849
3849
  // });
3850
3850
  // }
3851
3851
  getCourseType(plan) {
3852
- // Imprimir el valor de plan para confirmar qué se recibe
3853
- console.log('Plan recibido:', plan, 'Tipo:', typeof plan);
3854
- // Verificar si parametersAll y courseType existen
3852
+ const planNumber = typeof plan === 'string' ? parseInt(plan, 10) : plan;
3855
3853
  if (this.parametersAll && this.parametersAll?.courseType) {
3856
- // Imprimir los datos de courseType para inspeccionar su contenido
3857
- console.log('Datos en parametersAll.courseType:', this.parametersAll.courseType);
3858
- // Filtrar los elementos donde academic_plan coincida con plan
3859
3854
  this.course_type = this.parametersAll.courseType.filter((course) => {
3860
- // Convertir academic_plan a número si es una cadena
3861
3855
  const academicPlan = typeof course.academic_plan === 'string'
3862
3856
  ? parseInt(course.academic_plan, 10)
3863
3857
  : course.academic_plan;
3864
- // Imprimir cada comparación para depurar
3865
- console.log('Comparando course.academic_plan:', course.academic_plan, 'con plan:', plan, 'Resultado:', academicPlan === plan);
3866
- return academicPlan === plan;
3858
+ return academicPlan === planNumber;
3867
3859
  });
3868
- // Imprimir el resultado del filtro
3869
- console.log('course_type AsignForPlan:', this.course_type);
3870
3860
  }
3871
3861
  else {
3872
- // Si no hay datos, asignar un arreglo vacío
3873
3862
  this.course_type = [];
3874
- console.warn('parametersAll.courseType no está definido o vacío');
3875
3863
  }
3876
3864
  }
3877
3865
  getAgreementByPlan(plan) {
3878
- // this.parameterService.getAgreementByCategory(plan).subscribe((response) => {
3879
- // this.agreements = response.data;
3880
- // });
3881
- this.parametersAll?.courseType;
3866
+ const planNumber = typeof plan === 'string' ? parseInt(plan, 10) : plan;
3867
+ if (this.parametersAll && this.parametersAll?.agreement) {
3868
+ this.course_type = this.parametersAll.agreement.filter((course) => {
3869
+ const academicPlan = typeof course.category === 'string'
3870
+ ? parseInt(course.category, 10)
3871
+ : course.category;
3872
+ return academicPlan === planNumber;
3873
+ });
3874
+ }
3875
+ else {
3876
+ this.course_type = [];
3877
+ }
3882
3878
  }
3883
3879
  selectCoursesTypesByPlan(coursesTypes) {
3884
3880
  if (coursesTypes !== 'Tipo de plan') {
@@ -4139,38 +4135,60 @@ class CodFormStepTwoComponent extends CodFormSteps {
4139
4135
  }
4140
4136
  });
4141
4137
  }
4138
+ // getParameters() {
4139
+ // this.parameterService.getCardTypes('col').subscribe((response) => {
4140
+ // this.idTypes = response.data;
4141
+ // });
4142
+ // this.parameterService.getIndicatives().subscribe((response) => {
4143
+ // this.indicatives = response.data;
4144
+ // });
4145
+ // this.parameterService.getCountries().subscribe((response) => {
4146
+ // this.countries = response.data;
4147
+ // });
4148
+ // this.parameterService.getStratums().subscribe((response) => {
4149
+ // this.stratums = response.data;
4150
+ // });
4151
+ // this.parameterService.getCivilStatus().subscribe((response) => {
4152
+ // this.civilStatus = response.data;
4153
+ // });
4154
+ // this.parameterService.getAllCities().subscribe((response) => {
4155
+ // this.cities = response.data;
4156
+ // });
4157
+ // this.parameterService.getAllStates().subscribe((response) => {
4158
+ // this.states = response.data;
4159
+ // });
4160
+ // this.parameterService.getGenders().pipe(
4161
+ // map((response: any) => response.data)
4162
+ // )
4163
+ // .subscribe((genders: any[]) => {
4164
+ // genders.forEach(gender => {
4165
+ // let genderItem = {
4166
+ // code: gender.code,
4167
+ // name: gender.name_spanish
4168
+ // }
4169
+ // this.genders.push(genderItem)
4170
+ // })
4171
+ // })
4172
+ // }
4142
4173
  getParameters() {
4143
- this.parameterService.getCardTypes('col').subscribe((response) => {
4144
- this.idTypes = response.data;
4145
- });
4146
- this.parameterService.getIndicatives().subscribe((response) => {
4147
- this.indicatives = response.data;
4148
- });
4149
- this.parameterService.getCountries().subscribe((response) => {
4150
- this.countries = response.data;
4151
- });
4152
- this.parameterService.getStratums().subscribe((response) => {
4153
- this.stratums = response.data;
4154
- });
4155
- this.parameterService.getCivilStatus().subscribe((response) => {
4156
- this.civilStatus = response.data;
4157
- });
4158
- this.parameterService.getAllCities().subscribe((response) => {
4159
- this.cities = response.data;
4160
- });
4161
- this.parameterService.getAllStates().subscribe((response) => {
4162
- this.states = response.data;
4163
- });
4164
- this.parameterService.getGenders().pipe(map((response) => response.data))
4165
- .subscribe((genders) => {
4166
- genders.forEach(gender => {
4167
- let genderItem = {
4168
- code: gender.code,
4169
- name: gender.name_spanish
4170
- };
4171
- this.genders.push(genderItem);
4172
- });
4173
- });
4174
+ this.idTypes = this.parametersAll?.TypeIdCardByCountryCol;
4175
+ this.indicatives = this.parametersAll?.indicatives;
4176
+ this.countries = this.parametersAll?.country;
4177
+ this.stratums = this.parametersAll?.stratum;
4178
+ this.civilStatus = this.parametersAll?.civilStatus;
4179
+ this.cities = this.parametersAll?.city;
4180
+ this.states = this.parametersAll?.State;
4181
+ // this.genders =this.parametersAll?.gender;
4182
+ if (this.parametersAll && this.parametersAll.gender) {
4183
+ // Transformar gender en un arreglo de { code, name }
4184
+ this.genders = this.parametersAll.gender.map((gender) => ({
4185
+ code: gender.code,
4186
+ name: gender.name_spanish
4187
+ }));
4188
+ }
4189
+ else {
4190
+ this.genders = [];
4191
+ }
4174
4192
  }
4175
4193
  sendForm() {
4176
4194
  this.codFormStepTwo.markAllAsTouched();