From 396e175fce2bd192f8f051a8d0f254ca253b5c1c Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 11 Mar 2025 01:07:39 +0100 Subject: [PATCH] catalog-react: rename card types peek -> summary, full -> content Signed-off-by: Patrik Oldsberg --- plugins/api-docs/report-alpha.api.md | 24 +++++----- plugins/catalog-graph/report-alpha.api.md | 4 +- plugins/catalog-react/CHANGELOG.md | 10 ++-- plugins/catalog-react/report-alpha.api.md | 6 +-- .../blueprints/EntityCardBlueprint.test.tsx | 4 +- .../src/alpha/blueprints/extensionData.tsx | 6 +-- plugins/catalog/report-alpha.api.md | 40 ++++++++-------- .../src/alpha/DefaultEntityContentLayout.tsx | 46 ++++++++++--------- plugins/org/report-alpha.api.md | 16 +++---- 9 files changed, 79 insertions(+), 77 deletions(-) diff --git a/plugins/api-docs/report-alpha.api.md b/plugins/api-docs/report-alpha.api.md index 0108d94e49..25fda584e1 100644 --- a/plugins/api-docs/report-alpha.api.md +++ b/plugins/api-docs/report-alpha.api.md @@ -48,11 +48,11 @@ const _default: FrontendPlugin< name: 'consumed-apis'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef< @@ -93,11 +93,11 @@ const _default: FrontendPlugin< name: 'consuming-components'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef< @@ -138,11 +138,11 @@ const _default: FrontendPlugin< name: 'definition'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef< @@ -183,11 +183,11 @@ const _default: FrontendPlugin< name: 'has-apis'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef< @@ -228,11 +228,11 @@ const _default: FrontendPlugin< name: 'provided-apis'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef< @@ -273,11 +273,11 @@ const _default: FrontendPlugin< name: 'providing-components'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef< diff --git a/plugins/catalog-graph/report-alpha.api.md b/plugins/catalog-graph/report-alpha.api.md index 4cc884e7d7..0687efce05 100644 --- a/plugins/catalog-graph/report-alpha.api.md +++ b/plugins/catalog-graph/report-alpha.api.md @@ -45,7 +45,7 @@ const _default: FrontendPlugin< height: number | undefined; } & { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { height?: number | undefined; @@ -61,7 +61,7 @@ const _default: FrontendPlugin< relationPairs?: [string, string][] | undefined; } & { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef< diff --git a/plugins/catalog-react/CHANGELOG.md b/plugins/catalog-react/CHANGELOG.md index b925168e39..9f13f56288 100644 --- a/plugins/catalog-react/CHANGELOG.md +++ b/plugins/catalog-react/CHANGELOG.md @@ -78,7 +78,7 @@ The layout components receive card elements and can render them as they see fit. Cards is an array of objects with the following properties: - element: `JSx.Element`; - - type: `"peek" | "info" | "full" | undefined`; + - type: `"summary" | "info" | "content" | undefined`; ### Usage example @@ -115,14 +115,14 @@ {cards - .filter(card => card.type === 'peek') + .filter(card => card.type === 'summary') .map((card, index) => ( {card.element} ))} {cards - .filter(card => !card.type || card.type === 'full') + .filter(card => !card.type || card.type === 'content') .map((card, index) => ( {card.element} @@ -176,9 +176,9 @@ Initially the following three types are supported: - - `peek`: small vertical cards that provide information at a glance, for example recent builds, deployments, and service health. + - `summary`: small vertical cards that provide information at a glance, for example recent builds, deployments, and service health. - `info`: medium size cards with high priority and frequently used information such as common actions, entity metadata, and links. - - `full`: Large cards that are more feature rich with more information, typically used by plugins that don't quite need the full content view and want to show a card instead. + - `content`: Large cards that are more feature rich with more information, typically used by plugins that don't quite need the content content view and want to show a card instead. ### Usage examples diff --git a/plugins/catalog-react/report-alpha.api.md b/plugins/catalog-react/report-alpha.api.md index c191e55f2a..4a154356d1 100644 --- a/plugins/catalog-react/report-alpha.api.md +++ b/plugins/catalog-react/report-alpha.api.md @@ -137,11 +137,11 @@ export const EntityCardBlueprint: ExtensionBlueprint<{ inputs: {}; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; dataRefs: { filterFunction: ConfigurableExtensionDataRef< @@ -163,7 +163,7 @@ export const EntityCardBlueprint: ExtensionBlueprint<{ }>; // @alpha (undocumented) -export type EntityCardType = 'peek' | 'info' | 'full'; +export type EntityCardType = 'summary' | 'info' | 'content'; // @alpha export const EntityContentBlueprint: ExtensionBlueprint<{ diff --git a/plugins/catalog-react/src/alpha/blueprints/EntityCardBlueprint.test.tsx b/plugins/catalog-react/src/alpha/blueprints/EntityCardBlueprint.test.tsx index f4e518799e..70c2b9d849 100644 --- a/plugins/catalog-react/src/alpha/blueprints/EntityCardBlueprint.test.tsx +++ b/plugins/catalog-react/src/alpha/blueprints/EntityCardBlueprint.test.tsx @@ -175,9 +175,9 @@ describe('EntityCardBlueprint', () => { }, "type": { "enum": [ - "peek", + "summary", "info", - "full", + "content", ], "type": "string", }, diff --git a/plugins/catalog-react/src/alpha/blueprints/extensionData.tsx b/plugins/catalog-react/src/alpha/blueprints/extensionData.tsx index bae7d4e668..c085912123 100644 --- a/plugins/catalog-react/src/alpha/blueprints/extensionData.tsx +++ b/plugins/catalog-react/src/alpha/blueprints/extensionData.tsx @@ -54,13 +54,13 @@ export const entityContentGroupDataRef = createExtensionDataRef().with({ * Available entity card types */ export const entityCardTypes = [ - 'peek', + 'summary', 'info', - 'full', + 'content', ] as const satisfies readonly EntityCardType[]; /** @alpha */ -export type EntityCardType = 'peek' | 'info' | 'full'; +export type EntityCardType = 'summary' | 'info' | 'content'; /** @internal */ export const entityCardTypeDataRef = diff --git a/plugins/catalog/report-alpha.api.md b/plugins/catalog/report-alpha.api.md index ca6d01b0ac..77d8dbec50 100644 --- a/plugins/catalog/report-alpha.api.md +++ b/plugins/catalog/report-alpha.api.md @@ -354,11 +354,11 @@ const _default: FrontendPlugin< name: 'about'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef @@ -395,11 +395,11 @@ const _default: FrontendPlugin< name: 'depends-on-components'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef @@ -436,11 +436,11 @@ const _default: FrontendPlugin< name: 'depends-on-resources'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef @@ -477,11 +477,11 @@ const _default: FrontendPlugin< name: 'has-components'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef @@ -518,11 +518,11 @@ const _default: FrontendPlugin< name: 'has-resources'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef @@ -559,11 +559,11 @@ const _default: FrontendPlugin< name: 'has-subcomponents'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef @@ -600,11 +600,11 @@ const _default: FrontendPlugin< name: 'has-subdomains'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef @@ -641,11 +641,11 @@ const _default: FrontendPlugin< name: 'has-systems'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef @@ -682,11 +682,11 @@ const _default: FrontendPlugin< name: 'labels'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef @@ -723,11 +723,11 @@ const _default: FrontendPlugin< name: 'links'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef diff --git a/plugins/catalog/src/alpha/DefaultEntityContentLayout.tsx b/plugins/catalog/src/alpha/DefaultEntityContentLayout.tsx index 7a73f991bc..c5cbe452f2 100644 --- a/plugins/catalog/src/alpha/DefaultEntityContentLayout.tsx +++ b/plugins/catalog/src/alpha/DefaultEntityContentLayout.tsx @@ -35,14 +35,14 @@ import { HorizontalScrollGrid } from '@backstage/core-components'; const useStyles = makeStyles< Theme, - { infoCards: boolean; peekCards: boolean; fullCards: boolean } + { infoCards: boolean; summaryCards: boolean; contentCards: boolean } >(theme => ({ root: { display: 'flex', flexFlow: 'column nowrap', gap: theme.spacing(3), }, - fullArea: { + contentArea: { display: 'flex', flexFlow: 'column', gap: theme.spacing(3), @@ -56,10 +56,10 @@ const useStyles = makeStyles< gap: theme.spacing(3), minWidth: 0, }, - peekArea: { + summaryArea: { margin: theme.spacing(1.5), // To counteract MUI negative grid margin }, - peekCard: { + summaryCard: { flex: '0 0 auto', '& + &': { marginLeft: theme.spacing(3), @@ -69,9 +69,9 @@ const useStyles = makeStyles< root: { display: 'grid', gap: 0, - gridTemplateAreas: ({ peekCards }) => ` - "${peekCards ? 'peek' : 'full'} info" - "full info" + gridTemplateAreas: ({ summaryCards }) => ` + "${summaryCards ? 'summary' : 'content'} info" + "content info" `, gridTemplateColumns: ({ infoCards }) => (infoCards ? '2fr 1fr' : '1fr'), alignItems: 'start', @@ -82,11 +82,11 @@ const useStyles = makeStyles< top: theme.spacing(3), marginLeft: theme.spacing(3), }, - fullArea: { - gridArea: 'full', + contentArea: { + gridArea: 'content', }, - peekArea: { - gridArea: 'peek', + summaryArea: { + gridArea: 'summary', marginBottom: theme.spacing(3), }, }, @@ -124,13 +124,15 @@ export function DefaultEntityContentLayout(props: EntityContentLayoutProps) { const { cards } = props; const infoCards = cards.filter(card => card.type === 'info'); - const peekCards = cards.filter(card => card.type === 'peek'); - const fullCards = cards.filter(card => !card.type || card.type === 'full'); + const summaryCards = cards.filter(card => card.type === 'summary'); + const contentCards = cards.filter( + card => !card.type || card.type === 'content', + ); const classes = useStyles({ infoCards: !!infoCards.length, - peekCards: !!peekCards.length, - fullCards: !!fullCards.length, + summaryCards: !!summaryCards.length, + contentCards: !!contentCards.length, }); return ( @@ -142,18 +144,18 @@ export function DefaultEntityContentLayout(props: EntityContentLayoutProps) { {infoCards.map(card => card.element)} ) : null} - {peekCards.length > 0 ? ( -
+ {summaryCards.length > 0 ? ( +
- {peekCards.map(card => ( -
{card.element}
+ {summaryCards.map(card => ( +
{card.element}
))}
) : null} - {fullCards.length > 0 ? ( -
- {fullCards.map(card => card.element)} + {contentCards.length > 0 ? ( +
+ {contentCards.map(card => card.element)}
) : null}
diff --git a/plugins/org/report-alpha.api.md b/plugins/org/report-alpha.api.md index f85e7090dd..f6a79a968a 100644 --- a/plugins/org/report-alpha.api.md +++ b/plugins/org/report-alpha.api.md @@ -24,11 +24,11 @@ const _default: FrontendPlugin< name: 'group-profile'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef< @@ -69,11 +69,11 @@ const _default: FrontendPlugin< name: 'members-list'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef< @@ -114,11 +114,11 @@ const _default: FrontendPlugin< name: 'ownership'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef< @@ -159,11 +159,11 @@ const _default: FrontendPlugin< name: 'user-profile'; config: { filter: EntityPredicate | undefined; - type: 'full' | 'info' | 'peek' | undefined; + type: 'content' | 'summary' | 'info' | undefined; }; configInput: { filter?: EntityPredicate | undefined; - type?: 'full' | 'info' | 'peek' | undefined; + type?: 'content' | 'summary' | 'info' | undefined; }; output: | ConfigurableExtensionDataRef<