From c768e53c305ffb2625c3371219ba9b5b980360c6 Mon Sep 17 00:00:00 2001 From: bnechyporenko Date: Wed, 6 Jul 2022 14:03:09 +0200 Subject: [PATCH] Incorporated the feedback. Signed-off-by: bnechyporenko --- packages/app/src/App.tsx | 6 +- packages/core-plugin-api/package.json | 1 - .../src/plugin-options/usePluginOptions.tsx | 2 +- plugins/catalog-customized/src/components.tsx | 33 ---------- plugins/catalog-customized/src/index.ts | 63 +++++++++++++++++++ plugins/catalog-customized/src/plugin.ts | 2 +- 6 files changed, 67 insertions(+), 40 deletions(-) delete mode 100644 plugins/catalog-customized/src/components.tsx diff --git a/packages/app/src/App.tsx b/packages/app/src/App.tsx index dc004ef2fd..289af8d40f 100644 --- a/packages/app/src/App.tsx +++ b/packages/app/src/App.tsx @@ -35,14 +35,12 @@ import { } from '@backstage/core-components'; import { apiDocsPlugin, ApiExplorerPage } from '@backstage/plugin-api-docs'; import { AzurePullRequestsPage } from '@backstage/plugin-azure-devops'; + import { CatalogEntityPage, CatalogIndexPage, catalogPlugin, -} from '@backstage/plugin-catalog'; - -/* Uncomment this import to enable a customized version of a catalog */ -// import '@internal/plugin-catalog-customized'; +} from '@internal/plugin-catalog-customized'; import { CatalogGraphPage } from '@backstage/plugin-catalog-graph'; import { diff --git a/packages/core-plugin-api/package.json b/packages/core-plugin-api/package.json index 148020b409..2203954f1b 100644 --- a/packages/core-plugin-api/package.json +++ b/packages/core-plugin-api/package.json @@ -37,7 +37,6 @@ "@backstage/types": "^1.0.0", "@backstage/version-bridge": "^1.0.1", "history": "^5.0.0", - "lodash": "^4.17.21", "prop-types": "^15.7.2", "react-router-dom": "6.0.0-beta.0", "zen-observable": "^0.8.15" diff --git a/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx b/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx index fc136e960d..3970c8c133 100644 --- a/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx +++ b/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx @@ -22,7 +22,7 @@ import { import { BackstagePlugin, PluginOptions } from '../plugin'; import React, { ReactNode } from 'react'; -const contextKey: string = 'plugin-options-context'; +const contextKey: string = 'plugin-context'; /** * Properties for the AsyncEntityProvider component. diff --git a/plugins/catalog-customized/src/components.tsx b/plugins/catalog-customized/src/components.tsx deleted file mode 100644 index 9c9bd2e187..0000000000 --- a/plugins/catalog-customized/src/components.tsx +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2020 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from 'react'; -import { - EntityTypePickerProps, - UserListPickerProps, -} from '@backstage/plugin-catalog-react'; - -export const EntityOwnerPicker = () => { - return
Customized entity owner picker
; -}; - -export const EntityTypePicker = (_: EntityTypePickerProps) => { - return
Customized entity type picker
; -}; - -export const UserListPicker = (_: UserListPickerProps) => { - return
Customized user lis picker
; -}; diff --git a/plugins/catalog-customized/src/index.ts b/plugins/catalog-customized/src/index.ts index 0ad4c9ff68..05678fc562 100644 --- a/plugins/catalog-customized/src/index.ts +++ b/plugins/catalog-customized/src/index.ts @@ -15,3 +15,66 @@ */ export { customizedCatalog } from './plugin'; + +export type { + AboutCardProps, + AboutContentProps, + AboutFieldProps, + BackstageOverrides, + CatalogTable, + CatalogTableProps, + CatalogTableRow, + CatalogKindHeaderProps, + CatalogSearchResultListItemProps, + DefaultCatalogPageProps, + DefaultStarredEntitiesApi, + DependencyOfComponentsCardProps, + DependsOnComponentsCardProps, + DependsOnResourcesCardProps, + EntityContextMenuClassKey, + EntityLayoutProps, + EntityLayoutRouteProps, + EntityLinksEmptyStateClassKey, + EntityListContainer, + EntityLinksCardProps, + EntityOrphanWarning, + EntityProcessingErrorsPanel, + EntitySwitch, + EntitySwitchCaseProps, + EntitySwitchProps, + hasCatalogProcessingErrors, + HasComponentsCardProps, + HasResourcesCardProps, + isKind, + isNamespace, + isComponentType, + isOrphan, + FilterContainer, + FilteredEntityLayout, + HasSubcomponentsCardProps, + HasSystemsCardProps, + PluginCatalogComponentsNameToClassKey, + RelatedEntitiesCardProps, + SystemDiagramCardClassKey, +} from '@backstage/plugin-catalog'; + +export { + AboutContent, + AboutField, + catalogPlugin, + CatalogEntityPage, + CatalogIndexPage, + CatalogKindHeader, + CatalogSearchResultListItem, + EntityAboutCard, + EntityDependencyOfComponentsCard, + EntityDependsOnComponentsCard, + EntityDependsOnResourcesCard, + EntityHasComponentsCard, + EntityHasResourcesCard, + EntityHasSubcomponentsCard, + EntityHasSystemsCard, + EntityLayout, + EntityLinksCard, + RelatedEntitiesCard, +} from '@backstage/plugin-catalog'; diff --git a/plugins/catalog-customized/src/plugin.ts b/plugins/catalog-customized/src/plugin.ts index e3830ee31c..82d89251a0 100644 --- a/plugins/catalog-customized/src/plugin.ts +++ b/plugins/catalog-customized/src/plugin.ts @@ -17,7 +17,7 @@ import { catalogPlugin } from '@backstage/plugin-catalog'; catalogPlugin.__experimentalReconfigure({ - createButtonTitle: 'Maybe Create', + createButtonTitle: 'New', }); export const customizedCatalog = catalogPlugin;