Skip to content

A local-first personal finance app

:bug: (reports) fix reports page having empty blocks (#3566)

Matiss Janis Aboltins0b6ea52d9b5b
diff --git a/packages/desktop-client/src/components/reports/Overview.tsx b/packages/desktop-client/src/components/reports/Overview.tsx
index 0f3c3b22be..82c2f38fca 100644
--- a/packages/desktop-client/src/components/reports/Overview.tsx
+++ b/packages/desktop-client/src/components/reports/Overview.tsx
@@ -82,16 +82,26 @@ export function Overview() {
const isDashboardsFeatureEnabled = useFeatureFlag('dashboards');
const spendingReportFeatureFlag = useFeatureFlag('spendingReport');
- const baseLayout = widgets.map(widget => ({
- i: widget.id,
- w: widget.width,
- h: widget.height,
- minW:
- isCustomReportWidget(widget) || widget.type === 'markdown-card' ? 2 : 3,
- minH:
- isCustomReportWidget(widget) || widget.type === 'markdown-card' ? 1 : 2,
- ...widget,
- }));
+ const baseLayout = widgets
+ .map(widget => ({
+ i: widget.id,
+ w: widget.width,
+ h: widget.height,
+ minW:
+ isCustomReportWidget(widget) || widget.type === 'markdown-card' ? 2 : 3,
+ minH:
+ isCustomReportWidget(widget) || widget.type === 'markdown-card' ? 1 : 2,
+ ...widget,
+ }))
+ .filter(item => {
+ if (isDashboardsFeatureEnabled) {
+ return true;
+ }
+ if (item.type === 'custom-report' && !customReportMap.has(item.meta.id)) {
+ return false;
+ }
+ return true;
+ });
const layout =
spendingReportFeatureFlag &&
diff --git a/upcoming-release-notes/3566.md b/upcoming-release-notes/3566.md
new file mode 100644
index 0000000000..0cce4b7453
--- /dev/null
+++ b/upcoming-release-notes/3566.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [MatissJanis]
+---
+
+Reports: fix old reports page having empty blocks.