-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
import { Truncate } from '@patternfly/react-core'; | ||
|
||
import { PipelineKFv2, PipelineVersionKFv2 } from '~/concepts/pipelines/kfTypes'; | ||
import { | ||
asTimestamp, | ||
DetailItem, | ||
renderDetailItems, | ||
} from '~/concepts/pipelines/content/pipelinesDetails/pipelineRun/utils'; | ||
|
||
type PipelineSummaryDescriptionListProps = { | ||
pipeline: PipelineKFv2 | null; | ||
version: PipelineVersionKFv2 | null; | ||
}; | ||
|
||
export const PipelineSummaryDescriptionList: React.FC<PipelineSummaryDescriptionListProps> = ({ | ||
pipeline, | ||
version, | ||
}) => { | ||
if (!pipeline) { | ||
return null; | ||
Check warning on line 23 in frontend/src/concepts/pipelines/content/pipelinesDetails/pipeline/PipelineSummaryDescriptionList.tsx Codecov / codecov/patchfrontend/src/concepts/pipelines/content/pipelinesDetails/pipeline/PipelineSummaryDescriptionList.tsx#L23
|
||
} | ||
|
||
const details: DetailItem[] = [ | ||
{ key: 'Pipeline ID', value: <Truncate content={pipeline.pipeline_id} /> }, | ||
...(version | ||
? [ | ||
{ | ||
key: 'Version ID', | ||
value: version.pipeline_version_id, | ||
}, | ||
] | ||
: []), | ||
Check warning on line 35 in frontend/src/concepts/pipelines/content/pipelinesDetails/pipeline/PipelineSummaryDescriptionList.tsx Codecov / codecov/patchfrontend/src/concepts/pipelines/content/pipelinesDetails/pipeline/PipelineSummaryDescriptionList.tsx#L35
|
||
...(version?.code_source_url | ||
? [ | ||
Check warning on line 37 in frontend/src/concepts/pipelines/content/pipelinesDetails/pipeline/PipelineSummaryDescriptionList.tsx Codecov / codecov/patchfrontend/src/concepts/pipelines/content/pipelinesDetails/pipeline/PipelineSummaryDescriptionList.tsx#L37
|
||
{ | ||
key: 'Version source', | ||
value: <Link to={version.code_source_url}>{version.code_source_url}</Link>, | ||
}, | ||
] | ||
: []), | ||
{ key: 'Uploaded on', value: asTimestamp(new Date(pipeline.created_at)) }, | ||
...(pipeline.description ? [{ key: 'Pipeline description', value: pipeline.description }] : []), | ||
]; | ||
|
||
return renderDetailItems(details); | ||
}; |