Prevent console warning spam by logging only once

Co-authored-by: Rugvip <4984472+Rugvip@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-03 11:39:12 +00:00
parent ba2f6ff647
commit 5071208398
@@ -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.",