iptdevs-design-system 3.1.153 → 3.1.154

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.
@@ -3298,10 +3298,30 @@ class CodFormStepTwoComponent extends CodFormSteps {
3298
3298
  this.getParameters();
3299
3299
  if (changes['initialData']) {
3300
3300
  if (this.initialData != null) {
3301
- this.setDataFromPreviusCod();
3301
+ if (this.initialData.userStudent[0] != null) {
3302
+ this.setDataFromUserHistory();
3303
+ }
3304
+ else {
3305
+ this.setDataFromPreviusCod();
3306
+ }
3302
3307
  }
3303
3308
  }
3304
3309
  }
3310
+ setDataFromUserHistory() {
3311
+ this.codFormStepTwo.controls['student_name'].setValue(this.initialData.student.name);
3312
+ this.codFormStepTwo.controls['student_last_name'].setValue(this.initialData.student.last_name);
3313
+ this.codFormStepTwo.controls['student_id_card_type'].setValue(this.initialData.student.id_card_type);
3314
+ this.codFormStepTwo.controls['student_id_card'].setValue(this.initialData.student.id_card);
3315
+ this.codFormStepTwo.controls['country'].setValue(this.initialData.student.city[0].country);
3316
+ this.codFormStepTwo.controls['state'].setValue(this.initialData.student.city[0].state);
3317
+ this.codFormStepTwo.controls['city'].setValue(this.initialData.student.city[0].code);
3318
+ this.codFormStepTwo.controls['gender'].setValue(this.initialData.student.gender);
3319
+ this.codFormStepTwo.controls['nickname'].setValue(this.initialData.student.nick_name);
3320
+ this.codFormStepTwo.controls['student_phone_indicative'].setValue(this.initialData.student.phone_indicative);
3321
+ this.codFormStepTwo.controls['student_phone_number'].setValue(this.initialData.student.phone_number);
3322
+ this.codFormStepTwo.controls['birthdate'].setValue(this.initialData.student.birthdate);
3323
+ this.codFormStepTwo.controls['student_email'].setValue(this.initialData.student.email);
3324
+ }
3305
3325
  setDataFromPreviusCod() {
3306
3326
  this.codFormStepTwo.controls['student_name'].setValue(this.initialData.student.name);
3307
3327
  this.codFormStepTwo.controls['student_last_name'].setValue(this.initialData.student.last_name);
@@ -3579,7 +3599,12 @@ class CodFormStepThreeComponent extends CodFormSteps {
3579
3599
  if (this.initialData != null) {
3580
3600
  if (this.initialData.parent != null) {
3581
3601
  this.selectNeedAtendant(1);
3582
- this.setValueStepThree();
3602
+ if (this.initialData.userStudent[0] != null) {
3603
+ this.setDataFromUserHistory();
3604
+ }
3605
+ else {
3606
+ this.setValueStepThree();
3607
+ }
3583
3608
  }
3584
3609
  else {
3585
3610
  //this.cleanComponent();
@@ -3683,6 +3708,16 @@ class CodFormStepThreeComponent extends CodFormSteps {
3683
3708
  this.codFormStepThree.controls['parent_phone_number'].setValue(this.initialData.parent.phone_number);
3684
3709
  this.codFormStepThree.controls['parent_address'].setValue(this.initialData.parent.office_adrress);
3685
3710
  }
3711
+ setDataFromUserHistory() {
3712
+ this.codFormStepThree.controls['parent_id_card_type'].setValue(null);
3713
+ this.codFormStepThree.controls['parent_id_card'].setValue(null);
3714
+ this.codFormStepThree.controls['parent_last_name'].setValue(null);
3715
+ this.codFormStepThree.controls['parent_name'].setValue(null);
3716
+ this.codFormStepThree.controls['parent_phone_indicative'].setValue(null);
3717
+ this.codFormStepThree.controls['parent_occupation'].setValue(null);
3718
+ this.codFormStepThree.controls['parent_phone_number'].setValue(null);
3719
+ this.codFormStepThree.controls['parent_address'].setValue(null);
3720
+ }
3686
3721
  updateValueAndValidity() {
3687
3722
  this.codFormStepThree.controls['parent_id_card_type'].updateValueAndValidity();
3688
3723
  this.codFormStepThree.controls['parent_id_card'].updateValueAndValidity();
@@ -4277,7 +4312,12 @@ class CodFormStepFiveComponent extends CodFormSteps {
4277
4312
  this.sendFormMsg = 'Crear COD'; // Roles comerciales
4278
4313
  if (changes['initialData']) {
4279
4314
  if (this.initialData != null) {
4280
- this.setDataFromPreviusCod();
4315
+ if (this.initialData.userStudent[0] != null) {
4316
+ this.setDataFromUserHistory();
4317
+ }
4318
+ else {
4319
+ this.setDataFromPreviusCod();
4320
+ }
4281
4321
  }
4282
4322
  }
4283
4323
  }
@@ -4390,6 +4430,14 @@ class CodFormStepFiveComponent extends CodFormSteps {
4390
4430
  this.codFormStepFive.controls['observation'].setValue(this.initialData.aditional_information.observation);
4391
4431
  this.codFormStepFive.controls['code_refers'].setValue(this.initialData.aditional_information.code_refers);
4392
4432
  }
4433
+ setDataFromUserHistory() {
4434
+ this.codFormStepFive.controls['marketing_reasons'].setValue(null);
4435
+ this.codFormStepFive.controls['study_reasons'].setValue(null);
4436
+ this.codFormStepFive.controls['disability'].setValue(null);
4437
+ this.codFormStepFive.controls['health_regimen'].setValue(null);
4438
+ this.codFormStepFive.controls['observation'].setValue(null);
4439
+ this.codFormStepFive.controls['code_refers'].setValue(null);
4440
+ }
4393
4441
  cleanComponent() {
4394
4442
  this.resetLocalStorage(this.controls);
4395
4443
  this.codFormStepFive.reset();