Skip to content
Open
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
11 changes: 9 additions & 2 deletions frontend/packages/dev-console/console-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,6 @@
"path": [
"/add",
"/import-sample",
"/catalog",
"/samples",
"/topology",
"/deploy-image",
Expand Down Expand Up @@ -1063,7 +1062,15 @@
"type": "console.page/route",
"properties": {
"exact": true,
"path": ["/catalog/all-namespaces", "/catalog/ns/:ns"],
"path": ["/catalog/all-namespaces"],
"component": { "$codeRef": "CatalogDefaultNamespaceRedirect" }
}
},
{
"type": "console.page/route",
"properties": {
"exact": true,
"path": ["/catalog/ns/:ns"],
"component": { "$codeRef": "CatalogPage" }
}
},
Expand Down
1 change: 1 addition & 0 deletions frontend/packages/dev-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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
const CatalogDefaultNamespaceRedirect: React.FCC = () => {
const [params] = useSearchParams();
return <Navigate to={`/catalog/ns/default?${params.toString()}`} replace />;
};

export default CatalogDefaultNamespaceRedirect;