Merge remote-tracking branch 'origin/master' into hotfix/JENKINS-36211
This commit is contained in:
commit
58baec6206
|
@ -2,6 +2,7 @@ import React, { Component, PropTypes } from 'react';
|
|||
import { CommitHash, ReadableDate } from '@jenkins-cd/design-language';
|
||||
import { LiveStatusIndicator, WeatherIcon } from '@jenkins-cd/design-language';
|
||||
import RunPipeline from './RunPipeline.jsx';
|
||||
import { buildRunDetailsUrl } from '../util/UrlUtils';
|
||||
|
||||
const { object } = PropTypes;
|
||||
|
||||
|
@ -22,6 +23,7 @@ export default class Branches extends Component {
|
|||
location,
|
||||
pipeline: {
|
||||
name: pipelineName,
|
||||
fullName,
|
||||
organization,
|
||||
},
|
||||
},
|
||||
|
@ -29,23 +31,26 @@ export default class Branches extends Component {
|
|||
const {
|
||||
latestRun: { id, result, startTime, endTime, changeSet, state, commitId, estimatedDurationInMillis },
|
||||
weatherScore,
|
||||
name,
|
||||
name: branchName,
|
||||
} = data;
|
||||
const url = `/organizations/${organization}/${pipelineName}/detail/${name}/${id}/pipeline`;
|
||||
|
||||
const cleanBranchName = decodeURIComponent(branchName);
|
||||
const url = buildRunDetailsUrl(organization, fullName, cleanBranchName, id, 'pipeline');
|
||||
|
||||
const open = () => {
|
||||
location.pathname = url;
|
||||
router.push(location);
|
||||
};
|
||||
const { msg } = changeSet[0] || {};
|
||||
|
||||
return (<tr key={name} onClick={open} id={`${name}-${id}`} >
|
||||
return (<tr key={cleanBranchName} onClick={open} id={`${cleanBranchName}-${id}`} >
|
||||
<td><WeatherIcon score={weatherScore} /></td>
|
||||
<td onClick={open}>
|
||||
<LiveStatusIndicator result={result === 'UNKNOWN' ? state : result}
|
||||
startTime={startTime} estimatedDuration={estimatedDurationInMillis}
|
||||
/>
|
||||
</td>
|
||||
<td>{decodeURIComponent(name)}</td>
|
||||
<td>{cleanBranchName}</td>
|
||||
<td><CommitHash commitId={commitId} /></td>
|
||||
<td>{msg || '-'}</td>
|
||||
<td><ReadableDate date={endTime} liveUpdate /></td>
|
||||
|
|
|
@ -85,8 +85,11 @@ class RunDetails extends Component {
|
|||
|
||||
const baseUrl = buildRunDetailsUrl(organization, name, branch, runId);
|
||||
|
||||
const currentRun = this.props.runs.filter(
|
||||
(run) => run.id === runId && decodeURIComponent(run.pipeline) === branch)[0];
|
||||
/* eslint-disable arrow-body-style */
|
||||
const currentRun = this.props.runs.filter((run) => {
|
||||
return run.id === runId &&
|
||||
decodeURIComponent(run.pipeline) === branch;
|
||||
})[0];
|
||||
|
||||
currentRun.name = name;
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ export function calculateStepsBaseUrl(config) {
|
|||
`${_appURLBase}/rest/organizations/jenkins/` +
|
||||
`pipelines/${name}`;
|
||||
if (isMultiBranch) {
|
||||
baseUrl = `${baseUrl}/branches/${branch}`;
|
||||
baseUrl = `${baseUrl}/branches/${uriString(branch)}`;
|
||||
}
|
||||
if (node && node !== null) {
|
||||
return `${baseUrl}/runs/${runId}/nodes/${node}/steps/`;
|
||||
|
|
Loading…
Reference in New Issue