plugins: remove unnecessary use of convertLegacyRouteRef(s)
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -14,7 +14,8 @@ import { ExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { JSX as JSX_2 } from 'react';
|
||||
import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { OverridableFrontendPlugin } from '@backstage/frontend-plugin-api';
|
||||
import { RouteRef } from '@backstage/frontend-plugin-api';
|
||||
import { RouteRef } from '@backstage/core-plugin-api';
|
||||
import { RouteRef as RouteRef_2 } from '@backstage/frontend-plugin-api';
|
||||
import { TranslationRef } from '@backstage/core-plugin-api/alpha';
|
||||
|
||||
// @public (undocumented)
|
||||
@@ -103,7 +104,7 @@ const _default: OverridableFrontendPlugin<
|
||||
| ExtensionDataRef<string, 'core.routing.path', {}>
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
| ExtensionDataRef<
|
||||
RouteRef<AnyRouteRefParams>,
|
||||
RouteRef_2<AnyRouteRefParams>,
|
||||
'core.routing.ref',
|
||||
{
|
||||
optional: true;
|
||||
@@ -140,7 +141,7 @@ const _default: OverridableFrontendPlugin<
|
||||
defaultGroup?: [Error: `Use the 'group' param instead`];
|
||||
group?: keyof defaultEntityContentGroups | (string & {});
|
||||
loader: () => Promise<JSX.Element>;
|
||||
routeRef?: RouteRef;
|
||||
routeRef?: RouteRef_2;
|
||||
filter?: string | EntityPredicate | ((entity: Entity) => boolean);
|
||||
};
|
||||
}>;
|
||||
@@ -157,7 +158,7 @@ const _default: OverridableFrontendPlugin<
|
||||
| ExtensionDataRef<string, 'core.routing.path', {}>
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
| ExtensionDataRef<
|
||||
RouteRef<AnyRouteRefParams>,
|
||||
RouteRef_2<AnyRouteRefParams>,
|
||||
'core.routing.ref',
|
||||
{
|
||||
optional: true;
|
||||
@@ -168,7 +169,7 @@ const _default: OverridableFrontendPlugin<
|
||||
defaultPath?: [Error: `Use the 'path' param instead`];
|
||||
path: string;
|
||||
loader: () => Promise<JSX.Element>;
|
||||
routeRef?: RouteRef;
|
||||
routeRef?: RouteRef_2;
|
||||
};
|
||||
}>;
|
||||
}
|
||||
|
||||
@@ -15,16 +15,12 @@
|
||||
*/
|
||||
|
||||
import { PageBlueprint } from '@backstage/frontend-plugin-api';
|
||||
import { convertLegacyRouteRef } from '@backstage/core-compat-api';
|
||||
import { rootCatalogKubernetesRouteRef } from '../plugin';
|
||||
|
||||
export const kubernetesPage = PageBlueprint.make({
|
||||
params: {
|
||||
path: '/kubernetes',
|
||||
// you can reuse the existing routeRef
|
||||
// by wrapping into the convertLegacyRouteRef.
|
||||
routeRef: convertLegacyRouteRef(rootCatalogKubernetesRouteRef),
|
||||
// these inputs usually match the props required by the component.
|
||||
routeRef: rootCatalogKubernetesRouteRef,
|
||||
loader: () => import('../Router').then(m => <m.Router />),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { convertLegacyRouteRefs } from '@backstage/core-compat-api';
|
||||
import { createFrontendPlugin } from '@backstage/frontend-plugin-api';
|
||||
import { kubernetesPage } from './pages';
|
||||
import { entityKubernetesContent } from './entityContents';
|
||||
@@ -37,5 +36,5 @@ export default createFrontendPlugin({
|
||||
kubernetesAuthProvidersApi,
|
||||
kubernetesClusterLinkFormatterApi,
|
||||
],
|
||||
routes: convertLegacyRouteRefs({ kubernetes: rootCatalogKubernetesRouteRef }),
|
||||
routes: { kubernetes: rootCatalogKubernetesRouteRef },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user