refactor: simplify home redirect (#5007)
Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
parent
46e1cefbac
commit
e46f2a55c2
|
|
@ -3,6 +3,9 @@ app:
|
|||
baseUrl: http://localhost:3000
|
||||
extensions:
|
||||
- 'nav-item:catalog': false
|
||||
- 'page:explore':
|
||||
config:
|
||||
path: '/'
|
||||
backend:
|
||||
baseUrl: http://localhost:7007
|
||||
listen:
|
||||
|
|
|
|||
|
|
@ -15,15 +15,12 @@
|
|||
*/
|
||||
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import { Navigate } from 'react-router';
|
||||
|
||||
import { createApp } from '@backstage/frontend-defaults';
|
||||
|
||||
import {
|
||||
ApiBlueprint,
|
||||
PageBlueprint,
|
||||
createFrontendModule,
|
||||
createFrontendPlugin,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
|
||||
import catalogPlugin from '@backstage/plugin-catalog/alpha';
|
||||
|
|
@ -33,18 +30,6 @@ import explorePlugin from '../src/alpha';
|
|||
|
||||
import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils';
|
||||
|
||||
const homePlugin = createFrontendPlugin({
|
||||
pluginId: 'home',
|
||||
extensions: [
|
||||
PageBlueprint.make({
|
||||
params: {
|
||||
path: '/',
|
||||
loader: async () => <Navigate to="/explore" />,
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
const components = [
|
||||
{
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
|
|
@ -100,7 +85,7 @@ const catalogPluginOverrides = createFrontendModule({
|
|||
});
|
||||
|
||||
const app = createApp({
|
||||
features: [homePlugin, explorePlugin, catalogPlugin, catalogPluginOverrides],
|
||||
features: [explorePlugin, catalogPlugin, catalogPluginOverrides],
|
||||
});
|
||||
|
||||
const root = app.createRoot();
|
||||
|
|
|
|||
Loading…
Reference in New Issue