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

Refactor v3 #379

Merged
merged 57 commits into from
Oct 16, 2018
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
336868e
poc: loading review components dynamically
edewit Sep 10, 2018
f5eb19a
progress: added mission runtime review component
edewit Sep 12, 2018
4b10d78
breaking all the things
edewit Sep 14, 2018
9bf18e9
introduced step state and filters to construct redirect url
edewit Sep 18, 2018
f49024b
fix for version id
edewit Sep 19, 2018
9fac243
fixed navigation
edewit Sep 19, 2018
773ab1e
application name and target env review screen
edewit Sep 19, 2018
67454b1
added release stategy review component
edewit Sep 20, 2018
44e1fc9
whitespace
edewit Sep 20, 2018
0f57cd5
merged with upstream
edewit Sep 20, 2018
af1852c
removed circlar dependency by adding selectedSection to state
edewit Sep 21, 2018
79060dc
serialise selected section and scroll to
edewit Sep 21, 2018
0ecd3a7
added review page for dependency editor
edewit Sep 21, 2018
155eaf4
clean up
edewit Sep 21, 2018
675caef
fix zip next step
edewit Sep 21, 2018
0079f4b
lint fixes
edewit Sep 21, 2018
6903831
fixed tests
edewit Sep 21, 2018
2eb8bdb
fixed tests
edewit Sep 25, 2018
b770cd0
fixed test for real this time ;)
edewit Sep 25, 2018
de804ef
http-param + test
edewit Sep 26, 2018
0459185
changed to use summary components as children of the summary step and…
edewit Sep 28, 2018
88607a1
added next button component
edewit Sep 28, 2018
a3ae315
removed keyvalue mapper in favour of booster event
edewit Oct 1, 2018
9c91cda
added progress screen
edewit Oct 1, 2018
d85c48c
removed lines
edewit Oct 1, 2018
273b2d9
fill out the depencency check
edewit Oct 2, 2018
1943185
removed import version of the git page and added import flag
edewit Oct 2, 2018
488db43
merged summary and release import / create app components
edewit Oct 2, 2018
9362709
merge progress components use new layout
edewit Oct 2, 2018
dd9c1d9
unused imports
edewit Oct 2, 2018
88ceff7
leave statuses for !gettingStartedInfo
edewit Oct 2, 2018
e8e4da1
made client customizable back buttons
edewit Oct 3, 2018
8bf423f
renamed folder
edewit Oct 3, 2018
d8c0020
removed unused functions
edewit Oct 3, 2018
9eb3fa7
fixed tests
edewit Oct 3, 2018
cbcf5a9
removed 'create-app' from all steps
edewit Oct 8, 2018
720d31d
modify tslint.json and fix lint error (#380)
vikram-raj Oct 10, 2018
930799c
added automatic reverse restore state
edewit Oct 12, 2018
afd8e47
make stepId the default navToStep id
edewit Oct 12, 2018
79efc35
enable version changes
edewit Oct 12, 2018
eec287e
more consistend demo data
edewit Oct 12, 2018
252ab01
targetEnvironment is only valid for standalone launch
edewit Oct 12, 2018
6db942e
merged buttons PR
edewit Oct 12, 2018
920aafe
add view pipeline button on import flow progress page (#381)
vikram-raj Oct 15, 2018
8db1c5c
added dummy view pipeline page
edewit Oct 15, 2018
33edfce
remove unnessary flag
edewit Oct 15, 2018
008e138
angular query params
edewit Oct 15, 2018
ed5df26
remeber scroll posistion
edewit Oct 15, 2018
93fbc16
reset selectedSection when complete
edewit Oct 16, 2018
30c08c9
cleanup
edewit Oct 16, 2018
6f0738c
reset selected section
edewit Oct 16, 2018
e1290f0
fix 'suggest' label on import
edewit Oct 16, 2018
6a640e6
better selection section reset
edewit Oct 16, 2018
3aa516d
fix: now creates http params
edewit Oct 16, 2018
261a5c4
remove padding
edewit Oct 16, 2018
19e5cc5
simplified using result of 'save'
edewit Oct 16, 2018
0a694c2
fixed parameter names
edewit Oct 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ <h2 class="card-pf-title">
</div>
<div class="card-pf-body">
<pre>
$ unzip {{launcherComponent.summary.dependencyCheck.projectName}}.zip
$ cd {{launcherComponent.summary.dependencyCheck.projectName}}
$ unzip {{dependencyCheck.projectName}}.zip
$ cd {{dependencyCheck.projectName}}
</pre>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,62 +1,52 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';

import { ActivateBoosterCreateappNextstepComponent } from './activate-booster-createapp-nextstep.component';
import { LauncherComponent } from '../../launcher.component';
import { LauncherStep } from '../../launcher-step';
import { LauncherComponent } from '../../launcher.component';
import { Projectile, StepState } from '../../model/projectile.model';
import { TargetEnvironmentSelection } from '../../model/target-environment.model';
import { ActivateBoosterNextstepComponent } from './activate-booster-nextstep.component';

export interface TypeWizardComponent {
selectedSection: string;
steps: LauncherStep[];
summary: any;
summaryCompleted: boolean;
addStep(step: LauncherStep): void;
}

let mockWizardComponent: TypeWizardComponent = {
const mockWizardComponent: TypeWizardComponent = {
selectedSection: '',
steps: [],
summary: {
dependencyCheck: {},
gitHubDetails: {}
},
summaryCompleted: false,
addStep(step: LauncherStep) {
for (let i = 0; i < this.steps.length; i++) {
if (step.id === this.steps[i].id) {
return;
}
}
this.steps.push(step);
}
};

describe('ActivateBoosterComponent', () => {
let component: ActivateBoosterCreateappNextstepComponent;
let fixture: ComponentFixture<ActivateBoosterCreateappNextstepComponent>;
let component: ActivateBoosterNextstepComponent;
let fixture: ComponentFixture<ActivateBoosterNextstepComponent>;

beforeEach(async(() => {
const projectile = new Projectile<any>();
TestBed.configureTestingModule({
imports: [
CommonModule,
RouterTestingModule
],
declarations: [
ActivateBoosterCreateappNextstepComponent
ActivateBoosterNextstepComponent
],
providers: [
{
provide: LauncherComponent, useValue: mockWizardComponent
}
{ provide: Projectile, useValue: projectile },
{ provide: LauncherComponent, useValue: mockWizardComponent }
]
}).compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(ActivateBoosterCreateappNextstepComponent);
fixture = TestBed.createComponent(ActivateBoosterNextstepComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {
Component,
Host,
ViewEncapsulation
} from '@angular/core';

import { LauncherComponent } from '../../launcher.component';
import { DependencyCheck } from '../../model/dependency-check.model';
import { Projectile } from '../../model/projectile.model';
import { TargetEnvironmentSelection } from '../../model/target-environment.model';

@Component({
encapsulation: ViewEncapsulation.None,
selector: 'f8launcher-activatebooster-nextstep',
templateUrl: './activate-booster-nextstep.component.html',
styleUrls: ['./activate-booster-nextstep.component.less']
})
export class ActivateBoosterNextstepComponent {

constructor(@Host() public launcherComponent: LauncherComponent,
private projectile: Projectile<TargetEnvironmentSelection>) {
}

get dependencyCheck(): DependencyCheck {
return this.projectile.sharedState.state;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<div class="col-xs-12">
<div id="dep-editor" class="card-pf card-pf--small">
<div *ngIf="data.dep.dependencySnapshot === undefined;
then showNoDependencyTemplate else showDependencyTemplate"></div>
<ng-template #showNoDependencyTemplate>
<div class="card-pf-heading">
<h2 class="card-pf-title">
Selected Dependencies
</h2>
</div>
<div class="card-pf-body f8launcher-project-summary-data-unavailable dependency noData-label">
<h2>
<b>You haven't selected any additional dependencies</b>
</h2>
<p>To add additional dependencies, complete this section. Required dependencies are added for you automatically based on your mission and runtime.</p>
<button class="btn btn-default btn-lg f8launcher-authorize-account"
(click)="navToStep()">Complete Section</button>
</div>
</ng-template>
<ng-template #showDependencyTemplate>
<div class="card-pf-heading">
<h2 class="card-pf-title">
Selected Dependencies
</h2>
</div>
<div class="card-pf-body">
<div class="list-group-item">
<div class="list-view-pf-main-info">
<div class="list-view-pf-body">
<div class="list-view-pf-description f8launcher-project-summary-data-unavailable dependency">
<ng-container>
<span class="dependencies-added" *ngFor="let snapshot of data.dep.dependencySnapshot">
{{snapshot.package}}
</span>
</ng-container>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component } from '@angular/core';
import { Broadcaster } from 'ngx-base';
import { Projectile } from '../../model/projectile.model';
import { ReviewComponent } from '../../review.component';

@Component({
selector: 'f8launcher-dependency-editor-review',
templateUrl: './dependency-editor-review.component.html'
})
export class DependencyEditorReviewComponent extends ReviewComponent {

constructor(broadcaster: Broadcaster, projectile: Projectile<any>) {
super(broadcaster, projectile);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,7 @@ <h1>
</div>
</div>

<div>
<div class="container-fluid">
<div class="f8launcher-continue">
<button class="btn btn-link"
class.animate-continue="completed"
[disabled]="!completed"
(click)="navToNextStep()">
<span class="fa-stack fa-2x">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-angle-double-down fa-stack-1x fa-inverse"></i>
</span>
</button>
</div>
</div>
<div *ngIf="launcherComponent">
<f8launcher-button-next-step [disabled]="!completed" [navFromId]="id"></f8launcher-button-next-step>
</div>
</section>
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CommonModule } from '@angular/common';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { RouterTestingModule } from '@angular/router/testing';
import { Observable, of} from 'rxjs';
import { DependencyEditorModule, URLProvider, DependencyEditorTokenProvider } from 'fabric8-analytics-dependency-editor';
import { DependencyEditorModule } from 'fabric8-analytics-dependency-editor';
import { Broadcaster } from 'ngx-base';
import { Observable, of } from 'rxjs';

import { DemoDependencyEditorService } from '../../../../../../src/app/service/demo-dependency-editor.service';
import { TokenProvider } from '../../../lib/service/token-provider';
import { DependencyCheck } from '../../launcher.module';
import { Projectile, StepState } from '../../model/projectile.model';
import { DependencyCheckService } from '../../service/dependency-check.service';
import { DependencyEditorService } from '../../service/dependency-editor.service';
import { DependencyEditorCreateappStepComponent } from './dependency-editor-step.component';
import { LauncherComponent } from '../../launcher.component';
import { LauncherStep } from '../../launcher-step';
import { HelperService } from '../../service/helper.service';
import { TokenProvider } from '../../../lib/service/token-provider';
import { BroadcasterTestProvider } from '../targetenvironment-createapp-step/target-environment-createapp-step.component.spec';
import { DemoDependencyEditorService } from '../../../../../../src/app/service/demo-dependency-editor.service';
import { ButtonNextStepComponent } from '../../shared/button-next-step.component';
import { BroadcasterTestProvider } from '../targetenvironment-step/target-environment-step.component.spec';
import { DependencyEditorStepComponent } from './dependency-editor-step.component';

const mockHelperService = {
getBackendUrl(): string {
Expand All @@ -33,50 +33,19 @@ const mockDependencyCheckService = {
groupId: 'io.openshift.booster',
projectName: 'App_test_1',
projectVersion: '1.0.0-SNAPSHOT',
spacePath: '/myspace'
spacePath: '/myspace',
targetEnvironment: undefined
});
}
};

export interface TypeWizardComponent {
selectedSection: string;
steps: LauncherStep[];
summary: any;
summaryCompleted: boolean;
addStep(step: LauncherStep): void;
onInViewportChange($event: any, id: string): any;
}

const mockWizardComponent: TypeWizardComponent = {
selectedSection: '',
steps: [],
summary: {
dependencyCheck: {},
gitHubDetails: {}
},
summaryCompleted: false,
addStep(step: LauncherStep) {
for (let i = 0; i < this.steps.length; i++) {
if (step.id === this.steps[i].id) {
return;
}
}
this.steps.push(step);
},
onInViewportChange($event: any, id: string) {
if ($event) {
setTimeout(() => {
this.selectedSection = id;
}, 10); // Avoids ExpressionChangedAfterItHasBeenCheckedError
}
}
};

describe('DependencyEditorCreateappStepComponent', () => {
let component: DependencyEditorCreateappStepComponent;
let fixture: ComponentFixture<DependencyEditorCreateappStepComponent>;
let component: DependencyEditorStepComponent;
let fixture: ComponentFixture<DependencyEditorStepComponent>;

beforeEach(async(() => {
const projectile = new Projectile<any>();
projectile.setState('MissionRuntime', new StepState({}, []));
TestBed.configureTestingModule({
imports: [
CommonModule,
Expand All @@ -85,9 +54,11 @@ describe('DependencyEditorCreateappStepComponent', () => {
RouterTestingModule
],
declarations: [
DependencyEditorCreateappStepComponent
DependencyEditorStepComponent,
ButtonNextStepComponent
],
providers : [
{ provide: Projectile, useValue: projectile },
TokenProvider,
{
provide: DependencyCheckService, useValue: mockDependencyCheckService
Expand All @@ -96,16 +67,13 @@ describe('DependencyEditorCreateappStepComponent', () => {
provide: DependencyEditorService, useClass: DemoDependencyEditorService
},
{ provide: HelperService, useValue: mockHelperService },
{
provide: LauncherComponent, useValue: mockWizardComponent
},
{ provide: Broadcaster, useValue: BroadcasterTestProvider.broadcaster }
]
}).compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(DependencyEditorCreateappStepComponent);
fixture = TestBed.createComponent(DependencyEditorStepComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
Expand Down
Loading