-
Notifications
You must be signed in to change notification settings - Fork 612
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update pipelinerun graph to show past pipeline structure
- Loading branch information
karthik
committed
Nov 4, 2020
1 parent
a6b7e84
commit f33b7df
Showing
17 changed files
with
461 additions
and
629 deletions.
There are no files selected for viewing
35 changes: 7 additions & 28 deletions
35
...ges/dev-console/src/components/pipelineruns/detail-page-tabs/PipelineRunVisualization.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,16 @@ | ||
import * as React from 'react'; | ||
import { Alert } from '@patternfly/react-core'; | ||
import { k8sGet } from '@console/internal/module/k8s'; | ||
import { PipelineModel } from '../../../models'; | ||
import PipelineVisualization from '../../pipelines/detail-page-tabs/pipeline-details/PipelineVisualization'; | ||
import { Pipeline, PipelineRun, pipelineRefExists } from '../../../utils/pipeline-augment'; | ||
import { PipelineRun, getPipelineFromPipelineRun } from '../../../utils/pipeline-augment'; | ||
|
||
type PipelineRunVisualizationProps = { | ||
pipelineRun: PipelineRun; | ||
}; | ||
|
||
const PipelineRunVisualization: React.FC<PipelineRunVisualizationProps> = ({ pipelineRun }) => { | ||
const [errorMessage, setErrorMessage] = React.useState<string>(null); | ||
const [pipeline, setPipeline] = React.useState<Pipeline>(null); | ||
|
||
React.useEffect(() => { | ||
if (pipelineRefExists(pipelineRun)) { | ||
k8sGet(PipelineModel, pipelineRun.spec.pipelineRef.name, pipelineRun.metadata.namespace) | ||
.then((res: Pipeline) => setPipeline(res)) | ||
.catch((error) => | ||
setErrorMessage(error?.message || 'Could not load visualization at this time.'), | ||
); | ||
} | ||
}, [pipelineRun, setPipeline]); | ||
|
||
if (errorMessage) { | ||
return <Alert variant="danger" isInline title={errorMessage} />; | ||
} | ||
|
||
if (!pipeline || !pipelineRun) { | ||
return null; | ||
} | ||
|
||
return <PipelineVisualization pipeline={pipeline} pipelineRun={pipelineRun} />; | ||
}; | ||
const PipelineRunVisualization: React.FC<PipelineRunVisualizationProps> = ({ pipelineRun }) => ( | ||
<PipelineVisualization | ||
pipeline={getPipelineFromPipelineRun(pipelineRun)} | ||
pipelineRun={pipelineRun} | ||
/> | ||
); | ||
|
||
export default PipelineRunVisualization; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
frontend/packages/dev-console/src/components/pipelineruns/status/PipelineTaskStatus.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.