diff --git a/packages/desktop-client/e2e/page-models/reports-page.js b/packages/desktop-client/e2e/page-models/reports-page.js index d6f6705268..c5c070f3cb 100644 --- a/packages/desktop-client/e2e/page-models/reports-page.js +++ b/packages/desktop-client/e2e/page-models/reports-page.js @@ -22,8 +22,9 @@ export class ReportsPage { async goToCustomReportPage() { await this.pageContent - .getByRole('button', { name: 'Create new custom report' }) + .getByRole('button', { name: 'Add new widget' }) .click(); + await this.page.getByRole('button', { name: 'New custom report' }).click(); return new CustomReportPage(this.page); } diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-1-chromium-linux.png index c745249782..a2ece8e203 100644 Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-1-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-1-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-2-chromium-linux.png index 7354ab4262..581cb57fce 100644 Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-2-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-2-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-3-chromium-linux.png index 2bfb72925d..7319444883 100644 Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-3-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-3-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-1-chromium-linux.png index 693e47ae3f..846d1b279f 100644 Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-1-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-1-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-2-chromium-linux.png index f8d7f531f3..0ab2b3e9d3 100644 Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-2-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-2-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-3-chromium-linux.png index f86c357494..b105e11b4a 100644 Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-3-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-3-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-1-chromium-linux.png index 758ccf53f8..f6185ec8f3 100644 Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-1-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-1-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-2-chromium-linux.png index c221cbb0ca..ea636130ff 100644 Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-2-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-2-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-3-chromium-linux.png index a359fe01e1..a821b995cd 100644 Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-3-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-3-chromium-linux.png differ diff --git a/packages/desktop-client/src/components/reports/Header.tsx b/packages/desktop-client/src/components/reports/Header.tsx index a262f2dcec..06a73d1998 100644 --- a/packages/desktop-client/src/components/reports/Header.tsx +++ b/packages/desktop-client/src/components/reports/Header.tsx @@ -7,7 +7,6 @@ import { type TimeFrame, } from 'loot-core/types/models'; -import { useFeatureFlag } from '../../hooks/useFeatureFlag'; import { Button } from '../common/Button2'; import { Select } from '../common/Select'; import { SpaceBetween } from '../common/SpaceBetween'; @@ -62,7 +61,6 @@ export function Header({ children, }: HeaderProps) { const { t } = useTranslation(); - const isDashboardsFeatureEnabled = useFeatureFlag('dashboards'); const { isNarrowWidth } = useResponsive(); return ( @@ -80,7 +78,7 @@ export function Header({ }} > - {isDashboardsFeatureEnabled && mode && ( + {mode && ( + - setMenuOpen(false)} - > - { - if (item === 'custom-report') { - navigate('/reports/custom'); - return; - } + setMenuOpen(false)} + > + { + if (item === 'custom-report') { + navigate('/reports/custom'); + return; + } - function isExistingCustomReport( - name: string, - ): name is `custom-report-${string}` { - return name.startsWith('custom-report-'); - } - if (isExistingCustomReport(item)) { - const [, reportId] = item.split('custom-report-'); - onAddWidget('custom-report', { - id: reportId, - }); - return; - } + function isExistingCustomReport( + name: string, + ): name is `custom-report-${string}` { + return name.startsWith('custom-report-'); + } + if (isExistingCustomReport(item)) { + const [, reportId] = item.split('custom-report-'); + onAddWidget('custom-report', { + id: reportId, + }); + return; + } - if (item === 'markdown-card') { - onAddWidget(item, { - content: t( - '### Text Widget\n\nEdit this widget to change the **markdown** content.', - ), - }); - return; - } + if (item === 'markdown-card') { + onAddWidget(item, { + content: t( + '### Text Widget\n\nEdit this widget to change the **markdown** content.', + ), + }); + return; + } - onAddWidget(item); - }} - items={[ - { - name: 'cash-flow-card' as const, - text: t('Cash flow graph'), - }, - { - name: 'net-worth-card' as const, - text: t('Net worth graph'), - }, - { - name: 'spending-card' as const, - text: t('Spending analysis'), - }, - { - name: 'markdown-card' as const, - text: t('Text widget'), - }, - { - name: 'custom-report' as const, - text: t('New custom report'), - }, - ...(customReports.length - ? ([Menu.line] satisfies Array) - : []), - ...customReports.map(report => ({ - name: `custom-report-${report.id}` as const, - text: report.name, - })), - ]} - /> - - - )} + onAddWidget(item); + }} + items={[ + { + name: 'cash-flow-card' as const, + text: t('Cash flow graph'), + }, + { + name: 'net-worth-card' as const, + text: t('Net worth graph'), + }, + { + name: 'spending-card' as const, + text: t('Spending analysis'), + }, + { + name: 'markdown-card' as const, + text: t('Text widget'), + }, + { + name: 'custom-report' as const, + text: t('New custom report'), + }, + ...(customReports.length + ? ([Menu.line] satisfies Array) + : []), + ...customReports.map(report => ({ + name: `custom-report-${report.id}` as const, + text: report.name, + })), + ]} + /> + {isEditing ? ( - ) : isDashboardsFeatureEnabled ? ( + ) : ( - ) : ( - )} - {isDashboardsFeatureEnabled && ( - <> - setExtraMenuOpen(true)} - /> - setExtraMenuOpen(false)} - > - { - switch (item) { - case 'reset': - onResetDashboard(); - break; - case 'export': - onExport(); - break; - case 'import': - onImport(); - break; - } - setExtraMenuOpen(false); - }} - items={[ - { - name: 'reset', - text: t('Reset to default'), - disabled: isImporting, - }, - Menu.line, - { - name: 'import', - text: t('Import'), - disabled: isImporting, - }, - { - name: 'export', - text: t('Export'), - disabled: isImporting, - }, - ]} - /> - - - )} + setExtraMenuOpen(true)} + /> + setExtraMenuOpen(false)} + > + { + switch (item) { + case 'reset': + onResetDashboard(); + break; + case 'export': + onExport(); + break; + case 'import': + onImport(); + break; + } + setExtraMenuOpen(false); + }} + items={[ + { + name: 'reset', + text: t('Reset to default'), + disabled: isImporting, + }, + Menu.line, + { + name: 'import', + text: t('Import'), + disabled: isImporting, + }, + { + name: 'export', + text: t('Export'), + disabled: isImporting, + }, + ]} + /> + )} diff --git a/packages/desktop-client/src/components/reports/reports/CashFlowCard.tsx b/packages/desktop-client/src/components/reports/reports/CashFlowCard.tsx index 552b87ea49..831dd54920 100644 --- a/packages/desktop-client/src/components/reports/reports/CashFlowCard.tsx +++ b/packages/desktop-client/src/components/reports/reports/CashFlowCard.tsx @@ -6,7 +6,6 @@ import { Bar, BarChart, LabelList, ResponsiveContainer } from 'recharts'; import { integerToCurrency } from 'loot-core/src/shared/util'; import { type CashFlowWidget } from 'loot-core/src/types/models'; -import { useFeatureFlag } from '../../../hooks/useFeatureFlag'; import { theme } from '../../../style'; import { View } from '../../common/View'; import { PrivacyFilter } from '../../PrivacyFilter'; @@ -98,7 +97,6 @@ export function CashFlowCard({ onMetaChange, onRemove, }: CashFlowCardProps) { - const isDashboardsFeatureEnabled = useFeatureFlag('dashboards'); const { t } = useTranslation(); const [start, end] = calculateTimeRange(meta?.timeFrame, defaultTimeFrame); @@ -121,11 +119,7 @@ export function CashFlowCard({ return ( {t('This custom report has been deleted.')} diff --git a/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx b/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx index 866faef7e9..0a22f429ed 100644 --- a/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx +++ b/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx @@ -7,7 +7,6 @@ import { type NetWorthWidget, } from 'loot-core/src/types/models'; -import { useFeatureFlag } from '../../../hooks/useFeatureFlag'; import { styles } from '../../../style'; import { Block } from '../../common/Block'; import { View } from '../../common/View'; @@ -40,7 +39,6 @@ export function NetWorthCard({ onMetaChange, onRemove, }: NetWorthCardProps) { - const isDashboardsFeatureEnabled = useFeatureFlag('dashboards'); const { t } = useTranslation(); const { isNarrowWidth } = useResponsive(); @@ -67,11 +65,7 @@ export function NetWorthCard({ return ( {!isNarrowWidth && ( - {isDashboardsFeatureEnabled && ( - <> - + - - - )} + diff --git a/packages/desktop-client/src/components/reports/reports/SpendingCard.tsx b/packages/desktop-client/src/components/reports/reports/SpendingCard.tsx index fb5407f237..117dfe1018 100644 --- a/packages/desktop-client/src/components/reports/reports/SpendingCard.tsx +++ b/packages/desktop-client/src/components/reports/reports/SpendingCard.tsx @@ -5,7 +5,6 @@ import * as monthUtils from 'loot-core/src/shared/months'; import { amountToCurrency } from 'loot-core/src/shared/util'; import { type SpendingWidget } from 'loot-core/src/types/models'; -import { useFeatureFlag } from '../../../hooks/useFeatureFlag'; import { styles } from '../../../style/styles'; import { theme } from '../../../style/theme'; import { Block } from '../../common/Block'; @@ -35,7 +34,6 @@ export function SpendingCard({ onMetaChange, onRemove, }: SpendingCardProps) { - const isDashboardsFeatureEnabled = useFeatureFlag('dashboards'); const { t } = useTranslation(); const [compare, compareTo] = calculateSpendingReportTimeRange(meta ?? {}); @@ -71,11 +69,7 @@ export function SpendingCard({ return ( Goal templates - - Customizable reports page (dashboards) - = { goalTemplatesEnabled: false, - dashboards: false, actionTemplating: false, upcomingLengthAdjustment: false, contextMenus: false, diff --git a/packages/loot-core/src/types/prefs.d.ts b/packages/loot-core/src/types/prefs.d.ts index ba1e542492..6c54362a90 100644 --- a/packages/loot-core/src/types/prefs.d.ts +++ b/packages/loot-core/src/types/prefs.d.ts @@ -1,5 +1,4 @@ export type FeatureFlag = - | 'dashboards' | 'goalTemplatesEnabled' | 'actionTemplating' | 'upcomingLengthAdjustment' diff --git a/upcoming-release-notes/3856.md b/upcoming-release-notes/3856.md new file mode 100644 index 0000000000..a661c206b3 --- /dev/null +++ b/upcoming-release-notes/3856.md @@ -0,0 +1,6 @@ +--- +category: Features +authors: [MatissJanis] +--- + +Dashboards: release as first party feature.