-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1722 from Gkrumbach07/params-tab
Added pipeline run param tab
- Loading branch information
Showing
4 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
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
52 changes: 52 additions & 0 deletions
52
.../src/concepts/pipelines/content/pipelinesDetails/pipelineRun/PipelineRunTabParameters.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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import * as React from 'react'; | ||
import { | ||
Spinner, | ||
EmptyStateVariant, | ||
EmptyState, | ||
Title, | ||
EmptyStateBody, | ||
} from '@patternfly/react-core'; | ||
import { PipelineRunKF } from '~/concepts/pipelines/kfTypes'; | ||
import { | ||
DetailItem, | ||
renderDetailItems, | ||
} from '~/concepts/pipelines/content/pipelinesDetails/pipelineRun/utils'; | ||
type PipelineRunTabParametersProps = { | ||
pipelineRunKF?: PipelineRunKF; | ||
}; | ||
|
||
const PipelineRunTabParameters: React.FC<PipelineRunTabParametersProps> = ({ pipelineRunKF }) => { | ||
if (!pipelineRunKF) { | ||
return ( | ||
<EmptyState variant={EmptyStateVariant.large} data-id="loading-empty-state"> | ||
<Spinner size="xl" /> | ||
<Title headingLevel="h4" size="lg"> | ||
Loading | ||
</Title> | ||
</EmptyState> | ||
); | ||
} | ||
|
||
if ( | ||
!pipelineRunKF?.pipeline_spec.parameters || | ||
pipelineRunKF.pipeline_spec.parameters.length === 0 | ||
) { | ||
return ( | ||
<EmptyState variant={EmptyStateVariant.large} data-id="parameters-empty-state"> | ||
<Title headingLevel="h4" size="lg"> | ||
No parameters | ||
</Title> | ||
<EmptyStateBody>This pipeline run does not have any parameters defined.</EmptyStateBody> | ||
</EmptyState> | ||
); | ||
} | ||
|
||
const details: DetailItem[] = pipelineRunKF.pipeline_spec.parameters.map((param) => ({ | ||
key: param.name, | ||
value: param.value, | ||
})); | ||
|
||
return <>{renderDetailItems(details)}</>; | ||
}; | ||
|
||
export default PipelineRunTabParameters; |
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