Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
DaoDaoNoCode committed May 23, 2024
1 parent 0077ff1 commit 0f5a1c4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
15 changes: 14 additions & 1 deletion frontend/src/concepts/pipelines/content/createRun/RunPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { PipelineRunType } from '~/pages/pipelines/global/runs';
import useExperimentById from '~/concepts/pipelines/apiHooks/useExperimentById';
import { asEnumMember } from '~/utilities/utils';
import { routePipelineRunsNamespace } from '~/routes';
import { SupportedArea, useIsAreaAvailable } from '~/concepts/areas';

type RunPageProps = {
cloneRun?: PipelineRunKFv2 | PipelineRunJobKFv2 | null;
Expand All @@ -52,6 +53,7 @@ const RunPage: React.FC<RunPageProps> = ({ cloneRun, contextPath, testId }) => {
const [cloneRunPipelineVersion] = usePipelineVersionById(cloneRunPipelineId, cloneRunVersionId);
const [cloneRunPipeline] = usePipelineById(cloneRunPipelineId);
const [runExperiment] = useExperimentById(cloneRunExperimentId || experimentId);
const isExperimentsAvailable = useIsAreaAvailable(SupportedArea.PIPELINE_EXPERIMENTS).status;

const jumpToSections = Object.values(CreateRunPageSections).filter(
(section) =>
Expand Down Expand Up @@ -99,10 +101,21 @@ const RunPage: React.FC<RunPageProps> = ({ cloneRun, contextPath, testId }) => {
[setFormDataValue],
);

const runPageSectionTitlesEdited = isExperimentsAvailable
? runPageSectionTitles
: {
...runPageSectionTitles,
[CreateRunPageSections.PROJECT_AND_EXPERIMENT]: 'Project',
};

return (
<div data-testid={testId}>
<PageSection isFilled variant="light">
<GenericSidebar sections={jumpToSections} titles={runPageSectionTitles} maxWidth={175}>
<GenericSidebar
sections={jumpToSections}
titles={runPageSectionTitlesEdited}
maxWidth={175}
>
<RunForm
data={formData}
runType={runType as PipelineRunType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ const ProjectAndExperimentSection: React.FC<ExperimentSectionProps> = ({
return (
<FormSection
id={CreateRunPageSections.PROJECT_AND_EXPERIMENT}
title={runPageSectionTitles[CreateRunPageSections.PROJECT_AND_EXPERIMENT]}
title={
isExperimentsAvailable
? runPageSectionTitles[CreateRunPageSections.PROJECT_AND_EXPERIMENT]
: 'Project'
}
>
<FormGroup label="Project">
<Text>{projectName}</Text>
Expand Down

0 comments on commit 0f5a1c4

Please sign in to comment.