diff --git a/blueocean-dashboard/src/main/js/components/RunDetails.jsx b/blueocean-dashboard/src/main/js/components/RunDetails.jsx index f54024f2..a94d3e26 100644 --- a/blueocean-dashboard/src/main/js/components/RunDetails.jsx +++ b/blueocean-dashboard/src/main/js/components/RunDetails.jsx @@ -91,6 +91,12 @@ class RunDetails extends Component { decodeURIComponent(run.pipeline) === branch; })[0]; + // deep-linking across RunDetails for different pipelines yields 'runs' data for the wrong pipeline + // during initial render. when runs are refetched the screen will render again with 'currentRun' correctly set + if (!currentRun) { + return null; + } + currentRun.name = name; const status = currentRun.result === 'UNKNOWN' ? currentRun.state : currentRun.result; diff --git a/blueocean-personalization/src/main/js/components/DashboardCards.jsx b/blueocean-personalization/src/main/js/components/DashboardCards.jsx index 7ca96b9a..aebafd61 100644 --- a/blueocean-personalization/src/main/js/components/DashboardCards.jsx +++ b/blueocean-personalization/src/main/js/components/DashboardCards.jsx @@ -126,6 +126,7 @@ export class DashboardCards extends Component { let startTime = null; let estimatedDuration = null; let commitId = null; + let runId = null; if (latestRun) { if (latestRun.result) { @@ -135,6 +136,7 @@ export class DashboardCards extends Component { startTime = latestRun.startTime; estimatedDuration = latestRun.estimatedDurationInMillis; commitId = latestRun.commitId; + runId = latestRun.id; } if (latestRun && latestRun.result) { @@ -152,6 +154,7 @@ export class DashboardCards extends Component { pipeline={pipelineName} branch={branchName} commitId={commitId} + runId={runId} favorite onFavoriteToggle={(isFavorite) => this._onFavoriteToggle(isFavorite, favorite)} /> diff --git a/blueocean-personalization/src/main/js/components/PipelineCard.jsx b/blueocean-personalization/src/main/js/components/PipelineCard.jsx index 72990d07..7cb512f0 100644 --- a/blueocean-personalization/src/main/js/components/PipelineCard.jsx +++ b/blueocean-personalization/src/main/js/components/PipelineCard.jsx @@ -2,6 +2,7 @@ * Created by cmeyers on 6/28/16. */ import React, { Component, PropTypes } from 'react'; +import { Link } from 'react-router'; import { Icon } from 'react-material-icons-blue'; import { Favorite, LiveStatusIndicator } from '@jenkins-cd/design-language'; @@ -75,6 +76,10 @@ export class PipelineCard extends Component { const showRun = status && (status.toLowerCase() === 'failure' || status.toLowerCase() === 'aborted'); const commitText = commitId ? commitId.substr(0, 7) : ''; + const runUrl = `/organizations/${encodeURIComponent(this.props.organization)}/` + + `${encodeURIComponent(this.props.fullName)}/detail/` + + `${encodeURIComponent(this.props.branch || this.props.pipeline)}/${encodeURIComponent(this.props.runId)}/pipeline`; + return (
- {this.props.organization} / {this.props.pipeline} + + {this.props.organization} / {this.props.pipeline} + { this.props.branch ? @@ -129,6 +136,7 @@ PipelineCard.propTypes = { pipeline: PropTypes.string, branch: PropTypes.string, commitId: PropTypes.string, + runId: PropTypes.string, favorite: PropTypes.bool, onRunClick: PropTypes.func, onFavoriteToggle: PropTypes.func, diff --git a/blueocean-personalization/src/main/less/components/pipeline-card.less b/blueocean-personalization/src/main/less/components/pipeline-card.less index 73f79b48..d5db10c5 100644 --- a/blueocean-personalization/src/main/less/components/pipeline-card.less +++ b/blueocean-personalization/src/main/less/components/pipeline-card.less @@ -6,6 +6,10 @@ min-width: 400px; padding: 15px; + a { + color: white; + } + .name, .branch, .commit { margin-left: 10px; }