iptdevs-design-system 3.1.239 → 3.1.241

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.
@@ -3138,29 +3138,33 @@ class CodFormStepOneComponent extends CodFormSteps {
3138
3138
  this.codFormStepOne.controls['course_type'].valueChanges
3139
3139
  .subscribe(value => this.communicatorService.setCurrentCourseType(value));
3140
3140
  this.communicatorService.setCurrentAgreement(this.localStorageCOD.getCodFormData(1, 'agreement_by_category'));
3141
- if (changes['initialData']) {
3142
- if (this.initialData != null) {
3143
- this.getAgreementByPlan(this.initialData.course_type.academic_plan.code);
3144
- this.getCourseType(this.initialData.course_type.academic_plan.code);
3145
- this.codFormStepOne.controls['english_level'].setValue(this.initialData.english_level.code);
3146
- this.codFormStepOne.controls['agreement_by_category'].setValue(this.initialData.agreement.code);
3147
- this.codFormStepOne.controls['course_type'].setValue(this.initialData.course_type.code);
3148
- this.getAvailibleCourses();
3149
- this.setDataFromUserHistory();
3150
- }
3141
+ if (changes['initialData'] && this.initialData != null) {
3142
+ this.processData(this.initialData);
3151
3143
  }
3152
- if (changes['dataPreviusCodData']) {
3153
- if (this.dataPreviusCodData != null) {
3154
- this.getAgreementByPlan(this.dataPreviusCodData.course_type.academic_plan.code);
3155
- this.getCourseType(this.dataPreviusCodData.course_type.academic_plan.code);
3156
- this.codFormStepOne.controls['english_level'].setValue(this.dataPreviusCodData.english_level.code);
3157
- this.codFormStepOne.controls['agreement_by_category'].setValue(this.dataPreviusCodData.agreement.code);
3158
- this.codFormStepOne.controls['course_type'].setValue(this.dataPreviusCodData.course_type.code);
3159
- this.getAvailibleCourses();
3160
- this.setDataFromEditCodHistory();
3144
+ if (changes['dataPreviusCodData'] && this.dataPreviusCodData != null) {
3145
+ this.processData(this.dataPreviusCodData);
3146
+ const { codFormStepOne } = this;
3147
+ if (!this.dataPreviusCodData.edit_course_payment) {
3148
+ // Deshabilitar edición
3149
+ codFormStepOne.disable();
3161
3150
  }
3162
3151
  }
3163
3152
  }
3153
+ processData(data) {
3154
+ const { codFormStepOne } = this;
3155
+ this.getAgreementByPlan(data.course_type.academic_plan.code);
3156
+ this.getCourseType(data.course_type.academic_plan.code);
3157
+ codFormStepOne.controls['english_level'].setValue(data.english_level.code);
3158
+ codFormStepOne.controls['agreement_by_category'].setValue(data.agreement.code);
3159
+ codFormStepOne.controls['course_type'].setValue(data.course_type.code);
3160
+ this.getAvailibleCourses();
3161
+ if (this.isEditCod) {
3162
+ this.setDataFromEditCodHistory();
3163
+ }
3164
+ else {
3165
+ this.setDataFromUserHistory();
3166
+ }
3167
+ }
3164
3168
  setDataFromUserHistory() {
3165
3169
  this.codFormStepOne.controls['academic_plan'].setValue(this.initialData.course_type.academic_plan.code);
3166
3170
  this.codFormStepOne.controls['course_type'].setValue(this.initialData.course_type.code);