Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Navigate to the correct prior page on cancel
- Loading branch information
Showing
6 changed files
with
58 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
import * as React from 'react'; | ||
import Helmet from 'react-helmet'; | ||
import { match as RouteMatch } from 'react-router-dom'; | ||
import { useLocation, useRouteMatch } from 'react-router-dom'; | ||
import { PageSection, Title } from '@patternfly/react-core'; | ||
import { QueryClient, QueryClientProvider } from 'react-query'; | ||
import { ImportWizard } from './ImportWizard/ImportWizard'; | ||
import { NamespaceContext } from 'src/context/NamespaceContext'; | ||
import { WizardReachedFromParam } from 'src/utils/paths'; | ||
|
||
const queryClient = new QueryClient(); | ||
|
||
interface PipelineWizardPageProps { | ||
match: RouteMatch<{ namespace: string }>; | ||
} | ||
|
||
const ImportPage: React.FunctionComponent<PipelineWizardPageProps> = ({ | ||
match: { | ||
const ImportPage: React.FunctionComponent = () => { | ||
const { | ||
params: { namespace }, | ||
}, | ||
}) => ( | ||
<> | ||
<Helmet> | ||
<title>Crane</title> | ||
</Helmet> | ||
<QueryClientProvider client={queryClient}> | ||
<NamespaceContext.Provider value={namespace}> | ||
<> | ||
<PageSection variant="light"> | ||
<Title headingLevel="h1">Import application</Title> | ||
</PageSection> | ||
<PageSection variant="light" type="wizard"> | ||
<ImportWizard /> | ||
</PageSection> | ||
</> | ||
</NamespaceContext.Provider> | ||
</QueryClientProvider> | ||
</> | ||
); | ||
} = useRouteMatch<{ namespace: string }>(); | ||
const location = useLocation(); | ||
const urlParams = React.useMemo(() => new URLSearchParams(location.search), [location.search]); | ||
return ( | ||
<> | ||
<Helmet> | ||
<title>Crane</title> | ||
</Helmet> | ||
<QueryClientProvider client={queryClient}> | ||
<NamespaceContext.Provider value={namespace}> | ||
<> | ||
<PageSection variant="light"> | ||
<Title headingLevel="h1">Import application</Title> | ||
</PageSection> | ||
<PageSection variant="light" type="wizard"> | ||
<ImportWizard reachedFrom={urlParams.get('from') as WizardReachedFromParam} /> | ||
</PageSection> | ||
</> | ||
</NamespaceContext.Provider> | ||
</QueryClientProvider> | ||
</> | ||
); | ||
}; | ||
|
||
export default ImportPage; |
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