forked from red-hat-data-services/odh-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9584b5e
commit 360eabe
Showing
43 changed files
with
221 additions
and
199 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
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
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
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
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
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
41 changes: 0 additions & 41 deletions
41
frontend/src/concepts/pipelines/content/createRun/contentSections/ExperimentSection.tsx
This file was deleted.
Oops, something went wrong.
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
60 changes: 60 additions & 0 deletions
60
.../src/concepts/pipelines/content/createRun/contentSections/ProjectAndExperimentSection.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,60 @@ | ||
import * as React from 'react'; | ||
import { FormGroup, FormSection, Stack, StackItem, Text } from '@patternfly/react-core'; | ||
import { PlusCircleIcon } from '@patternfly/react-icons'; | ||
import { ExperimentKFv2 } from '~/concepts/pipelines/kfTypes'; | ||
import { | ||
CreateRunPageSections, | ||
runPageSectionTitles, | ||
} from '~/concepts/pipelines/content/createRun/const'; | ||
import ExperimentSelector from '~/concepts/pipelines/content/experiment/ExperimentSelector'; | ||
import CreateExperimentButton from '~/concepts/pipelines/content/experiment/CreateExperimentButton'; | ||
import { SupportedArea, useIsAreaAvailable } from '~/concepts/areas'; | ||
|
||
type ExperimentSectionProps = { | ||
projectName: string; | ||
value: ExperimentKFv2 | null; | ||
onChange: (experiment: ExperimentKFv2) => void; | ||
}; | ||
|
||
const ProjectAndExperimentSection: React.FC<ExperimentSectionProps> = ({ | ||
projectName, | ||
value, | ||
onChange, | ||
}) => { | ||
const isExperimentsAvailable = useIsAreaAvailable(SupportedArea.PIPELINE_EXPERIMENTS).status; | ||
|
||
return ( | ||
<FormSection | ||
id={CreateRunPageSections.PROJECT_AND_EXPERIMENT} | ||
title={ | ||
isExperimentsAvailable | ||
? runPageSectionTitles[CreateRunPageSections.PROJECT_AND_EXPERIMENT] | ||
: 'Project' | ||
} | ||
> | ||
<FormGroup label="Project"> | ||
<Text>{projectName}</Text> | ||
</FormGroup> | ||
{isExperimentsAvailable && ( | ||
<FormGroup label="Experiment" aria-label="Experiment" isRequired> | ||
<Stack hasGutter> | ||
<StackItem> | ||
<ExperimentSelector selection={value?.display_name} onSelect={onChange} /> | ||
</StackItem> | ||
<StackItem> | ||
<CreateExperimentButton | ||
variant="link" | ||
icon={<PlusCircleIcon />} | ||
onCreate={(experiment) => onChange(experiment)} | ||
> | ||
Create new experiment | ||
</CreateExperimentButton> | ||
</StackItem> | ||
</Stack> | ||
</FormGroup> | ||
)} | ||
</FormSection> | ||
); | ||
}; | ||
|
||
export default ProjectAndExperimentSection; |
Oops, something went wrong.