Merge pull request #32640 from backstage/copilot/sub-pr-32638
catalog: Log summary card deprecation warning once per application lifecycle
This commit is contained in:
@@ -32,6 +32,9 @@ import {
|
||||
} from '../components/EntityProcessingErrorsPanel';
|
||||
import { HorizontalScrollGrid } from '@backstage/core-components';
|
||||
|
||||
// Module-level flag to ensure deprecation warning is only logged once
|
||||
let hasLoggedSummaryWarning = false;
|
||||
|
||||
const useStyles = makeStyles<
|
||||
Theme,
|
||||
{ infoCards: boolean; summaryCards: boolean; contentCards: boolean }
|
||||
@@ -144,7 +147,8 @@ export function DefaultEntityContentLayout(props: EntityContentLayoutProps) {
|
||||
card => !card.type || card.type === 'content',
|
||||
);
|
||||
|
||||
if (summaryCards.length > 0) {
|
||||
if (summaryCards.length > 0 && !hasLoggedSummaryWarning) {
|
||||
hasLoggedSummaryWarning = true;
|
||||
// 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.",
|
||||
|
||||
Reference in New Issue
Block a user