Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as React from 'react';
import { Navigate, useSearchParams } from 'react-router-dom-v5-compat';

// Redirect all-namespaces catalog to default namespace
// TODO: Make Software Catalog work with all namespaces. https://issues.redhat.com/browse/CONSOLE-4827
// Redirect catalog to default namespace
const CatalogDefaultNamespaceRedirect: React.FCC = () => {
const [params] = useSearchParams();
return <Navigate to={`/catalog/ns/default?${params.toString()}`} replace />;
Expand Down
8 changes: 0 additions & 8 deletions frontend/packages/dev-console/console-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1065,14 +1065,6 @@
"component": { "$codeRef": "topologyPage" }
}
},
{
"type": "console.page/route",
"properties": {
"exact": true,
"path": ["/catalog/all-namespaces"],
"component": { "$codeRef": "CatalogDefaultNamespaceRedirect" }
}
},
{
"type": "console.page/route",
"properties": {
Expand Down
1 change: 0 additions & 1 deletion frontend/packages/dev-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"CatalogTypesConfiguration": "src/components/catalog/CatalogTypesConfiguration.tsx",
"PinnedResourcesConfiguration": "src/components/catalog/PinnedResourcesConfiguration.tsx",
"CatalogPage": "src/components/catalog/CatalogPage.tsx",
"CatalogDefaultNamespaceRedirect": "src/components/catalog/CatalogDefaultNamespaceRedirect.tsx",
"fileUpload": "src/components/jar-file-upload/jar-file-upload-utils.ts",
"devConsoleComponentFactory": "src/components/topology/components/devConsoleComponentFactory.ts",
"hpaTabSection": "src/components/topology/hpa-tab-section.tsx",
Expand Down
4 changes: 4 additions & 0 deletions frontend/public/components/app-contents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
usePerspectives,
} from '@console/shared/src/hooks/perspective-utils';
import { ErrorBoundaryPage } from '@console/shared/src/components/error';
import CatalogDefaultNamespaceRedirect from '@console/shared/src/components/catalog/CatalogDefaultNamespaceRedirect';
import { getReferenceForModel } from '@console/dynamic-plugin-sdk/src/utils/k8s';
import { connectToFlags } from '../reducers/connectToFlags';
import { flagPending, FlagsObject } from '../reducers/features';
Expand Down Expand Up @@ -257,6 +258,9 @@ const AppContents: React.FC<{}> = () => {
}
/>

<Route path="/catalog" element={<CatalogDefaultNamespaceRedirect />} />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we need <CatalogDefaultNamespaceRedirect> for both routes, I elected to move it to console-shared to ease reuse here.

{/* TODO: Make Software Catalog work with all namespaces. https://issues.redhat.com/browse/CONSOLE-4827 */}
<Route path="/catalog/all-namespaces" element={<CatalogDefaultNamespaceRedirect />} />
<Route
path="/catalog/instantiate-template"
element={
Expand Down