-
Notifications
You must be signed in to change notification settings - Fork 163
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 #2697 from jpuzz0/RHOAIENG-4648-ux-content-updates
[RHOAIENG-4648] UX content updates
- Loading branch information
Showing
18 changed files
with
129 additions
and
150 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
108 changes: 77 additions & 31 deletions
108
frontend/src/concepts/pipelines/content/createRun/contentSections/PipelineSection.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 |
---|---|---|
@@ -1,44 +1,90 @@ | ||
import * as React from 'react'; | ||
import React from 'react'; | ||
|
||
import { FormGroup, FormSection, Stack, StackItem } from '@patternfly/react-core'; | ||
import { PlusCircleIcon } from '@patternfly/react-icons'; | ||
|
||
import { | ||
CreateRunPageSections, | ||
runPageSectionTitles, | ||
} from '~/concepts/pipelines/content/createRun/const'; | ||
import { PipelineKFv2 } from '~/concepts/pipelines/kfTypes'; | ||
import { PipelineKFv2, PipelineVersionKFv2 } from '~/concepts/pipelines/kfTypes'; | ||
import PipelineSelector from '~/concepts/pipelines/content/pipelineSelector/PipelineSelector'; | ||
import ImportPipelineButton from '~/concepts/pipelines/content/import/ImportPipelineButton'; | ||
import PipelineVersionSelector from '~/concepts/pipelines/content/pipelineSelector/PipelineVersionSelector'; | ||
import RunForm from '~/concepts/pipelines/content/createRun/RunForm'; | ||
import ImportPipelineVersionButton from '~/concepts/pipelines/content/import/ImportPipelineVersionButton'; | ||
|
||
type PipelineSectionProps = { | ||
value: PipelineKFv2 | null; | ||
onChange: (pipeline: PipelineKFv2) => void; | ||
type PipelineSectionProps = Pick<React.ComponentProps<typeof RunForm>, 'onValueChange'> & { | ||
pipeline: PipelineKFv2 | null; | ||
version: PipelineVersionKFv2 | null; | ||
updateInputParams: (version: PipelineVersionKFv2 | undefined) => void; | ||
}; | ||
|
||
const PipelineSection: React.FC<PipelineSectionProps> = ({ value, onChange }) => ( | ||
<FormSection | ||
id={CreateRunPageSections.PIPELINE} | ||
title={runPageSectionTitles[CreateRunPageSections.PIPELINE]} | ||
> | ||
<FormGroup> | ||
<Stack hasGutter> | ||
<StackItem> | ||
<PipelineSelector | ||
selection={value?.display_name} | ||
onSelect={(pipeline) => onChange(pipeline)} | ||
/> | ||
</StackItem> | ||
<StackItem> | ||
<ImportPipelineButton | ||
variant="link" | ||
icon={<PlusCircleIcon />} | ||
onCreate={(pipeline) => onChange(pipeline)} | ||
> | ||
Create new pipeline | ||
</ImportPipelineButton> | ||
</StackItem> | ||
</Stack> | ||
</FormGroup> | ||
</FormSection> | ||
); | ||
const PipelineSection: React.FC<PipelineSectionProps> = ({ | ||
pipeline, | ||
version, | ||
onValueChange, | ||
updateInputParams, | ||
}) => { | ||
const onPipelineChange = React.useCallback( | ||
(value: PipelineKFv2) => { | ||
onValueChange('pipeline', value); | ||
onValueChange('version', undefined); | ||
}, | ||
[onValueChange], | ||
); | ||
|
||
const onVersionChange = React.useCallback( | ||
(value: PipelineVersionKFv2) => { | ||
onValueChange('version', value); | ||
updateInputParams(value); | ||
}, | ||
[onValueChange, updateInputParams], | ||
); | ||
|
||
return ( | ||
<FormSection | ||
id={CreateRunPageSections.PIPELINE} | ||
title={runPageSectionTitles[CreateRunPageSections.PIPELINE]} | ||
> | ||
<FormGroup label="Pipeline" isRequired> | ||
<Stack hasGutter> | ||
<StackItem> | ||
<PipelineSelector selection={pipeline?.display_name} onSelect={onPipelineChange} /> | ||
</StackItem> | ||
<StackItem> | ||
<ImportPipelineButton | ||
variant="link" | ||
icon={<PlusCircleIcon />} | ||
onCreate={onPipelineChange} | ||
> | ||
Create new pipeline | ||
</ImportPipelineButton> | ||
</StackItem> | ||
</Stack> | ||
</FormGroup> | ||
|
||
<FormGroup label="Pipeline version" isRequired> | ||
<Stack hasGutter> | ||
<StackItem> | ||
<PipelineVersionSelector | ||
selection={version?.display_name} | ||
pipelineId={pipeline?.pipeline_id} | ||
onSelect={onVersionChange} | ||
/> | ||
</StackItem> | ||
<StackItem> | ||
<ImportPipelineVersionButton | ||
selectedPipeline={pipeline} | ||
variant="link" | ||
icon={<PlusCircleIcon />} | ||
onCreate={onVersionChange} | ||
/> | ||
</StackItem> | ||
</Stack> | ||
</FormGroup> | ||
</FormSection> | ||
); | ||
}; | ||
|
||
export default PipelineSection; |
51 changes: 0 additions & 51 deletions
51
frontend/src/concepts/pipelines/content/createRun/contentSections/PipelineVersionSection.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
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
Oops, something went wrong.