From e1916a7e857625b058c207fcede13c0d37dd8b55 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Wed, 14 Jul 2021 13:43:08 +0200 Subject: [PATCH] Apply changes to ApiExplorerPage Signed-off-by: Philipp Hugenroth --- .../ApiExplorerPage/ApiExplorerPage.tsx | 94 +++++++++++++++++-- plugins/catalog/src/index.ts | 1 + 2 files changed, 89 insertions(+), 6 deletions(-) diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx index 32fab2c1ec..bf62d06b44 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx @@ -14,10 +14,45 @@ * limitations under the License. */ -import { TableColumn } from '@backstage/core-components'; -import { CatalogTableRow } from '@backstage/plugin-catalog'; -import { UserListFilterKind } from '@backstage/plugin-catalog-react'; +import { + Content, + ContentHeader, + PageWithHeader, + SupportButton, + TableColumn, +} from '@backstage/core-components'; +import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; +import { + CatalogTable, + CatalogTableRow, + FilteredTableLayout, + TableContainer, + FilterContainer, +} from '@backstage/plugin-catalog'; +import { + EntityKindPicker, + EntityLifecyclePicker, + EntityListProvider, + EntityOwnerPicker, + EntityTagPicker, + EntityTypePicker, + UserListFilterKind, + UserListPicker, +} from '@backstage/plugin-catalog-react'; +import { Button } from '@material-ui/core'; import React from 'react'; +import { Link as RouterLink } from 'react-router-dom'; +import { createComponentRouteRef } from '../../routes'; + +const defaultColumns: TableColumn[] = [ + CatalogTable.columns.createNameColumn({ defaultKind: 'API' }), + CatalogTable.columns.createSystemColumn(), + CatalogTable.columns.createOwnerColumn(), + CatalogTable.columns.createSpecTypeColumn(), + CatalogTable.columns.createSpecLifecycleColumn(), + CatalogTable.columns.createMetadataDescriptionColumn(), + CatalogTable.columns.createTagsColumn(), +]; interface IApiExplorerePageFilterProps { initiallySelectedFilter?: UserListFilterKind; @@ -27,6 +62,53 @@ export type ApiExplorerPageProps = IApiExplorerePageFilterProps & { columns?: TableColumn[]; }; -export const ApiExplorerPage = ({}: ApiExplorerPageProps) => ( -
Please revert me...
-); +export const ApiExplorerPage = ({ + initiallySelectedFilter = 'all', + columns, +}: ApiExplorerPageProps) => { + const createComponentLink = useRouteRef(createComponentRouteRef); + const configApi = useApi(configApiRef); + const generatedSubtitle = `${ + configApi.getOptionalString('organization.name') ?? 'Backstage' + } API Explorer`; + + return ( + + + + {createComponentLink && ( + + )} + All your APIs + + + + + + + + + + + + + ); +}; diff --git a/plugins/catalog/src/index.ts b/plugins/catalog/src/index.ts index 7c8d7ac122..8585177cd9 100644 --- a/plugins/catalog/src/index.ts +++ b/plugins/catalog/src/index.ts @@ -41,3 +41,4 @@ export { } from './plugin'; export * from './components/CatalogTable/columns'; export * from './components/CatalogFilter'; +export * from './components/FilteredTableLayout';