catalog: remove summary entity card type
Removes the 'summary' type from EntityCardType while keeping runtime support for backward compatibility. Signed-off-by: Patrik Oldsberg <patrik.oldsberg@gmail.com> Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-react': minor
|
||||
---
|
||||
|
||||
**BREAKING**: Removed the 'summary' entity card type from `EntityCardType`. Users should migrate to using 'content' or 'info' card types instead.
|
||||
|
||||
TypeScript will now show errors if you try to use `type: 'summary'` when creating entity cards.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog': patch
|
||||
---
|
||||
|
||||
The default entity content layout still supports rendering summary cards at runtime for backward compatibility, but logs a console warning when they are detected to help identify where migration is needed.
|
||||
@@ -86,11 +86,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'consumed-apis';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -127,11 +127,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'consuming-components';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -168,11 +168,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'definition';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -209,11 +209,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'has-apis';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -250,11 +250,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'provided-apis';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -291,11 +291,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'providing-components';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
|
||||
@@ -92,7 +92,7 @@ const _default: OverridableFrontendPlugin<
|
||||
title: string | undefined;
|
||||
height: number | undefined;
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
height?: number | undefined;
|
||||
@@ -107,7 +107,7 @@ const _default: OverridableFrontendPlugin<
|
||||
relationPairs?: [string, string][] | undefined;
|
||||
unidirectional?: boolean | undefined;
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
|
||||
@@ -192,11 +192,11 @@ export const EntityCardBlueprint: ExtensionBlueprint<{
|
||||
inputs: {};
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
dataRefs: {
|
||||
filterFunction: ConfigurableExtensionDataRef<
|
||||
@@ -218,7 +218,7 @@ export const EntityCardBlueprint: ExtensionBlueprint<{
|
||||
}>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type EntityCardType = 'summary' | 'info' | 'content';
|
||||
export type EntityCardType = 'info' | 'content';
|
||||
|
||||
// @alpha
|
||||
export const EntityContentBlueprint: ExtensionBlueprint<{
|
||||
|
||||
@@ -177,7 +177,6 @@ describe('EntityCardBlueprint', () => {
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"summary",
|
||||
"info",
|
||||
"content",
|
||||
],
|
||||
|
||||
@@ -56,13 +56,12 @@ export const entityContentGroupDataRef = createExtensionDataRef<string>().with({
|
||||
* Available entity card types
|
||||
*/
|
||||
export const entityCardTypes = [
|
||||
'summary',
|
||||
'info',
|
||||
'content',
|
||||
] as const satisfies readonly EntityCardType[];
|
||||
|
||||
/** @alpha */
|
||||
export type EntityCardType = 'summary' | 'info' | 'content';
|
||||
export type EntityCardType = 'info' | 'content';
|
||||
|
||||
/** @internal */
|
||||
export const entityCardTypeDataRef =
|
||||
|
||||
@@ -293,11 +293,11 @@ const _default: OverridableFrontendPlugin<
|
||||
'entity-card:catalog/about': OverridableExtensionDefinition<{
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -363,11 +363,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'depends-on-components';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -404,11 +404,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'depends-on-resources';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -445,11 +445,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'has-components';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -486,11 +486,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'has-resources';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -527,11 +527,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'has-subcomponents';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -568,11 +568,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'has-subdomains';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -609,11 +609,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'has-systems';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -650,11 +650,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'labels';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -691,11 +691,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'links';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
|
||||
@@ -137,11 +137,20 @@ export function DefaultEntityContentLayout(props: EntityContentLayoutProps) {
|
||||
const { cards } = props;
|
||||
|
||||
const infoCards = cards.filter(card => card.type === 'info');
|
||||
const summaryCards = cards.filter(card => card.type === 'summary');
|
||||
// Keep support for 'summary' type at runtime for backward compatibility
|
||||
// even though it's been removed from the type system
|
||||
const summaryCards = cards.filter(card => card.type === ('summary' as any));
|
||||
const contentCards = cards.filter(
|
||||
card => !card.type || card.type === 'content',
|
||||
);
|
||||
|
||||
if (summaryCards.length > 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
"The 'summary' entity card type has been removed. Please update your cards to use 'content' or 'info' types instead.",
|
||||
);
|
||||
}
|
||||
|
||||
const classes = useStyles({
|
||||
infoCards: !!infoCards.length,
|
||||
summaryCards: !!summaryCards.length,
|
||||
|
||||
@@ -25,11 +25,11 @@ const _default: OverridableFrontendPlugin<
|
||||
name: 'group-profile';
|
||||
config: {
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -66,13 +66,13 @@ const _default: OverridableFrontendPlugin<
|
||||
initialRelationAggregation: 'direct' | 'aggregated' | undefined;
|
||||
showAggregateMembersToggle: boolean | undefined;
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
showAggregateMembersToggle?: boolean | undefined;
|
||||
initialRelationAggregation?: 'direct' | 'aggregated' | undefined;
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -112,14 +112,14 @@ const _default: OverridableFrontendPlugin<
|
||||
showAggregateMembersToggle: boolean | undefined;
|
||||
ownedKinds: string[] | undefined;
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
showAggregateMembersToggle?: boolean | undefined;
|
||||
initialRelationAggregation?: 'direct' | 'aggregated' | undefined;
|
||||
ownedKinds?: string[] | undefined;
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
@@ -158,13 +158,13 @@ const _default: OverridableFrontendPlugin<
|
||||
maxRelations: number | undefined;
|
||||
hideIcons: boolean;
|
||||
filter: EntityPredicate | undefined;
|
||||
type: 'content' | 'summary' | 'info' | undefined;
|
||||
type: 'content' | 'info' | undefined;
|
||||
};
|
||||
configInput: {
|
||||
hideIcons?: boolean | undefined;
|
||||
maxRelations?: number | undefined;
|
||||
filter?: EntityPredicate | undefined;
|
||||
type?: 'content' | 'summary' | 'info' | undefined;
|
||||
type?: 'content' | 'info' | undefined;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
|
||||
Reference in New Issue
Block a user