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

Commit

Permalink
fix: pipeline selection reacts on the runtime change (#351)
Browse files Browse the repository at this point in the history
* fix: pipeline selection reacts on runtime change
* chore: removes reduntant === true in ngIf
* chore: aligns techPreview case in html templates
  • Loading branch information
bartoszmajsak authored Aug 9, 2018
1 parent e859107 commit c02717f
Show file tree
Hide file tree
Showing 19 changed files with 399 additions and 128 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="cancel-overlay" *ngIf="launcherComponent.showCancelOverlay === true">
<div class="cancel-overlay" *ngIf="launcherComponent.showCancelOverlay">
<div class="cancel-overlay-form">
<form class="col-sm-4 col-sm-offset-4 cancel-overlay-form--step active" role="form">
<section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import {
} from '../../service/mission-runtime.service.spec';
import {
BroadcasterTestProvider
} from '../targetenvironment-createapp-step/target-environment-createapp-step.component.spec';
}
from '../targetenvironment-createapp-step/target-environment-createapp-step.component.spec';
import { Observable } from 'rxjs/Observable';
import { Catalog } from '../../model/catalog.model';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ export class MissionRuntimeCreateappStepComponent extends LauncherStep implement
this.versionId = newVersion.id;
this.launcherComponent.summary.runtime = runtime;
this.launcherComponent.summary.runtime.version = newVersion;

// FIXME: use a booster change event listener to do this
// set maven artifact
if (this.launcherComponent.flow === 'osio' && this.completed) {
this.launcherComponent.summary.dependencyCheck.mavenArtifact = this.createMavenArtifact();
}
this.broadcaster.broadcast('runtime-changed', runtime);
}
this.handleBlankMissionFlow();
this.updateBoosterViewStatus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class ViewRuntime extends Runtime {
prerequisite: boolean;
canChangeVersion: boolean;
suggested: boolean;
pipelinePlatform: string;
selectedVersion: { id: string; name: string; };
versions: BoosterVersion[];
showMore: boolean = false;
Expand Down Expand Up @@ -59,6 +60,7 @@ export function createViewRuntimes(boosters: Booster[], canChangeVersion: boolea
canChangeVersion: canChangeVersion,
suggested: _.get(runtime, 'metadata.suggested', false),
prerequisite: _.get(runtime, 'metadata.prerequisite', false),
pipelinePlatform: _.get(runtime, 'metadata.pipelinePlatform', false),
showMore: false,
disabled: true,
boosters: runtimeBoosters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1>Next Steps</h1>
</div>
<div>
<div class="container-fluid container-cards-pf">
<div class="alert-box" *ngIf="isError === true">
<div class="alert-box" *ngIf="isError">
<div class="alert alert-danger">
<span class="pficon pficon-error-circle-o"></span>
<strong>Set Up Incomplete</strong> There were some problems.
Expand All @@ -34,10 +34,10 @@ <h2 class="card-pf-title card-pf-title-project-progress">
<span *ngIf="!allCompleted && !isError">
<i class="pficon pficon-in-progress fa-spin"></i> Working Through Setup
</span>
<span *ngIf="allCompleted === true && isError !== true">
<span *ngIf="allCompleted && isError !== true">
<i class="pficon pficon-ok"></i> Your Application is Ready
</span>
<span *ngIf="isError === true">
<span *ngIf="isError">
<i class="pficon pficon-error-circle-o"></i> Set Up Incomplete
</span>
</h2>
Expand Down Expand Up @@ -72,7 +72,7 @@ <h2 class="card-pf-title card-pf-title-project-progress">
</div>
</div>
</div>
<div class="card-pf-body" *ngIf="launcherComponent.flow === 'launch' && allCompleted === true">
<div class="card-pf-body" *ngIf="launcherComponent.flow === 'launch' && allCompleted">
<div class="list-pf">
<div class="list-pf-item">
<div class="list-pf-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h2 class="card-pf-title">
</div>
<div class="card-pf-body">
<div class="list-group-item"
[ngClass]="{'suggested': launcherComponent.summary?.pipeline?.suggested === true || launcherComponent.summary?.pipeline?.techpreview === true}">
[ngClass]="{'suggested': launcherComponent.summary?.pipeline?.suggested || launcherComponent.summary?.pipeline?.techpreview}">
<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">
Expand Down Expand Up @@ -165,11 +165,11 @@ <h2 class="card-pf-title">
</div>
<div class="card-pf-body">
<div class="list-group-item"
[ngClass]="{'suggested': summary?.pipeline?.suggested === true || summary?.pipeline?.techpreview === true}">
<div class="group" [ngClass]="{'with-tag': summary?.pipeline?.suggested === true || summary?.pipeline.techpreview === true}">
[ngClass]="{'suggested': summary?.pipeline?.suggested || summary?.pipeline?.techPreview}">
<div class="group" [ngClass]="{'with-tag': summary?.pipeline?.suggested || summary?.pipeline?.techPreview}">
<div class="list-view-pf-expand">
<span class="fa"
[ngClass]="{'fa-angle-down': summary?.pipeline?.expanded === true,
[ngClass]="{'fa-angle-down': summary?.pipeline?.expanded,
'fa-angle-right': summary?.pipeline?.expanded !== true}"
(click)="toggleExpanded(summary.pipeline)">
</span>
Expand All @@ -190,25 +190,25 @@ <h2 class="card-pf-title">
</div>
</div>
</div>
<div class="f8launcher-tags" [ngClass]="{'suggested-feature-tag': launcherComponent.summary?.pipeline?.suggested === true}"
*ngIf="launcherComponent.summary?.pipeline?.suggested === true || launcherComponent.summary?.pipeline?.techpreview === true">
<div class="f8launcher-tags" [ngClass]="{'suggested-feature-tag': launcherComponent.summary?.pipeline?.suggested}"
*ngIf="launcherComponent.summary?.pipeline?.suggested || launcherComponent.summary?.pipeline?.techpreview">
<span class="f8launcher-tags-label suggested" container="body" triggers="click"
outsideClick="true"
popover="This pipeline provides an end-to-end process that moves your application from source code to production, with stages to build and test new versions, rollout to staging, review changes, await approval, and promote to production."
*ngIf="summary?.pipeline?.suggested === true">
*ngIf="summary?.pipeline?.suggested">
Red Hat Suggests <i class="pficon pficon-info"></i>
</span>
<span class="f8launcher-tags-label techpreview" container="body" triggers="click"
outsideClick="true"
popover="Technology Preview"
*ngIf="summary?.pipeline?.techpreview === true">
*ngIf="summary?.pipeline?.techPreview">
Tech Preview <i class="pficon pficon-info"></i>
</span>
</div>
</div>
<div class="list-group-item-container container-fluid"
(click)="pipelineId = summary?.pipeline?.id; updatePipelineSelection(pipeline)"
*ngIf="summary?.pipeline?.expanded === true">
*ngIf="summary?.pipeline?.expanded">
<div class="row">
<div class="form-horizontal">
<div class="form-group col-sm-12" *ngFor="let stage of summary?.pipeline?.stages">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
import { Pipeline } from '../../model/pipeline.model';
import { PipelineService } from '../../service/pipeline.service';
import { Observable } from 'rxjs';

export class StubbedPipelineService implements PipelineService {
getPipelines(filterByRuntime?: string): Observable<Pipeline[]> {
return Observable.of(pipelines());
}
}

export const mavenReleasePipeline: Pipeline = {
'id': 'maven-release',
'platform': 'maven',
'name': 'Release',
'description': 'Maven based pipeline which:\n\n' +
'* creates a new version then builds and deploys the project into the maven repository',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}],
'suggested': false,
'techPreview': false
};

