import { Link } from 'react-router-dom'; import { DescriptionList, DescriptionListDescription, DescriptionListGroup, DescriptionListTerm, } from '@patternfly/react-core'; import { COMPONENT_VERSIONS_PATH } from '@routes/paths'; import { DetailsSection } from '~/components/DetailsPage'; import ExternalLink from '~/shared/components/links/ExternalLink'; import { ComponentBuildPipeline, ComponentKind, ComponentVersion, PipelineDefinition, } from '~/types'; const pipelineLabels: Record = { 'pull-and-push': 'Pull and push pipeline', pull: 'Pull pipeline', push: 'Push pipeline', }; const PipelineConfiguration: React.FC<{ definition: PipelineDefinition }> = ({ definition }) => { const name = definition['pipelineref-by-name']; const bundle = definition['pipelinespec-from-bundle']; const git = definition['pipelineref-by-git-resolver']; return ( <> {name &&
{name}
} {bundle && ( <>
{bundle.name}
{bundle.bundle}
)} {git && ( <>
{git.revision}
{git.pathInRepo}
)} ); }; const ComponentBuildSettings: React.FC<{ component: ComponentKind; version?: ComponentVersion; }> = ({ component, version }) => { const pipeline = version?.['build-pipeline'] ?? component.spec['default-build-pipeline']; const definitions = Object.entries(pipelineLabels).filter(([key]) => pipeline?.[key]); return (

{version ? `Current configuration for version ${version.name}` : 'Component defaults'}

{!version && ( View version overrides )} {version && ( Builds {version['skip-builds'] ? 'Disabled' : 'Enabled'} )} {definitions.map(([key, label]) => ( {label} ))} {!definitions.length &&

No pipeline configured

}
); }; export default ComponentBuildSettings;