Skip to content

Commit

Permalink
🐛 (dashboards) add back spending report if dashboards feature is not …
Browse files Browse the repository at this point in the history
…enabled (#3323)
  • Loading branch information
MatissJanis authored Aug 28, 2024
1 parent f1c0d0b commit ae608f0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
21 changes: 20 additions & 1 deletion packages/desktop-client/src/components/reports/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3323.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [MatissJanis]
---

Dashboards: add back spending report if dashboards are not enabled

0 comments on commit ae608f0

Please sign in to comment.