/**
* Data based on https://github.com/fabric8io/fabric8-jenkinsfile-library
*/
export function pipelines(): Pipeline[] {

return [{
'id': 'django-releaseandstage',
'platform': 'django',
'name': 'Release and Stage',
'description': 'Django based pipeline which creates a new version then builds and deploys the project',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {'name': 'Rollout to Stage', 'description': 'stages the new version into the Stage environment'}],
'suggested': false,
'techPreview': false
}, {
'id': 'django-releasestageapproveandpromote',
'platform': 'django',
'name': 'Release, Stage, Approve and Promote',
'description': 'Django based pipeline which creates a new version then builds and deploys the project',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {
'name': 'Rollout to Stage',
'description': 'stages the new version into the Stage environment'
}, {'name': 'Approve', 'description': 'waits for Approval to promote'}, {
'name': 'Rollout to Run',
'description': 'promotes to the Run environment'
}],
'suggested': true,
'techPreview': false
}, {
'id': 'dotnet-releaseandstage',
'platform': 'dotnet',
'name': 'Release and Stage',
'description': 'dotnet based pipeline which creates a new version then builds and deploys the project',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {'name': 'Rollout to Stage', 'description': 'stages the new version into the Stage environment'}],
'suggested': false,
'techPreview': false
}, {
'id': 'dotnet-releasestageapproveandpromote',
'platform': 'dotnet',
'name': 'Release, Stage, Approve and Promote',
'description': 'dotnet based pipeline which creates a new version then builds and deploys the project',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {
'name': 'Rollout to Stage',
'description': 'stages the new version into the Stage environment'
}, {'name': 'Approve', 'description': 'waits for Approval to promote'}, {
'name': 'Rollout to Run',
'description': 'promotes to the Run environment'
}],
'suggested': true,
'techPreview': false
}, {
'id': 'golang-releaseandstage',
'platform': 'golang',
'name': 'Release and Stage',
'description': 'Golang based pipeline which creates a new version then builds and deploys the project',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {'name': 'Rollout to Stage', 'description': 'stages the new version into the Stage environment'}],
'suggested': false,
'techPreview': false
}, {
'id': 'golang-releasestageapproveandpromote',
'platform': 'golang',
'name': 'Release, Stage, Approve and Promote',
'description': 'Golang based pipeline which creates a new version then builds and deploys the project',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {
'name': 'Rollout to Stage',
'description': 'stages the new version into the Stage environment'
}, {'name': 'Approve', 'description': 'waits for Approval to promote'}, {
'name': 'Rollout to Run',
'description': 'promotes to the Run environment'
}],
'suggested': true,
'techPreview': false
}, mavenReleasePipeline, {
'id': 'maven-releaseandstage',
'platform': 'maven',
'name': 'Release and Stage',
'description': 'Maven based pipeline which:\n\n' +
'* creates a new version then builds and deploys the project into the maven repository\n' +
'* stages the new version into the **Stage** environment',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {'name': 'Rollout to Stage', 'description': 'stages the new version into the Stage environment'}],
'suggested': false,
'techPreview': false
}, {
'id': 'maven-releasestageapproveandpromote',
'platform': 'maven',
'name': 'Release, Stage, Approve and Promote',
'description': 'Maven based pipeline which:\n\n' +
'* creates a new version then builds and deploys the project into the maven repository\n' +
'* stages the new version into the **Stage** environment\n' +
'* waits for **Approval** to promote \n' +
'* promotes to the **Run** environment',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {
'name': 'Rollout to Stage',
'description': 'stages the new version into the Stage environment'
}, {'name': 'Approve', 'description': 'waits for Approval to promote'}, {
'name': 'Rollout to Run',
'description': 'promotes to the Run environment'
}],
'suggested': true,
'techPreview': false
}, {
'id': 'node-releaseandstage',
'platform': 'node',
'name': 'Release and Stage',
'description': 'NodeJS based pipeline which creates a new version then builds and deploys the project ' +
'into the Nexus repository',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {'name': 'Rollout to Stage', 'description': 'stages the new version into the Stage environment'}],
'suggested': false,
'techPreview': false
}, {
'id': 'node-releasestageapproveandpromote',
'platform': 'node',
'name': 'Release, Stage, Approve and Promote',
'description': 'NodeJS based pipeline which creates a new version then builds and deploys the project ' +
'into the Nexus repository',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {
'name': 'Rollout to Stage',
'description': 'stages the new version into the Stage environment'
}, {'name': 'Approve', 'description': 'waits for Approval to promote'}, {
'name': 'Rollout to Run',
'description': 'promotes to the Run environment'
}],
'suggested': true,
'techPreview': false
}, {
'id': 'php-releaseandstage',
'platform': 'php',
'name': 'Release and Stage',
'description': 'PHP apache based pipeline which creates a new version then builds and deploys the project',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {'name': 'Rollout to Stage', 'description': 'stages the new version into the Stage environment'}],
'suggested': false,
'techPreview': false
}, {
'id': 'php-releasestageapproveandpromote',
'platform': 'php',
'name': 'Release, Stage, Approve and Promote',
'description': 'PHP apache based pipeline which creates a new version then builds and deploys the project',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {
'name': 'Rollout to Stage',
'description': 'stages the new version into the Stage environment'
}, {'name': 'Approve', 'description': 'waits for Approval to promote'}, {
'name': 'Rollout to Run',
'description': 'promotes to the Run environment'
}],
'suggested': true,
'techPreview': false
}, {
'id': 'rails-releaseandstage',
'platform': 'rails',
'name': 'Release and Stage',
'description': 'Ruby on Rails based pipeline which creates a new version then builds and deploys the project ' +
'into the Nexus repository',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {'name': 'Rollout to Stage', 'description': 'stages the new version into the Stage environment'}],
'suggested': false,
'techPreview': false
}, {
'id': 'rails-releasestageapproveandpromote',
'platform': 'rails',
'name': 'Release, Stage, Approve and Promote',
'description': 'Ruby on Rails based pipeline which creates a new version then builds and deploys the project ' +
'into the Nexus repository',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {
'name': 'Rollout to Stage',
'description': 'stages the new version into the Stage environment'
}, {'name': 'Approve', 'description': 'waits for Approval to promote'}, {
'name': 'Rollout to Run',
'description': 'promotes to the Run environment'
}],
'suggested': true,
'techPreview': false
}, {
'id': 'swift-releaseandstage',
'platform': 'swift',
'name': 'Release and Stage',
'description': 'NodeJS based pipeline which creates a new version then builds and deploys the project ' +
'into the Nexus repository',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {'name': 'Rollout to Stage', 'description': 'stages the new version into the Stage environment'}],
'suggested': false,
'techPreview': false
}, {
'id': 'swift-releasestageapproveandpromote',
'platform': 'swift',
'name': 'Release, Stage, Approve and Promote',
'description': 'NodeJS based pipeline which creates a new version then builds and deploys the project ' +
'into the Nexus repository',
'stages': [{
'name': 'Build Release',
'description': 'creates a new version then builds and deploys the project into the maven repository'
}, {
'name': 'Rollout to Stage',
'description': 'stages the new version into the Stage environment'
}, {'name': 'Approve', 'description': 'waits for Approval to promote'}, {
'name': 'Rollout to Run',
'description': 'promotes to the Run environment'
}],
'suggested': true,
'techPreview': false
}] as Pipeline[];
}
Loading

0 comments on commit c02717f

Please sign in to comment.