diff --git a/frontend/public/extend/devconsole/components/pipelineruns/PipelineRunRow.tsx b/frontend/public/extend/devconsole/components/pipelineruns/PipelineRunRow.tsx index c6b897f6aba..c98ebed4137 100644 --- a/frontend/public/extend/devconsole/components/pipelineruns/PipelineRunRow.tsx +++ b/frontend/public/extend/devconsole/components/pipelineruns/PipelineRunRow.tsx @@ -11,6 +11,7 @@ import { import { pipelineRunFilterReducer } from '../../utils/pipeline-filter-reducer'; import { reRunPipelineRun, stopPipelineRun } from '../../utils/pipeline-actions'; import { PipelineRun } from '../../utils/pipeline-augment'; +import { PipelineTaskStatus } from './PipelineTaskStatus'; interface PipelineRunRowProps { obj: PipelineRun; @@ -48,7 +49,9 @@ const PipelineRunRow: React.FC = (props) => {
-
-
+
+ +
-
{pipelinerun && diff --git a/frontend/public/extend/devconsole/components/pipelineruns/PipelineTaskStatus.tsx b/frontend/public/extend/devconsole/components/pipelineruns/PipelineTaskStatus.tsx new file mode 100644 index 00000000000..aa9b6b5bc0e --- /dev/null +++ b/frontend/public/extend/devconsole/components/pipelineruns/PipelineTaskStatus.tsx @@ -0,0 +1,87 @@ +/* eslint-disable no-undef */ +import * as React from 'react'; +import { VictoryStack, VictoryBar } from 'victory'; +import { getTaskStatus, PipelineRun } from '../../utils/pipeline-augment'; +import { Tooltip } from '../../../../components/utils/tooltip'; + +interface PipelineTaskStatusProps { + pipelinerun: PipelineRun; +} + +interface TaskStatusToolTipProps { + tooltip: Tooltip; +} + +interface Tooltip { + Succeeded?: number; + Running?: number; + Failed?: number; + Notstarted?: number; + FailedToStart?: number; +} + +//The colors are not final. pf-colors are not supported in the charts +export const mapColorMessage = { + Succeeded: { color: 'green', message: 'Succeded' }, + Running: { color: '#0066cc', message: 'Running' }, + Failed: { color: 'red', message: 'Failed' }, + Notstarted: { color: '#ccc', message: 'Not Started Yet' }, + FailedToStart: { color: 'red', message: 'PipelineRun Failed To Start' }, +}; + +const getMessage = (status: string, value: number = 0): string => { + if (status === 'Notstarted' || status === 'FailedToStart') { + return mapColorMessage[status].message; + } + return `${value} ${mapColorMessage[status].message} task(s).`; +}; + +export const TaskStatusToolTip: React.FC = (props) => { + const { tooltip } = props; + return ( +
+ {Object.keys(tooltip).map((status) => { + return ( +
+
+