Skip to content

Commit

Permalink
fix(core): fix build link to parent pipeline (#4999)
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherchrisberry committed Mar 14, 2018
1 parent b2d6089 commit 274690d
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ export class ExecutionBuildLink extends React.Component<IExecutionBuildLinkProps
}

private handleParentPipelineClick() {
const { parentExecution } = this.props.execution.trigger;
const { $state } = ReactInjector;
ReactGA.event({ category: 'Pipeline', action: 'Execution build number clicked - parent pipeline' });
const toStateParams = { application: this.props.execution.trigger.parentPipelineApplication, executionId: this.props.execution.trigger.parentPipelineId };
const toStateParams = { application: parentExecution.application, executionId: parentExecution.id };
const toStateOptions = { inherit: false, reload: 'home.applications.application.pipelines.executionDetails' };
const nextState = `${$state.current.name.endsWith('.execution') ? '^' : ''}.^.executionDetails.execution`;
$state.go(nextState, toStateParams, toStateOptions);
Expand All @@ -32,14 +33,15 @@ export class ExecutionBuildLink extends React.Component<IExecutionBuildLinkProps
}

public render() {
const { trigger } = this.props.execution;
return (
<span>
{ this.props.execution.trigger.parentPipelineId && (
{ trigger.parentExecution && trigger.parentExecution.id && (
<a
className="execution-build-number clickable"
onClick={this.handleParentPipelineClick}
>
{this.props.execution.trigger.parentPipelineName}
{trigger.parentExecution.name}
</a>
)}
{ this.props.execution.buildInfo && this.props.execution.buildInfo.number && (
Expand Down

0 comments on commit 274690d

Please sign in to comment.