Project

General

Profile

« Previous | Next » 

Revision 55585

fixed back-front functionality between steps in validation process

View differences:

register-new-datasource.component.ts
69 69
        this.currentStep = 1;
70 70
      } else if (stepName === 'interfaces') {
71 71
        if (!this.repo) {
72
          this.navigateToStep('basicInformation');
72
          this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=basicInformation`);
73 73
        } else {
74 74
          this.currentStep = 2;
75 75
        }
......
77 77
        this.currentStep = 3;
78 78
      }
79 79
    }
80
    this.rightHelperContent.ngOnInit();
81
    this.topHelperContent.ngOnInit();
82
    this.leftHelperContent.ngOnInit();
83
    this.bottomHelperContent.ngOnInit();
80 84
  }
81 85

  
82
  navigateToStep(step: string) {
83
    this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=${step}`)
84
      .then( () => {
85
          this.getStep();
86
          this.rightHelperContent.ngOnInit();
87
          this.topHelperContent.ngOnInit();
88
          this.leftHelperContent.ngOnInit();
89
          this.bottomHelperContent.ngOnInit();
90
        }
91
      );
92
  }
93

  
94 86
  moveAStep() {
95 87
    this.errorMessage = '';
96 88
    if (this.currentStep === 1) {
......
112 104
    this.errorMessage = '';
113 105
    if (this.currentStep === 2) {
114 106
      of(this.getInterfaces()).subscribe(
115
        () => this.navigateToStep('basicInformation')
107
        () => this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=basicInformation`)
116 108
      );
117 109
    }
118 110
  }
......
176 168
  getCurrentRepo(repo: Repository) {
177 169
    this.repo = repo;
178 170
    of (this.fillInterfacesForms()).subscribe(
179
      () => this.navigateToStep('interfaces')
171
      () => this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=interfaces`)
180 172
    );
181 173
  }
182 174

  
......
226 218
          this.loadingMessage = '';
227 219
          this.repo = null;
228 220
          this.repoInterfaces = [];
229
          this.navigateToStep('finish');
221
          this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=finish`);
230 222
        }
231 223
      );
232 224
    }

Also available in: Unified diff