iptdevs-design-system 3.1.169 → 3.1.170
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-one/cod-form-step-one.component.mjs +22 -11
- package/fesm2015/iptdevs-design-system.mjs +21 -10
- package/fesm2015/iptdevs-design-system.mjs.map +1 -1
- package/fesm2020/iptdevs-design-system.mjs +21 -10
- package/fesm2020/iptdevs-design-system.mjs.map +1 -1
- package/lib/cod/steps/cod-form-step-one/cod-form-step-one.component.d.ts +3 -2
- package/package.json +1 -1
|
@@ -3109,15 +3109,21 @@ class CodFormStepOneComponent extends CodFormSteps {
|
|
|
3109
3109
|
this.copies = this.copiesService.copies;
|
|
3110
3110
|
}
|
|
3111
3111
|
ngOnInit() {
|
|
3112
|
-
this.getParameters();
|
|
3113
|
-
this.initForm();
|
|
3114
|
-
this.startLocalStorageWork();
|
|
3115
|
-
this.setValuesByLocalStorage();
|
|
3116
3112
|
this.codFormStepOne.controls['course_type'].valueChanges
|
|
3117
3113
|
.subscribe(value => this.communicatorService.setCurrentCourseType(value));
|
|
3118
3114
|
this.communicatorService.setCurrentAgreement(this.localStorageCOD.getCodFormData(1, 'agreement_by_category'));
|
|
3119
3115
|
}
|
|
3116
|
+
/* Es necesario recorrer el array de controls de nuestro formulario para:
|
|
3117
|
+
✅ Leer el Local Storage y setear los valores
|
|
3118
|
+
✅ Subscribirse a los cambios del formulario para setear valores nuevos
|
|
3119
|
+
|
|
3120
|
+
Nota: la clase CodFormSteps() se encarga de toda la lógica de LS con los pasos del formulario del COD
|
|
3121
|
+
*/
|
|
3120
3122
|
ngOnChanges(changes) {
|
|
3123
|
+
this.getParameters();
|
|
3124
|
+
this.initForm();
|
|
3125
|
+
this.startLocalStorageWork();
|
|
3126
|
+
this.setValuesByLocalStorage();
|
|
3121
3127
|
if (changes['courseSelect']) {
|
|
3122
3128
|
console.log(this.courseSelect);
|
|
3123
3129
|
if (this.courseSelect != null) {
|
|
@@ -3127,15 +3133,20 @@ class CodFormStepOneComponent extends CodFormSteps {
|
|
|
3127
3133
|
// }else{
|
|
3128
3134
|
// this.setDataFromUserHistory();
|
|
3129
3135
|
// }
|
|
3136
|
+
this.setDataFromUserHistory();
|
|
3137
|
+
}
|
|
3138
|
+
else {
|
|
3139
|
+
console.log(this.courseSelect);
|
|
3130
3140
|
}
|
|
3131
3141
|
}
|
|
3132
3142
|
}
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3143
|
+
setDataFromUserHistory() {
|
|
3144
|
+
this.codFormStepOne.controls['academic_plan'].setValue(this.courseSelect.course_type.academic_plan.code);
|
|
3145
|
+
this.codFormStepOne.controls['course_type'].setValue(this.courseSelect.agreement);
|
|
3146
|
+
this.codFormStepOne.controls['agreement_by_category'].setValue(this.courseSelect.course_type.code);
|
|
3147
|
+
this.codFormStepOne.controls['english_level'].setValue(this.courseSelect.english_level);
|
|
3148
|
+
this.codFormStepOne.controls['availible_courses'].setValue(this.courseSelect.code);
|
|
3149
|
+
}
|
|
3139
3150
|
startLocalStorageWork() {
|
|
3140
3151
|
this.controls.forEach(control => {
|
|
3141
3152
|
let localStorageValue = this.readAndWriteLS(1, control.name);
|