From 2d7090f9367a6588e955b1c1d0083a027ff2591b Mon Sep 17 00:00:00 2001 From: Sanket Saikia Date: Tue, 16 Dec 2025 13:04:11 +0530 Subject: [PATCH 1/2] Bulk-import redirect fix Signed-off-by: Sanket Saikia --- workspaces/bulk-import/packages/app/src/App.tsx | 3 +-- .../bulk-import/plugins/bulk-import/README.md | 13 ++++--------- .../bulk-import/plugins/bulk-import/dev/index.tsx | 2 +- .../plugins/bulk-import/src/components/Router.tsx | 5 +++-- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/workspaces/bulk-import/packages/app/src/App.tsx b/workspaces/bulk-import/packages/app/src/App.tsx index 176b2cf9e8..2eec64b1a3 100644 --- a/workspaces/bulk-import/packages/app/src/App.tsx +++ b/workspaces/bulk-import/packages/app/src/App.tsx @@ -132,8 +132,7 @@ const routes = ( } /> } /> - } /> - } /> + } /> ); diff --git a/workspaces/bulk-import/plugins/bulk-import/README.md b/workspaces/bulk-import/plugins/bulk-import/README.md index 5c1f906840..3044787d15 100644 --- a/workspaces/bulk-import/plugins/bulk-import/README.md +++ b/workspaces/bulk-import/plugins/bulk-import/README.md @@ -47,18 +47,13 @@ g, user:default/, role:default/team_a import { BulkImportPage } from '@red-hat-developer-hub/backstage-plugin-bulk-import'; ... /* highlight-add-start */ - } - /> - } - /> - /* highlight-add-end */ + } /> + /* highlight-add-end */ ... ``` + > **Note:** The plugin automatically redirects `/bulk-import` to `/bulk-import/repositories`. You only need to mount the plugin once at `/bulk-import/*`. + 3. Add **Bulk import** Sidebar Item in `packages/app/src/components/Root/Root.tsx`: ```tsx title="packages/app/src/components/Root/Root.tsx" diff --git a/workspaces/bulk-import/plugins/bulk-import/dev/index.tsx b/workspaces/bulk-import/plugins/bulk-import/dev/index.tsx index 65b58a0a0e..2cd90f5ded 100644 --- a/workspaces/bulk-import/plugins/bulk-import/dev/index.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/dev/index.tsx @@ -176,7 +176,7 @@ createDevApp() ), title: 'Bulk import', - path: '/bulk-import/repositories', + path: '/bulk-import', icon: BulkImportIcon, }) .render(); diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/Router.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/Router.tsx index 4e6fe7ce65..ee4895ffa1 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/Router.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/Router.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Route, Routes } from 'react-router-dom'; +import { Navigate, Route, Routes } from 'react-router-dom'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; @@ -32,7 +32,8 @@ const queryClient = new QueryClient(); export const Router = () => ( - } /> + } /> + } /> } From e941ee608b7f94d063be1883e7cb2a7fa26af533 Mon Sep 17 00:00:00 2001 From: Sanket Saikia Date: Tue, 16 Dec 2025 14:41:09 +0530 Subject: [PATCH 2/2] changeset Signed-off-by: Sanket Saikia --- workspaces/bulk-import/.changeset/fix-bulk-import-routing.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 workspaces/bulk-import/.changeset/fix-bulk-import-routing.md diff --git a/workspaces/bulk-import/.changeset/fix-bulk-import-routing.md b/workspaces/bulk-import/.changeset/fix-bulk-import-routing.md new file mode 100644 index 0000000000..93f3e56473 --- /dev/null +++ b/workspaces/bulk-import/.changeset/fix-bulk-import-routing.md @@ -0,0 +1,5 @@ +--- +'@red-hat-developer-hub/backstage-plugin-bulk-import': patch +--- + +Fixed routing to handle `/bulk-import` path correctly by adding internal redirect to `/bulk-import/repositories`. The plugin now automatically redirects from the base path to the repositories view, eliminating the need for host applications to configure separate redirect routes. This resolves the 404 error when accessing `/bulk-import` directly in RHDH.