Merge pull request #8782 from akz08/reroute-register-api
Reroute register api
This commit is contained in:
@@ -42,7 +42,7 @@ import {
|
||||
UserListPicker,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import React from 'react';
|
||||
import { createComponentRouteRef } from '../../routes';
|
||||
import { registerComponentRouteRef } from '../../routes';
|
||||
|
||||
const defaultColumns: TableColumn<CatalogTableRow>[] = [
|
||||
CatalogTable.columns.createNameColumn({ defaultKind: 'API' }),
|
||||
@@ -77,7 +77,7 @@ export const DefaultApiExplorerPage = ({
|
||||
const generatedSubtitle = `${
|
||||
configApi.getOptionalString('organization.name') ?? 'Backstage'
|
||||
} API Explorer`;
|
||||
const createComponentLink = useRouteRef(createComponentRouteRef);
|
||||
const registerComponentLink = useRouteRef(registerComponentRouteRef);
|
||||
|
||||
return (
|
||||
<PageWithHeader
|
||||
@@ -90,7 +90,7 @@ export const DefaultApiExplorerPage = ({
|
||||
<ContentHeader title="">
|
||||
<CreateButton
|
||||
title="Register Existing API"
|
||||
to={createComponentLink?.()}
|
||||
to={registerComponentLink?.()}
|
||||
/>
|
||||
<SupportButton>All your APIs</SupportButton>
|
||||
</ContentHeader>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import { ApiEntity } from '@backstage/catalog-model';
|
||||
import { defaultDefinitionWidgets } from './components/ApiDefinitionCard';
|
||||
import { apiDocsConfigRef } from './config';
|
||||
import { createComponentRouteRef, rootRoute } from './routes';
|
||||
import { registerComponentRouteRef, rootRoute } from './routes';
|
||||
import {
|
||||
createApiFactory,
|
||||
createComponentExtension,
|
||||
@@ -45,7 +45,7 @@ export const apiDocsPlugin = createPlugin({
|
||||
}),
|
||||
],
|
||||
externalRoutes: {
|
||||
createComponent: createComponentRouteRef,
|
||||
registerApi: registerComponentRouteRef,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export const rootRoute = createRouteRef({
|
||||
id: 'api-docs',
|
||||
});
|
||||
|
||||
export const createComponentRouteRef = createExternalRouteRef({
|
||||
id: 'create-component',
|
||||
export const registerComponentRouteRef = createExternalRouteRef({
|
||||
id: 'register-component',
|
||||
optional: true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user