Skip to content

Commit

Permalink
Merge pull request #2823 from jpuzz0/RHOAIENG-7421
Browse files Browse the repository at this point in the history
[RHOAIENG-7421] pipeline run artifact detail drawer link to artifact details not behind flag
  • Loading branch information
openshift-merge-bot[bot] authored May 20, 2024
2 parents 4b855d8 + 6c45564 commit cd93b29
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ const task: PipelineTask = {
volumeMounts: [],
};

jest.mock('~/concepts/areas/useIsAreaAvailable', () => () => ({
status: true,
featureFlags: {},
reliantAreas: {},
requiredComponents: {},
requiredCapabilities: {},
customCondition: jest.fn(),
}));

describe('PipelineRunDrawerRightContent', () => {
it('renders artifact drawer tabs when the task prop is of type "artifact"', () => {
render(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { usePipelinesAPI } from '~/concepts/pipelines/context';
import { getArtifactName } from '~/pages/pipelines/global/experiments/artifacts/utils';
import PipelinesTableRowTime from '~/concepts/pipelines/content/tables/PipelinesTableRowTime';
import PipelineRunDrawerRightContent from '~/concepts/pipelines/content/pipelinesDetails/pipelineRun/PipelineRunDrawerRightContent';
import { SupportedArea, useIsAreaAvailable } from '~/concepts/areas';

type ArtifactNodeDetailsProps = Pick<
React.ComponentProps<typeof PipelineRunDrawerRightContent>,
Expand All @@ -32,6 +33,7 @@ export const ArtifactNodeDetails: React.FC<ArtifactNodeDetailsProps> = ({
}) => {
const { namespace } = usePipelinesAPI();
const artifactName = getArtifactName(artifact);
const isExperimentsAvailable = useIsAreaAvailable(SupportedArea.PIPELINE_EXPERIMENTS).status;

return (
<Flex
Expand All @@ -53,7 +55,11 @@ export const ArtifactNodeDetails: React.FC<ArtifactNodeDetailsProps> = ({

<DescriptionListTerm>Artifact name</DescriptionListTerm>
<DescriptionListDescription>
<Link to={artifactsDetailsRoute(namespace, artifact.id)}>{artifactName}</Link>
{isExperimentsAvailable ? (
<Link to={artifactsDetailsRoute(namespace, artifact.id)}>{artifactName}</Link>
) : (
artifactName
)}
</DescriptionListDescription>

<DescriptionListTerm>Artifact type</DescriptionListTerm>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ jest.mock('~/concepts/pipelines/content/artifacts/charts/confusionMatrix/utils',
})),
}));

jest.mock('~/concepts/areas/useIsAreaAvailable', () => () => ({
status: true,
featureFlags: {},
reliantAreas: {},
requiredComponents: {},
requiredCapabilities: {},
customCondition: jest.fn(),
}));

describe('ArtifactNodeDrawerContent', () => {
it('renders artifact drawer content', () => {
render(
Expand Down

0 comments on commit cd93b29

Please sign in to comment.