diff --git a/packages/desktop-client/src/components/reports/Overview.tsx b/packages/desktop-client/src/components/reports/Overview.tsx index 0587f6dc7d0..faec350ce6f 100644 --- a/packages/desktop-client/src/components/reports/Overview.tsx +++ b/packages/desktop-client/src/components/reports/Overview.tsx @@ -96,7 +96,26 @@ export function Overview() { const isDashboardsFeatureEnabled = useFeatureFlag('dashboards'); const spendingReportFeatureFlag = useFeatureFlag('spendingReport'); - const layout = useWidgetLayout(widgets); + const baseLayout = useWidgetLayout(widgets); + const layout = + spendingReportFeatureFlag && + !isDashboardsFeatureEnabled && + !baseLayout.find(({ type }) => type === 'spending-card') + ? [ + ...baseLayout, + { + i: 'spending', + type: 'spending-card' as const, + x: 0, + y: Math.max(...baseLayout.map(({ y }) => y), 0) + 2, + w: 4, + h: 2, + minW: 3, + minH: 2, + meta: null, + }, + ] + : baseLayout; const closeNotifications = () => { dispatch(removeNotification('import')); diff --git a/upcoming-release-notes/3323.md b/upcoming-release-notes/3323.md new file mode 100644 index 00000000000..8807a5a0998 --- /dev/null +++ b/upcoming-release-notes/3323.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [MatissJanis] +--- + +Dashboards: add back spending report if dashboards are not enabled