-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: upgrade react-router-dom, typescript Signed-off-by: Oleksii Kurinnyi <[email protected]> * fix: switching between tabs Signed-off-by: Oleksii Kurinnyi <[email protected]> * fix: open recent workspace Signed-off-by: Oleksii Kurinnyi <[email protected]> * fix: importing createRoot Signed-off-by: Oleksii Kurinnyi <[email protected]> * fix: linter issues Signed-off-by: Oleksii Kurinnyi <[email protected]> * chore: use navigate instead of history on Get Started page Signed-off-by: Oleksii Kurinnyi <[email protected]> * chore: use navigate instead of history on the Loader page Signed-off-by: Oleksii Kurinnyi <[email protected]> * chore: use navigate instead of history on the UserPreferences page Signed-off-by: Oleksii Kurinnyi <[email protected]> * chore: use navigate instead of history on the WorkspaceDetails page Signed-off-by: Oleksii Kurinnyi <[email protected]> * chore: use navigate instead of history on the WorkspacesList page Signed-off-by: Oleksii Kurinnyi <[email protected]> * chore: update the v1 yarn.lock Signed-off-by: Oleksii Kurinnyi <[email protected]> --------- Signed-off-by: Oleksii Kurinnyi <[email protected]>
- Loading branch information
Showing
91 changed files
with
1,294 additions
and
1,175 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,7 +161,8 @@ | |
| [`@types/[email protected]`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #10792 | | ||
| [`@types/[email protected]`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | ||
| [`@types/[email protected]`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #13991 | | ||
| [`@types/[email protected]`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | ||
| [`@types/[email protected]`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | ||
| [`@types/[email protected]`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | ||
| [`@types/[email protected]`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | ||
| [`@types/[email protected]`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | ||
| [`@types/[email protected]`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | ||
|
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 |
---|---|---|
|
@@ -41,6 +41,7 @@ | |
| [`@patternfly/[email protected]`](https://github.com/patternfly/patternfly-react.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/@patternfly/react-table/4.113.6) | | ||
| [`@patternfly/[email protected]`](https://github.com/patternfly/patternfly-react.git) | MIT | clearlydefined | | ||
| [`@pkgjs/[email protected]`]([email protected]:pkgjs/parseargs.git) | MIT | #8236 | | ||
| [`@remix-run/[email protected]`](https://github.com/remix-run/react-router) | MIT | clearlydefined | | ||
| `@sideway/[email protected]` | BSD-3-Clause | #3098 | | ||
| `@sideway/[email protected]` | BSD-3-Clause | clearlydefined | | ||
| `@sideway/[email protected]` | BSD-3-Clause | clearlydefined | | ||
|
@@ -115,7 +116,6 @@ | |
| [`[email protected]`]([email protected]:colorjs/color-name.git) | MIT | clearlydefined | | ||
| `[email protected]` | MIT | clearlydefined | | ||
| [`[email protected]`](git://github.com/felixge/node-combined-stream.git) | MIT | clearlydefined | | ||
| [`[email protected]`](https://github.com/supasate/connected-react-router.git) | MIT | clearlydefined | | ||
| `[email protected]` | MIT | clearlydefined | | ||
| [`[email protected]`](https://github.com/visionmedia/node-cookie-signature.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/cookie-signature/1.2.1) | | ||
| `[email protected]` | MIT | clearlydefined | | ||
|
@@ -227,7 +227,6 @@ | |
| `[email protected]` | ISC | clearlydefined | | ||
| [`[email protected]`](git://github.com/ashtuchkin/iconv-lite.git) | MIT | clearlydefined | | ||
| [`[email protected]`](git://github.com/feross/ieee754.git) | BSD-3-Clause | clearlydefined | | ||
| [`[email protected]`](git://github.com/immutable-js/immutable-js.git) | MIT | #7353 | | ||
| [`[email protected]`](https://github.com/jensyt/imurmurhash-js) | MIT | clearlydefined | | ||
| `[email protected]` | MIT | clearlydefined | | ||
| [`[email protected]`](https://github.com/npm/inflight.git) | ISC | clearlydefined | | ||
|
@@ -241,7 +240,6 @@ | |
| [`[email protected]`](https://github.com/watson/is-lambda.git) | MIT | clearlydefined | | ||
| [`[email protected]`](https://github.com/jonschlinkert/is-plain-object) | MIT | clearlydefined | | ||
| [`[email protected]`](git://github.com/hughsk/is-typedarray.git) | MIT | #2531 | | ||
| [`[email protected]`](git://github.com/juliangruber/isarray.git) | MIT | clearlydefined | | ||
| [`[email protected]`](git+https://github.com/isaacs/isexe.git) | ISC | clearlydefined | | ||
| `[email protected]` | ISC | clearlydefined | | ||
| [`[email protected]`](git+https://github.com/heineiuo/isomorphic-ws.git) | MIT | clearlydefined | | ||
|
@@ -268,7 +266,6 @@ | |
| [`[email protected]`](git://github.com/joyent/node-jsprim.git) | MIT | clearlydefined | | ||
| `[email protected]` | MIT | clearlydefined | | ||
| [`[email protected]`](https://github.com/fastify/light-my-request.git) | BSD-3-Clause | clearlydefined | | ||
| [`[email protected]`](https://lodash.com/) | MIT | clearlydefined | | ||
| [`[email protected]`](https://lodash.com/) | MIT | #2096 | | ||
| [`[email protected]`](git://github.com/zertosh/loose-envify.git) | MIT | clearlydefined | | ||
| `[email protected]` | ISC | #11688 | | ||
|
@@ -328,7 +325,6 @@ | |
| `[email protected]` | MIT | clearlydefined | | ||
| [`[email protected]`](git+https://github.com/isaacs/path-scurry) | BlueOak-1.0.0 | #9370 | | ||
| [`[email protected]`](git+https://github.com/isaacs/path-scurry) | BlueOak-1.0.0 | clearlydefined | | ||
| [`[email protected]`](https://github.com/pillarjs/path-to-regexp.git) | MIT | clearlydefined | | ||
| [`[email protected]`](https://github.com/crypto-browserify/pbkdf2.git) | MIT | clearlydefined | | ||
| [`[email protected]`](git://github.com/braveg1rl/performance-now.git) | MIT | clearlydefined | | ||
| `[email protected]` | ISC | #14718 | | ||
|
@@ -370,8 +366,8 @@ | |
| [`[email protected]`](https://github.com/facebook/react.git) | MIT | clearlydefined | | ||
| [`[email protected]`](https://github.com/tsmith123/react-pluralize) | MIT | clearlydefined | | ||
| [`[email protected]`](https://github.com/reduxjs/react-redux) | MIT | #2978 | | ||
| [`react-router-dom@5.3.4`](https://github.com/remix-run/react-router.git) | MIT | #3023 | | ||
| [`react-router@5.3.4`](https://github.com/remix-run/react-router.git) | MIT | #3024 | | ||
| [`react-router-dom@6.26.1`](https://github.com/remix-run/react-router) | MIT | #15860 | | ||
| [`react-router@6.26.1`](https://github.com/remix-run/react-router) | MIT | clearlydefined | | ||
| [`[email protected]`](https://github.com/gaearon/react-side-effect.git) | MIT | clearlydefined | | ||
| [`[email protected]`](https://github.com/ReactTooltip/react-tooltip#readme) | MIT | #5006 | | ||
| [`[email protected]`](https://github.com/facebook/react.git) | MIT | clearlydefined | | ||
|
@@ -403,7 +399,6 @@ | |
| [`[email protected]`](git+https://github.com/ChALkeR/safer-buffer.git) | MIT | clearlydefined | | ||
| [`[email protected]`](https://github.com/apostrophecms/sanitize-html.git) | MIT | clearlydefined | | ||
| [`[email protected]`](https://github.com/facebook/react.git) | MIT | #14588 | | ||
| [`[email protected]`](https://github.com/rtfeldman/seamless-immutable.git) | BSD-3-Clause | clearlydefined | | ||
| [`[email protected]`](git+https://github.com/fastify/secure-json-parse.git) | BSD-3-Clause | clearlydefined | | ||
| [`[email protected]`](https://github.com/npm/node-semver.git) | ISC | clearlydefined | | ||
| [`[email protected]`](https://github.com/nfriedly/set-cookie-parser) | MIT | clearlydefined | | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) 2018-2024 Red Hat, Inc. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
|
||
import React from 'react'; | ||
import { Navigate, useLocation } from 'react-router-dom'; | ||
|
||
import { buildFactoryLoaderPath } from '@/preload/main'; | ||
import { ROUTE } from '@/Routes'; | ||
|
||
/** | ||
* Redirects to the correct page based on the path. | ||
*/ | ||
export function Redirects(): React.ReactElement { | ||
const location = useLocation(); | ||
const { pathname, search } = location; | ||
|
||
if ( | ||
pathname.startsWith('/http://') || | ||
pathname.startsWith('/https://') || | ||
pathname.startsWith('/ssh://') || | ||
pathname.startsWith('/git@') | ||
) { | ||
// get rid of the leading slash | ||
const locationPath = pathname.replace(/^\//, '') + search; | ||
|
||
const factoryLoaderPath = buildFactoryLoaderPath(locationPath).replace( | ||
/^\/f/, | ||
ROUTE.FACTORY_LOADER, | ||
); | ||
|
||
return <Navigate key="redirect-to-factory" to={factoryLoaderPath} />; | ||
} | ||
|
||
return <Navigate key="redirect-to-home" to={ROUTE.HOME} />; | ||
} |
Oops, something went wrong.