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.
refactor pipelines and experiments routes
- Loading branch information
1 parent
5274af0
commit b99da85
Showing
76 changed files
with
1,636 additions
and
1,086 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
57 changes: 40 additions & 17 deletions
57
frontend/src/concepts/pipelines/content/createRun/CloneRunPage.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
62 changes: 62 additions & 0 deletions
62
frontend/src/concepts/pipelines/content/createRun/CloneSchedulePage.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,62 @@ | ||
import React from 'react'; | ||
import { Breadcrumb, BreadcrumbItem, Truncate } from '@patternfly/react-core'; | ||
|
||
import { useParams, Link } from 'react-router-dom'; | ||
import RunPage from '~/concepts/pipelines/content/createRun/RunPage'; | ||
import ApplicationsPage from '~/pages/ApplicationsPage'; | ||
import { PathProps } from '~/concepts/pipelines/content/types'; | ||
import { ExperimentKFv2, PipelineKFv2, PipelineVersionKFv2 } from '~/concepts/pipelines/kfTypes'; | ||
import usePipelineRunJobById from '~/concepts/pipelines/apiHooks/usePipelineRunJobById'; | ||
import { RunTypeOption } from './types'; | ||
|
||
type CloneSchedulePageProps = { | ||
detailsRedirect: (jobId: string) => string; | ||
contextExperiment?: ExperimentKFv2 | null; | ||
contextPipeline?: PipelineKFv2 | null; | ||
contextPipelineVersion?: PipelineVersionKFv2 | null; | ||
}; | ||
|
||
const CloneSchedulePage: React.FC<PathProps & CloneSchedulePageProps> = ({ | ||
breadcrumbPath, | ||
contextPath, | ||
detailsRedirect, | ||
...props | ||
}) => { | ||
const { recurringRunId } = useParams(); | ||
const [job, loaded, error] = usePipelineRunJobById(recurringRunId); | ||
|
||
return ( | ||
<ApplicationsPage | ||
title="Duplicate schedule" | ||
breadcrumb={ | ||
<Breadcrumb> | ||
{breadcrumbPath} | ||
<BreadcrumbItem isActive style={{ maxWidth: 300 }}> | ||
{job ? ( | ||
<Link to={detailsRedirect(job.recurring_run_id)}> | ||
{/* TODO: Remove the custom className after upgrading to PFv6 */} | ||
<Truncate content={job.display_name} className="truncate-no-min-width" /> | ||
</Link> | ||
) : ( | ||
'Loading...' | ||
)} | ||
</BreadcrumbItem> | ||
<BreadcrumbItem isActive>Duplicate schedule</BreadcrumbItem> | ||
</Breadcrumb> | ||
} | ||
loaded={loaded} | ||
loadError={error} | ||
empty={false} | ||
> | ||
<RunPage | ||
cloneRun={job} | ||
contextPath={contextPath} | ||
runType={RunTypeOption.SCHEDULED} | ||
testId="clone-run-page" | ||
{...props} | ||
/> | ||
</ApplicationsPage> | ||
); | ||
}; | ||
|
||
export default CloneSchedulePage; |
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.