fix api reports + create StaticExploreToolProvider
Signed-off-by: Andrew Thauer <athauer@wealthsimple.com>
This commit is contained in:
@@ -5,10 +5,18 @@
|
||||
```ts
|
||||
/// <reference types="react" />
|
||||
|
||||
import { ApiRef } from '@backstage/core-plugin-api';
|
||||
import { BackstagePlugin } from '@backstage/core-plugin-api';
|
||||
import { default as default_2 } from 'react';
|
||||
import { DiscoveryApi } from '@backstage/core-plugin-api';
|
||||
import { DomainEntity } from '@backstage/catalog-model';
|
||||
import { ExternalRouteRef } from '@backstage/core-plugin-api';
|
||||
import { FetchApi } from '@backstage/core-plugin-api';
|
||||
import { GetExploreToolsRequest } from '@backstage/plugin-explore-common';
|
||||
import { GetExploreToolsResponse } from '@backstage/plugin-explore-common';
|
||||
import { IndexableDocument } from '@backstage/plugin-search-common';
|
||||
import { ReactNode } from 'react';
|
||||
import { ResultHighlight } from '@backstage/plugin-search-common';
|
||||
import { RouteRef } from '@backstage/core-plugin-api';
|
||||
import { TabProps } from '@material-ui/core';
|
||||
|
||||
@@ -30,6 +38,27 @@ export const DomainExplorerContent: (props: {
|
||||
title?: string | undefined;
|
||||
}) => JSX.Element;
|
||||
|
||||
// @public
|
||||
export interface ExploreApi {
|
||||
getTools(request?: GetExploreToolsRequest): Promise<GetExploreToolsResponse>;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export const exploreApiRef: ApiRef<ExploreApi>;
|
||||
|
||||
// @public
|
||||
export class ExploreClient implements ExploreApi {
|
||||
constructor({
|
||||
discoveryApi,
|
||||
fetchApi,
|
||||
}: {
|
||||
discoveryApi: DiscoveryApi;
|
||||
fetchApi: FetchApi;
|
||||
});
|
||||
// (undocumented)
|
||||
getTools(request?: GetExploreToolsRequest): Promise<GetExploreToolsResponse>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export const ExploreLayout: {
|
||||
(props: ExploreLayoutProps): JSX.Element;
|
||||
@@ -91,4 +120,21 @@ export type SubRoute = {
|
||||
export const ToolExplorerContent: (props: {
|
||||
title?: string | undefined;
|
||||
}) => JSX.Element;
|
||||
|
||||
// @public (undocumented)
|
||||
export function ToolSearchResultListItem(
|
||||
props: ToolSearchResultListItemProps,
|
||||
): JSX.Element;
|
||||
|
||||
// @public
|
||||
export interface ToolSearchResultListItemProps {
|
||||
// (undocumented)
|
||||
highlight?: ResultHighlight;
|
||||
// (undocumented)
|
||||
icon?: ReactNode;
|
||||
// (undocumented)
|
||||
rank?: number;
|
||||
// (undocumented)
|
||||
result: IndexableDocument;
|
||||
}
|
||||
```
|
||||
|
||||
@@ -34,6 +34,9 @@ export interface ExploreApi {
|
||||
getTools(request?: GetExploreToolsRequest): Promise<GetExploreToolsResponse>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const exploreApiRef = createApiRef<ExploreApi>({
|
||||
id: 'plugin.explore.service',
|
||||
});
|
||||
|
||||
@@ -28,15 +28,20 @@ import {
|
||||
WarningPanel,
|
||||
} from '@backstage/core-components';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
// import { exploreApiRef } from '../../api';
|
||||
|
||||
const Body = () => {
|
||||
const exploreToolsConfigApi = useApi(exploreToolsConfigRef);
|
||||
// const exploreApi = useApi(exploreApiRef);
|
||||
|
||||
const {
|
||||
value: tools,
|
||||
loading,
|
||||
error,
|
||||
} = useAsync(async () => {
|
||||
return await exploreToolsConfigApi.getTools();
|
||||
// TODO: Enable the backend ExploreClient
|
||||
// return (await exploreApi.getTools())?.tools;
|
||||
}, [exploreToolsConfigApi]);
|
||||
|
||||
if (loading) {
|
||||
|
||||
Reference in New Issue
Block a user