Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Commit

Permalink
fix: use hard coded current step id to compute next step
Browse files Browse the repository at this point in the history
  • Loading branch information
ia3andy committed Jul 5, 2018
1 parent 57eba0d commit 3cc392f
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 44 deletions.
7 changes: 1 addition & 6 deletions src/app/launcher/cancel-overlay/cancel-overlay.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
Component,
Host,
Input,
OnInit
} from '@angular/core';
import { Component, Host, OnInit } from '@angular/core';

import { LauncherComponent } from '../launcher.component';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import {
Component,
DoCheck,
Host,
Input,
KeyValueDiffers,
OnInit,
OnDestroy,
ViewEncapsulation,
Optional
Component,
DoCheck,
Host,
Input,
KeyValueDiffers,
OnDestroy,
OnInit,
Optional,
ViewEncapsulation
} from '@angular/core';
import { FormsModule } from '@angular/forms';
import { Subscription } from 'rxjs/Subscription';

import { DependencyCheckService } from '../../service/dependency-check.service';
Expand All @@ -18,7 +17,6 @@ import { Selection } from '../../model/selection.model';
import { LauncherComponent } from '../../launcher.component';
import { LauncherStep } from '../../launcher-step';
import { DependencyEditor } from '../../model/dependency-editor/dependency-editor.model';
import { Summary } from '../../model/summary.model';
import { broadcast } from '../../shared/telemetry.decorator';

@Component({
Expand Down Expand Up @@ -106,7 +104,7 @@ export class DependencyEditorCreateappStepComponent extends LauncherStep impleme
}
})
navToNextStep(): void {
this.launcherComponent.navToNextStep();
this.launcherComponent.navToNextStep('SelectDependencies');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class GitproviderCreateappStepComponent extends LauncherStep implements A
}
})
navToNextStep(): void {
this.launcherComponent.navToNextStep();
this.launcherComponent.navToNextStep('GitProvider');
const summary = this.launcherComponent.summary;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Component, Optional, Output, EventEmitter, ChangeDetectorRef, Input } from '@angular/core';
import { ChangeDetectorRef, Component, EventEmitter, Input, Optional, Output } from '@angular/core';

import { Cluster } from '../../model/cluster.model';
import { TokenService } from '../../service/token.service';
import { Observable } from 'rxjs';

@Component({
selector: 'f8launcher-link-accounts-createapp-step',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ export class MissionRuntimeCreateappStepComponent extends LauncherStep implement
}
})
navToNextStep(): void {
this.launcherComponent.navToNextStep();
const summary = this.launcherComponent.summary;
this.launcherComponent.navToNextStep('MissionRuntime');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class ProjectSummaryCreateappStepComponent extends LauncherStep implement
* Navigate to next step
*/
navToNextStep(): void {
this.launcherComponent.navToNextStep();
this.launcherComponent.navToNextStep('ProjectSummary');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class ReleaseStrategyCreateappStepComponent extends LauncherStep implemen
}
})
navToNextStep(): void {
this.launcherComponent.navToNextStep();
this.launcherComponent.navToNextStep('ReleaseStrategy');
}

updatePipelineSelection(pipeline: Pipeline): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class TargetEnvironmentCreateappStepComponent extends LauncherStep implem
// Steps

navToNextStep(): void {
this.launcherComponent.navToNextStep();
this.launcherComponent.navToNextStep('TargetEnvironment');
}

selectCluster(cluster?: Cluster): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class GitproviderImportappStepComponent extends LauncherStep implements A
}
})
navToNextStep(): void {
this.launcherComponent.navToNextStep();
this.launcherComponent.navToNextStep('GitProvider');
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
import {
Component,
Host,
Input,
OnChanges,
OnDestroy,
OnInit,
SimpleChanges,
ViewEncapsulation
} from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import { Component, Host, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, ViewEncapsulation } from '@angular/core';

import { Progress } from '../../model/progress.model';
import { ProjectProgressService } from '../../service/project-progress.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class ProjectSummaryImportappStepComponent extends LauncherStep implement
* Navigate to next step
*/
navToNextStep(): void {
this.launcherComponent.navToNextStep();
this.launcherComponent.navToNextStep('ProjectSummary');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class ReleaseStrategyImportappStepComponent extends LauncherStep implemen
}
})
navToNextStep(): void {
this.launcherComponent.navToNextStep();
this.launcherComponent.navToNextStep('ReleaseStrategy');
}

updatePipelineSelection(pipeline: Pipeline): void {
Expand Down
4 changes: 2 additions & 2 deletions src/app/launcher/launcher.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,14 @@ export class LauncherComponent implements AfterViewInit, OnInit {
/**
* Navigate to next step
*/
navToNextStep(): void {
navToNextStep(fromStepId: string = this.selectedSection): void {
let summaryStep = this.getStep('ProjectSummary');
if (summaryStep !== undefined && summaryStep.completed === true) {
this.summaryCompleted = true;
return;
}
setTimeout(() => {
this.stepIndicator.navToNextStep();
this.stepIndicator.navToNextStep(fromStepId);
}, 10);
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/launcher/step-indicator/step-indicator.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export class StepIndicatorComponent implements OnInit {
/**
* Navigate to next step
*/
navToNextStep(): void {
navToNextStep(fromStepId?: string): void {
let steps = this.launcherComponent.steps.filter(step => !step.hidden);
const index = steps.findIndex(step => step.id === this.launcherComponent.selectedSection);
const index = steps.findIndex(step => step.id === fromStepId);
this.navToStep(steps[index + 1].id);
}

Expand Down

0 comments on commit 3cc392f

Please sign in to comment.