From 491e0705c23b70628f79c5545c4944dac0d34a84 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Wed, 31 Jan 2024 15:38:45 +0100 Subject: [PATCH] Add catalog cards Signed-off-by: Philipp Hugenroth --- packages/app-next/app-config.yaml | 9 +++++++ packages/app-next/src/App.tsx | 2 ++ plugins/org/src/alpha.tsx | 40 ++++++++++++++++++++++++------- 3 files changed, 42 insertions(+), 9 deletions(-) diff --git a/packages/app-next/app-config.yaml b/packages/app-next/app-config.yaml index a79bb866db..0b842a0b91 100644 --- a/packages/app-next/app-config.yaml +++ b/packages/app-next/app-config.yaml @@ -5,6 +5,7 @@ app: bindings: catalog.viewTechDoc: techdocs.docRoot catalog.createComponent: catalog-import.importPage + # org.catalogIndex: catalog.catalogIndex extensions: # - apis.plugin.graphiql.browse.gitlab: true @@ -19,6 +20,14 @@ app: # Entity page content - entity-content:techdocs + # Org Plugin + - entity-card:org/group-profile: + config: + filter: kind:group + # - entity-card:org/members-list + # - entity-card:org/ownership + # - entity-card:org/user-profile + # scmAuthExtension: >- # createScmAuthExtension({ # id: 'apis.scmAuth.addons.ghe', diff --git a/packages/app-next/src/App.tsx b/packages/app-next/src/App.tsx index 03a6649c27..bb39d8d40e 100644 --- a/packages/app-next/src/App.tsx +++ b/packages/app-next/src/App.tsx @@ -24,6 +24,7 @@ import userSettingsPlugin from '@backstage/plugin-user-settings/alpha'; import homePlugin, { titleExtensionDataRef, } from '@backstage/plugin-home/alpha'; +import orgPlugin from '@backstage/plugin-org/alpha'; import { coreExtensionData, @@ -125,6 +126,7 @@ const app = createApp({ userSettingsPlugin, homePlugin, appVisualizerPlugin, + orgPlugin, ...collectedLegacyPlugins, createExtensionOverrides({ extensions: [ diff --git a/plugins/org/src/alpha.tsx b/plugins/org/src/alpha.tsx index 30cda2a4c7..3d02aec88b 100644 --- a/plugins/org/src/alpha.tsx +++ b/plugins/org/src/alpha.tsx @@ -33,19 +33,41 @@ export const EntityGroupProfileCard = createEntityCardExtension({ }); /** @alpha */ -/* export const EntityMembersListCard = createEntityCardExtension({ - name: 'members-list', - loader: async () => - import('./components/').then(m => - compatWrapper(), - ), - }); - */ +export const EntityMembersListCard = createEntityCardExtension({ + name: 'members-list', + loader: async () => + import('./components/Cards/Group/MembersList/MembersListCard').then(m => + compatWrapper(), + ), +}); + +/** @alpha */ +export const EntityOwnershipCard = createEntityCardExtension({ + name: 'ownership', + loader: async () => + import('./components/Cards/OwnershipCard/OwnershipCard').then(m => + compatWrapper(), + ), +}); + +/** @alpha */ +export const EntityUserProfileCard = createEntityCardExtension({ + name: 'user-profile', + loader: async () => + import('./components/Cards/User/UserProfileCard/UserProfileCard').then(m => + compatWrapper(), + ), +}); /** @alpha */ export default createPlugin({ id: 'org', - extensions: [EntityGroupProfileCard], + extensions: [ + EntityGroupProfileCard, + EntityMembersListCard, + EntityOwnershipCard, + EntityUserProfileCard, + ], externalRoutes: convertLegacyRouteRefs({ catalogIndex: catalogIndexRouteRef, }),