Skip to content

Commit

Permalink
pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasser Elsayed committed Dec 4, 2018
1 parent c4660e6 commit c6e85d9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 30 deletions.
4 changes: 2 additions & 2 deletions frontend/src/lib/RunUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ export interface MetricMetadata {
}

function getPipelineId(run?: ApiRun | ApiJob): string | null {
return run && run.pipeline_spec && run.pipeline_spec.pipeline_id || null;
return (run && run.pipeline_spec && run.pipeline_spec.pipeline_id) || null;
}

function getPipelineSpec(run?: ApiRun | ApiJob): string | null {
return run && run.pipeline_spec && run.pipeline_spec.workflow_manifest || null;
return (run && run.pipeline_spec && run.pipeline_spec.workflow_manifest) || null;
}

function getFirstExperimentReferenceId(run?: ApiRun | ApiJob): string | null {
Expand Down
63 changes: 35 additions & 28 deletions frontend/src/pages/PipelineDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,33 +114,40 @@ class PipelineDetails extends Page<{}, PipelineDetailsState> {

public getInitialToolbarState(): ToolbarProps {
const fromRunId = new URLParser(this.props).get(QUERY_PARAMS.fromRunId);
return {
actions: !!fromRunId ? [] : [{
action: this._createNewExperiment.bind(this),
icon: AddIcon,
id: 'startNewExperimentBtn',
primary: true,
title: 'Start an experiment',
tooltip: 'Create a new experiment beginning with this pipeline',
}, {
action: () => this.props.updateDialog({
buttons: [
{ onClick: () => this._deleteDialogClosed(true), text: 'Delete' },
{ onClick: () => this._deleteDialogClosed(false), text: 'Cancel' },
],
onClose: () => this._deleteDialogClosed(false),
title: 'Delete this pipeline?',
}),
id: 'deleteBtn',
title: 'Delete',
tooltip: 'Delete this pipeline',
}],
breadcrumbs: [!!fromRunId ?
{ displayName: fromRunId, href: RoutePage.RUN_DETAILS.replace(':' + RouteParams.runId, fromRunId) } :
{ displayName: 'Pipelines', href: RoutePage.PIPELINES }
],
pageTitle: !!fromRunId ? 'Pipeline details' : this.props.match.params[RouteParams.pipelineId],
};
if (fromRunId) {
return {
actions: [],
breadcrumbs: [
{ displayName: fromRunId, href: RoutePage.RUN_DETAILS.replace(':' + RouteParams.runId, fromRunId) }
],
pageTitle: 'Pipeline details',
};
} else {
return {
actions: [{
action: this._createNewExperiment.bind(this),
icon: AddIcon,
id: 'startNewExperimentBtn',
primary: true,
title: 'Start an experiment',
tooltip: 'Create a new experiment beginning with this pipeline',
}, {
action: () => this.props.updateDialog({
buttons: [
{ onClick: () => this._deleteDialogClosed(true), text: 'Delete' },
{ onClick: () => this._deleteDialogClosed(false), text: 'Cancel' },
],
onClose: () => this._deleteDialogClosed(false),
title: 'Delete this pipeline?',
}),
id: 'deleteBtn',
title: 'Delete',
tooltip: 'Delete this pipeline',
}],
breadcrumbs: [{ displayName: 'Pipelines', href: RoutePage.PIPELINES }],
pageTitle: this.props.match.params[RouteParams.pipelineId],
};
}
}

public render(): JSX.Element {
Expand Down Expand Up @@ -203,7 +210,7 @@ class PipelineDetails extends Page<{}, PipelineDetailsState> {
Show summary
</Button>
)}
<div className={classes(commonCss.flex, summaryShown && css.footerInfoOffset)}>
<div className={classes(commonCss.flex, summaryShown && !!pipeline && css.footerInfoOffset)}>
<InfoIcon style={{ color: color.lowContrast, height: 16, width: 16 }} />
<span className={css.infoSpan}>Static pipeline graph</span>
</div>
Expand Down

0 comments on commit c6e85d9

Please sign in to comment.