From af2a03c5bacdfb2e1a77f0d28c126001521616dc Mon Sep 17 00:00:00 2001 From: carkom Date: Mon, 5 Feb 2024 23:27:15 +0000 Subject: [PATCH] merge fixes --- .../src/components/reports/Overview.jsx | 15 ++++--- .../components/reports/graphs/AreaGraph.tsx | 42 ++++++++++--------- .../desktop-client/src/hooks/useFilters.ts | 1 - .../src/client/data-hooks/reports.ts | 4 +- 4 files changed, 33 insertions(+), 29 deletions(-) diff --git a/packages/desktop-client/src/components/reports/Overview.jsx b/packages/desktop-client/src/components/reports/Overview.jsx index 81569333cde..0810b0709de 100644 --- a/packages/desktop-client/src/components/reports/Overview.jsx +++ b/packages/desktop-client/src/components/reports/Overview.jsx @@ -10,7 +10,7 @@ import { View } from '../common/View'; import { CashFlowCard } from './reports/CashFlowCard'; import { CategorySpendingCard } from './reports/CategorySpendingCard'; import { CustomReportCard } from './reports/CustomReportCard'; -import {CustomReportListCards} from './reports/CustomReportListCards'; +import { CustomReportListCards } from './reports/CustomReportListCards'; import { NetWorthCard } from './reports/NetWorthCard'; import { SankeyCard } from './reports/SankeyCard'; @@ -22,12 +22,15 @@ export function Overview() { const sankeyFeatureFlag = useFeatureFlag('sankeyReport'); const customReportsFeatureFlag = useFeatureFlag('customReports'); - + const featureCount = - 3 - - categorySpendingReportFeatureFlag ? 1 : 0 - - sankeyFeatureFlag ? 1 : 0 - - customReportsFeatureFlag ? 1 : 0; + 3 - categorySpendingReportFeatureFlag + ? 1 + : 0 - sankeyFeatureFlag + ? 1 + : 0 - customReportsFeatureFlag + ? 1 + : 0; const accounts = useSelector(state => state.queries.accounts); return ( diff --git a/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx b/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx index 3851bb6b6a1..28b47e3527e 100644 --- a/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx @@ -184,25 +184,27 @@ export function AreaGraph({ data={data.monthData} margin={{ top: 0, right: labelsMargin, left: 0, bottom: 0 }} > - {!compact && ( //flag - <> - - - - + {compact ? null : ( + + )} + {compact ? null : ( + + )} + {compact ? null : ( + )} } @@ -234,7 +236,7 @@ export function AreaGraph({ fill="url(#splitColor)" fillOpacity={1} > - {viewLabels && !compact && ( + {viewLabels && ( customLabel(e, width, lastLabel)} diff --git a/packages/desktop-client/src/hooks/useFilters.ts b/packages/desktop-client/src/hooks/useFilters.ts index fec115e07f1..586b0f3b270 100644 --- a/packages/desktop-client/src/hooks/useFilters.ts +++ b/packages/desktop-client/src/hooks/useFilters.ts @@ -7,7 +7,6 @@ export function useFilters(initialFilters: T[] = []) { const [saved, setSaved] = useState(null); const onApply = useCallback( - //flag newFilter => { if (newFilter === null) { setFilters([]); diff --git a/packages/loot-core/src/client/data-hooks/reports.ts b/packages/loot-core/src/client/data-hooks/reports.ts index 9c02d3745c0..6d22f0ab33d 100644 --- a/packages/loot-core/src/client/data-hooks/reports.ts +++ b/packages/loot-core/src/client/data-hooks/reports.ts @@ -22,7 +22,7 @@ function toJS(rows: CustomReportData[]) { export function useReports() { const reports = toJS(useLiveQuery(() => q('reports').select('*'), []) || []); - /** Sort reports by alphabetical order */ + // Sort reports by alphabetical order function sort(reports) { return reports.sort((a, b) => a.name.trim().localeCompare(b.name.trim(), { ignorePunctuation: true }), @@ -42,7 +42,7 @@ export function useReports(): CustomReportEntity[] { useLiveQuery(() => q('transaction_filters').select('*'), []) || [], ); - /** Sort reports by alphabetical order */ + // Sort reports by alphabetical order function sort(reports: CustomReportEntity[]) { return reports.sort((a, b) => a.name && b.name