Skip to content

A local-first personal finance app

Custom Reports Bug Fixes (#1930)

Neile48f36cd2047
diff --git a/packages/desktop-client/src/components/filters/CompactFiltersButton.tsx b/packages/desktop-client/src/components/filters/CompactFiltersButton.tsx
new file mode 100644
index 0000000000..28f73ef9a1
--- /dev/null
+++ b/packages/desktop-client/src/components/filters/CompactFiltersButton.tsx
@@ -0,0 +1,18 @@
+import React from 'react';
+
+import { Filter } from '../../icons/v1';
+import Button from '../common/Button';
+
+type CompactFiltersButtonProps = {
+ onClick: (newValue) => void;
+};
+
+function CompactFiltersButton({ onClick }: CompactFiltersButtonProps) {
+ return (
+ <Button type="bare" onClick={onClick}>
+ <Filter width={15} height={15} />
+ </Button>
+ );
+}
+
+export default CompactFiltersButton;
diff --git a/packages/desktop-client/src/components/filters/FiltersButton.tsx b/packages/desktop-client/src/components/filters/FiltersButton.tsx
new file mode 100644
index 0000000000..1b3ef60aaf
--- /dev/null
+++ b/packages/desktop-client/src/components/filters/FiltersButton.tsx
@@ -0,0 +1,21 @@
+import React from 'react';
+
+import { SettingsSliderAlternate } from '../../icons/v2';
+import Button from '../common/Button';
+
+type FiltersButtonProps = {
+ onClick: (newValue) => void;
+};
+
+function FiltersButton({ onClick }: FiltersButtonProps) {
+ return (
+ <Button type="bare" onClick={onClick} title={'Filters'}>
+ <SettingsSliderAlternate
+ style={{ width: 16, height: 16, marginRight: 5 }}
+ />{' '}
+ Filter
+ </Button>
+ );
+}
+
+export default FiltersButton;
diff --git a/packages/desktop-client/src/components/filters/FiltersMenu.js b/packages/desktop-client/src/components/filters/FiltersMenu.js
index dd5411203d..544c3cedda 100644
--- a/packages/desktop-client/src/components/filters/FiltersMenu.js
+++ b/packages/desktop-client/src/components/filters/FiltersMenu.js
@@ -24,10 +24,9 @@ import {
import { titleFirst } from 'loot-core/src/shared/util';
import DeleteIcon from '../../icons/v0/Delete';
-import Filter from '../../icons/v1/Filter';
-import SettingsSliderAlternate from '../../icons/v2/SettingsSliderAlternate';
import { theme } from '../../style';
import Button from '../common/Button';
+import HoverTarget from '../common/HoverTarget';
import Menu from '../common/Menu';
import Select from '../common/Select';
import Stack from '../common/Stack';
@@ -37,6 +36,8 @@ import Value from '../rules/Value';
import { Tooltip } from '../tooltips';
import GenericInput from '../util/GenericInput';
+import CompactFiltersButton from './CompactFiltersButton';
+import FiltersButton from './FiltersButton';
import { CondOpMenu } from './SavedFilters';
let filterFields = [
@@ -336,28 +337,7 @@ function ConfigureField({
);
}
-function ButtonType({ type, dispatch }) {
- return (
- <Button
- type="bare"
- onClick={() => dispatch({ type: 'select-field' })}
- title={type && 'Filters'}
- >
- {type === 'reports' ? (
- <Filter width={15} height={15} />
- ) : (
- <>
- <SettingsSliderAlternate
- style={{ width: 16, height: 16, marginRight: 5 }}
- />{' '}
- Filter
- </>
- )}
- </Button>
- );
-}
-
-export function FilterButton({ onApply, type }) {
+export function FilterButton({ onApply, compact, hover }) {
let filters = useFilters();
let { dateFormat } = useSelector(state => {
@@ -440,7 +420,32 @@ export function FilterButton({ onApply, type }) {
return (
<View>
- <ButtonType type={type} dispatch={dispatch} />
+ <HoverTarget
+ style={{ flexShrink: 0 }}
+ renderContent={() =>
+ hover && (
+ <Tooltip
+ position="bottom-left"
+ style={{
+ lineHeight: 1.5,
+ padding: '6px 10px',
+ backgroundColor: theme.menuAutoCompleteBackground,
+ color: theme.menuAutoCompleteText,
+ }}
+ >
+ <Text>Filters</Text>
+ </Tooltip>
+ )
+ }
+ >
+ {compact ? (
+ <CompactFiltersButton
+ onClick={() => dispatch({ type: 'select-field' })}
+ />
+ ) : (
+ <FiltersButton onClick={() => dispatch({ type: 'select-field' })} />
+ )}
+ </HoverTarget>
{state.fieldsOpen && (
<Tooltip
position="bottom-left"
diff --git a/packages/desktop-client/src/components/reports/CategorySelector.tsx b/packages/desktop-client/src/components/reports/CategorySelector.tsx
index 09be1b668a..f22cf6e1f9 100644
--- a/packages/desktop-client/src/components/reports/CategorySelector.tsx
+++ b/packages/desktop-client/src/components/reports/CategorySelector.tsx
@@ -1,46 +1,95 @@
-import React, { Fragment, useState } from 'react';
+import React, { Fragment, useMemo, useState } from 'react';
import {
type CategoryEntity,
type CategoryGroupEntity,
} from 'loot-core/src/types/models';
+import { CheckAll, UncheckAll } from '../../icons/v2';
import ViewHide from '../../icons/v2/ViewHide';
import ViewShow from '../../icons/v2/ViewShow';
import { type CategoryListProps } from '../autocomplete/CategoryAutocomplete';
import Button from '../common/Button';
+import Text from '../common/Text';
+import View from '../common/View';
import { Checkbox } from '../forms';
+import GraphButton from './GraphButton';
+
type CategorySelectorProps = {
categoryGroups: Array<CategoryGroupEntity>;
+ categories: Array<CategoryEntity>;
selectedCategories: CategoryListProps['items'];
setSelectedCategories: (selectedCategories: CategoryEntity[]) => null;
};
export default function CategorySelector({
categoryGroups,
+ categories,
selectedCategories,
setSelectedCategories,
}: CategorySelectorProps) {
const [uncheckedHidden, setUncheckedHidden] = useState(false);
+ const selectedCategoryMap = useMemo(
+ () => selectedCategories.map(selected => selected.id),
+ [selectedCategories],
+ );
+ const allCategoriesSelected = categories.every(category =>
+ selectedCategoryMap.includes(category.id),
+ );
+
+ const allCategoriesUnselected = !categories.some(category =>
+ selectedCategoryMap.includes(category.id),
+ );
+
+ let selectAll: CategoryEntity[] = [];
+ categoryGroups.map(categoryGroup =>
+ categoryGroup.categories.map(category => selectAll.push(category)),
+ );
+
return (
- <>
- <div>
- <Button onClick={() => setUncheckedHidden(state => !state)}>
- {uncheckedHidden ? (
- <>
- <ViewShow width={15} height={15} style={{ marginRight: 5 }} />
- Show unchecked
- </>
- ) : (
- <>
- <ViewHide width={15} height={15} style={{ marginRight: 5 }} />
- Hide unchecked
- </>
- )}
+ <View>
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
+ <Button type="bare" onClick={() => setUncheckedHidden(state => !state)}>
+ <View>
+ {uncheckedHidden ? (
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
+ <ViewShow width={15} height={15} style={{ marginRight: 5 }} />
+ <Text>Show unchecked</Text>
+ </View>
+ ) : (
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
+ <ViewHide width={15} height={15} style={{ marginRight: 5 }} />
+ <Text>Hide unchecked</Text>
+ </View>
+ )}
+ </View>
</Button>
- </div>
+ <View style={{ flex: 1 }} />
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
+ <GraphButton
+ selected={allCategoriesSelected}
+ title="Select All"
+ onSelect={() => {
+ setSelectedCategories(selectAll);
+ }}
+ style={{ marginRight: 5, padding: 8 }}
+ >
+ <CheckAll width={15} height={15} />
+ </GraphButton>
+ <GraphButton
+ selected={allCategoriesUnselected}
+ title="Unselect All"
+ onSelect={() => {
+ setSelectedCategories([]);
+ }}
+ style={{ padding: 8 }}
+ >
+ <UncheckAll width={15} height={15} />
+ </GraphButton>
+ </View>
+ </View>
<ul
style={{
@@ -50,7 +99,7 @@ export default function CategorySelector({
paddingRight: 10,
height: 320,
flexGrow: 1,
- overflowY: 'scroll',
+ overflowY: 'auto',
}}
>
{categoryGroups &&
@@ -166,6 +215,6 @@ export default function CategorySelector({
);
})}
</ul>
- </>
+ </View>
);
}
diff --git a/packages/desktop-client/src/components/reports/GraphButton.tsx b/packages/desktop-client/src/components/reports/GraphButton.tsx
new file mode 100644
index 0000000000..d3857def56
--- /dev/null
+++ b/packages/desktop-client/src/components/reports/GraphButton.tsx
@@ -0,0 +1,59 @@
+import React, { type HTMLProps } from 'react';
+
+import { type CSSProperties, theme } from '../../style';
+import Button from '../common/Button';
+import HoverTarget from '../common/HoverTarget';
+import Text from '../common/Text';
+import { Tooltip } from '../tooltips';
+
+type GraphButtonProps = HTMLProps<HTMLButtonElement> & {
+ selected?: boolean;
+ style?: CSSProperties;
+ onSelect?: (newValue) => void;
+ title?: string;
+ disabled?: boolean;
+};
+
+const GraphButton = ({
+ selected,
+ children,
+ onSelect,
+ title,
+ style,
+ disabled,
+}: GraphButtonProps) => {
+ return (
+ <HoverTarget
+ style={{ flexShrink: 0 }}
+ renderContent={() => (
+ <Tooltip
+ position="bottom-left"
+ style={{
+ lineHeight: 1.5,
+ padding: '6px 10px',
+ backgroundColor: theme.menuAutoCompleteBackground,
+ color: theme.menuAutoCompleteText,
+ }}
+ >
+ <Text>{title}</Text>
+ </Tooltip>
+ )}
+ >
+ <Button
+ type="bare"
+ style={{
+ ...(selected && {
+ backgroundColor: theme.buttonBareBackgroundHover,
+ }),
+ ...style,
+ }}
+ onClick={onSelect}
+ disabled={disabled}
+ >
+ {children}
+ </Button>
+ </HoverTarget>
+ );
+};
+
+export default GraphButton;
diff --git a/packages/desktop-client/src/components/reports/Header.js b/packages/desktop-client/src/components/reports/Header.js
index 1e8fc51850..e1b6408bd1 100644
--- a/packages/desktop-client/src/components/reports/Header.js
+++ b/packages/desktop-client/src/components/reports/Header.js
@@ -26,6 +26,18 @@ export function validateEnd(allMonths, start, end) {
return boundedRange(earliest, start, end);
}
+export function validateRange(allMonths, start, end) {
+ const latest = monthUtils.currentMonth();
+ const earliest = allMonths[allMonths.length - 1].name;
+ if (end > latest) {
+ end = latest;
+ }
+ if (start < earliest) {
+ start = earliest;
+ }
+ return [start, end];
+}
+
function boundedRange(earliest, start, end) {
const latest = monthUtils.currentMonth();
if (end > latest) {
diff --git a/packages/desktop-client/src/components/reports/LoadingIndicator.tsx b/packages/desktop-client/src/components/reports/LoadingIndicator.tsx
new file mode 100644
index 0000000000..8e71593df3
--- /dev/null
+++ b/packages/desktop-client/src/components/reports/LoadingIndicator.tsx
@@ -0,0 +1,33 @@
+import React from 'react';
+
+import AnimatedLoading from '../../icons/AnimatedLoading';
+import { theme, styles } from '../../style';
+import Block from '../common/Block';
+import View from '../common/View';
+
+type LoadingIndicatorProps = {
+ message?: string;
+};
+
+const LoadingIndicator = ({ message }: LoadingIndicatorProps) => {
+ return (
+ <View
+ style={{
+ flex: 1,
+ gap: 20,
+ justifyContent: 'center',
+ alignItems: 'center',
+ ...styles.delayedFadeIn,
+ }}
+ >
+ {message && (
+ <Block style={{ marginBottom: 20, fontSize: 18 }}>{message}</Block>
+ )}
+ <AnimatedLoading
+ style={{ width: 25, height: 25, color: theme.pageTextDark }}
+ />
+ </View>
+ );
+};
+
+export default LoadingIndicator;
diff --git a/packages/desktop-client/src/components/reports/Overview.js b/packages/desktop-client/src/components/reports/Overview.js
index 05082df5a8..5c2784bd00 100644
--- a/packages/desktop-client/src/components/reports/Overview.js
+++ b/packages/desktop-client/src/components/reports/Overview.js
@@ -2,7 +2,6 @@ import React from 'react';
import { useSelector } from 'react-redux';
import useFeatureFlag from '../../hooks/useFeatureFlag';
-import AnimatedLoading from '../../icons/AnimatedLoading';
import { styles } from '../../style';
import View from '../common/View';
@@ -12,20 +11,6 @@ import CustomReportCard from './reports/CustomReportCard';
import NetWorthCard from './reports/NetWorthCard';
import SankeyCard from './reports/SankeyCard';
-export function LoadingIndicator() {
- return (
- <View
- style={{
- height: '100%',
- alignItems: 'center',
- justifyContent: 'center',
- }}
- >
- <AnimatedLoading style={{ width: 25, height: 25 }} />
- </View>
- );
-}
-
export default function Overview() {
let categorySpendingReportFeatureFlag = useFeatureFlag(
'categorySpendingReport',
diff --git a/packages/desktop-client/src/components/reports/ReportOptions.tsx b/packages/desktop-client/src/components/reports/ReportOptions.tsx
index a310a5f026..73e2fff5b5 100644
--- a/packages/desktop-client/src/components/reports/ReportOptions.tsx
+++ b/packages/desktop-client/src/components/reports/ReportOptions.tsx
@@ -18,6 +18,8 @@ const dateRangeOptions = [
{ description: '3 months', name: 2 },
{ description: '6 months', name: 5 },
{ description: '1 year', name: 11 },
+ { description: 'Year to date', name: 'yearToDate' },
+ { description: 'Last year', name: 'lastYear' },
{ description: 'All time', name: 'allMonths' },
];
diff --git a/packages/desktop-client/src/components/reports/ReportSidebar.js b/packages/desktop-client/src/components/reports/ReportSidebar.js
index 8a43f59d64..5f22d0a13c 100644
--- a/packages/desktop-client/src/components/reports/ReportSidebar.js
+++ b/packages/desktop-client/src/components/reports/ReportSidebar.js
@@ -15,6 +15,7 @@ import {
validateEnd,
getLatestRange,
getFullRange,
+ validateRange,
} from './Header';
import { ReportOptions } from './ReportOptions';
@@ -73,7 +74,39 @@ export function ReportSidebar({
selectedCategories,
setSelectedCategories,
}) {
- function onChangeMode(cond) {
+ const onSelectRange = cond => {
+ switch (cond) {
+ case 'All time':
+ onChangeDates(...getFullRange(allMonths));
+ break;
+ case 'Year to date':
+ onChangeDates(
+ ...validateRange(
+ allMonths,
+ monthUtils.getYearStart(monthUtils.currentMonth()),
+ monthUtils.currentMonth(),
+ ),
+ );
+ break;
+ case 'Last year':
+ onChangeDates(
+ ...validateRange(
+ allMonths,
+ monthUtils.getYearStart(
+ monthUtils.prevYear(monthUtils.currentMonth()),
+ ),
+ monthUtils.getYearEnd(
+ monthUtils.prevYear(monthUtils.currentDate()),
+ ),
+ ),
+ );
+ break;
+ default:
+ onChangeDates(...getLatestRange(ReportOptions.dateRangeMap.get(cond)));
+ }
+ };
+
+ const onChangeMode = cond => {
setMode(cond);
if (cond === 'time') {
if (graphType === 'TableGraph') {
@@ -101,9 +134,9 @@ export function ReportSidebar({
setTypeDisabled([]);
}
}
- }
+ };
- function onChangeSplit(cond) {
+ const onChangeSplit = cond => {
setGroupBy(cond);
if (mode === 'total') {
if (graphType !== 'TableGraph') {
@@ -113,15 +146,16 @@ export function ReportSidebar({
if (['Net'].includes(balanceType) && graphType !== 'TableGraph') {
setBalanceType('Expense');
}
- }
+ };
return (
<View
style={{
- width: 200,
+ width: 225,
paddingTop: 10,
paddingRight: 10,
flexShrink: 0,
+ overflowY: 'auto',
}}
>
<View style={{ flexShrink: 0 }}>
@@ -301,7 +335,7 @@ export function ReportSidebar({
<View
style={{
height: 1,
- backgroundColor: theme.altPillBorder,
+ backgroundColor: theme.pillBorderDark,
marginTop: 10,
flexShrink: 0,
}}
@@ -332,13 +366,7 @@ export function ReportSidebar({
value={dateRange}
onChange={e => {
setDateRange(e);
- if (e === 'allMonths') {
- onChangeDates(...getFullRange(allMonths));
- } else {
- onChangeDates(
- ...getLatestRange(ReportOptions.dateRangeMap.get(e)),
- );
- }
+ onSelectRange(e);
}}
options={ReportOptions.dateRange.map(option => [
option.description,
@@ -387,7 +415,7 @@ export function ReportSidebar({
<View
style={{
height: 1,
- backgroundColor: theme.altPillBorder,
+ backgroundColor: theme.pillBorderDark,
marginTop: 10,
flexShrink: 0,
}}
@@ -397,10 +425,12 @@ export function ReportSidebar({
<View
style={{
marginTop: 10,
+ minHeight: 200,
}}
>
<CategorySelector
categoryGroups={categories.grouped}
+ categories={categories.list}
selectedCategories={selectedCategories}
setSelectedCategories={setSelectedCategories}
/>
diff --git a/packages/desktop-client/src/components/reports/ReportTableHeader.tsx b/packages/desktop-client/src/components/reports/ReportTableHeader.tsx
index 932d7e4a34..48ce358507 100644
--- a/packages/desktop-client/src/components/reports/ReportTableHeader.tsx
+++ b/packages/desktop-client/src/components/reports/ReportTableHeader.tsx
@@ -2,7 +2,7 @@ import React from 'react';
import * as d from 'date-fns';
-import { theme } from '../../style';
+import { styles, theme } from '../../style';
import { Row, Cell } from '../table';
export default function ReportTableHeader({
@@ -23,6 +23,7 @@ export default function ReportTableHeader({
<Cell
style={{
minWidth: 125,
+ ...styles.tnum,
}}
value={groupBy}
width="flex"
@@ -33,6 +34,7 @@ export default function ReportTableHeader({
<Cell
style={{
minWidth: 85,
+ ...styles.tnum,
}}
key={header}
// eslint-disable-next-line rulesdir/typography
@@ -46,6 +48,7 @@ export default function ReportTableHeader({
<Cell
style={{
minWidth: 85,
+ ...styles.tnum,
}}
value={'Assets'}
width="flex"
@@ -53,6 +56,7 @@ export default function ReportTableHeader({
<Cell
style={{
minWidth: 85,
+ ...styles.tnum,
}}
value={'Debts'}
width="flex"
@@ -62,6 +66,7 @@ export default function ReportTableHeader({
<Cell
style={{
minWidth: 85,
+ ...styles.tnum,
}}
value={'Totals'}
width="flex"
@@ -69,6 +74,7 @@ export default function ReportTableHeader({
<Cell
style={{
minWidth: 85,
+ ...styles.tnum,
}}
value={'Average'}
width="flex"
diff --git a/packages/desktop-client/src/components/reports/ReportTableList.tsx b/packages/desktop-client/src/components/reports/ReportTableList.tsx
index 216e6fef49..d789834dba 100644
--- a/packages/desktop-client/src/components/reports/ReportTableList.tsx
+++ b/packages/desktop-client/src/components/reports/ReportTableList.tsx
@@ -6,7 +6,7 @@ import {
integerToCurrency,
} from 'loot-core/src/shared/util';
-import { theme } from '../../style';
+import { styles, theme } from '../../style';
import View from '../common/View';
import { Row, Cell } from '../table';
@@ -51,6 +51,7 @@ const TableRow = memo(
title={item[groupByItem].length > 12 && item[groupByItem]}
style={{
minWidth: 125,
+ ...styles.tnum,
}}
/>
{item.monthData && mode === 'time'
@@ -59,6 +60,7 @@ const TableRow = memo(
<Cell
style={{
minWidth: 85,
+ ...styles.tnum,
}}
key={amountToCurrency(month[balanceTypeOp])}
value={amountToCurrency(month[balanceTypeOp])}
@@ -82,6 +84,7 @@ const TableRow = memo(
width="flex"
style={{
minWidth: 85,
+ ...styles.tnum,
}}
/>
<Cell
@@ -93,6 +96,7 @@ const TableRow = memo(
width="flex"
style={{
minWidth: 85,
+ ...styles.tnum,
}}
/>
</>
@@ -106,6 +110,7 @@ const TableRow = memo(
style={{
fontWeight: 600,
minWidth: 85,
+ ...styles.tnum,
}}
width="flex"
privacyFilter
@@ -119,6 +124,7 @@ const TableRow = memo(
style={{
fontWeight: 600,
minWidth: 85,
+ ...styles.tnum,
}}
width="flex"
privacyFilter
diff --git a/packages/desktop-client/src/components/reports/ReportTableTotals.tsx b/packages/desktop-client/src/components/reports/ReportTableTotals.tsx
index 5f37740a9c..1286a7f87d 100644
--- a/packages/desktop-client/src/components/reports/ReportTableTotals.tsx
+++ b/packages/desktop-client/src/components/reports/ReportTableTotals.tsx
@@ -6,7 +6,7 @@ import {
integerToCurrency,
} from 'loot-core/src/shared/util';
-import { theme } from '../../style';
+import { styles, theme } from '../../style';
import { Row, Cell } from '../table';
export default function ReportTableTotals({
@@ -29,6 +29,7 @@ export default function ReportTableTotals({
<Cell
style={{
minWidth: 125,
+ ...styles.tnum,
}}
value={'Totals'}
width="flex"
@@ -39,6 +40,7 @@ export default function ReportTableTotals({
<Cell
style={{
minWidth: 85,
+ ...styles.tnum,
}}
key={amountToCurrency(item[balanceTypeOp])}
value={amountToCurrency(item[balanceTypeOp])}
@@ -56,6 +58,7 @@ export default function ReportTableTotals({
<Cell
style={{
minWidth: 85,
+ ...styles.tnum,
}}
value={amountToCurrency(data.totalAssets)}
title={
@@ -67,6 +70,7 @@ export default function ReportTableTotals({
<Cell
style={{
minWidth: 85,
+ ...styles.tnum,
}}
value={amountToCurrency(data.totalDebts)}
title={
@@ -80,6 +84,7 @@ export default function ReportTableTotals({
<Cell
style={{
minWidth: 85,
+ ...styles.tnum,
}}
value={amountToCurrency(data[balanceTypeOp])}
title={
@@ -92,6 +97,7 @@ export default function ReportTableTotals({
<Cell
style={{
minWidth: 85,
+ ...styles.tnum,
}}
value={integerToCurrency(Math.round(average))}
title={
diff --git a/packages/desktop-client/src/components/reports/ReportTopbar.js b/packages/desktop-client/src/components/reports/ReportTopbar.js
index 9f675a347b..61abf5de09 100644
--- a/packages/desktop-client/src/components/reports/ReportTopbar.js
+++ b/packages/desktop-client/src/components/reports/ReportTopbar.js
@@ -8,31 +8,12 @@ import ListBullet from '../../icons/v1/ListBullet';
import Queue from '../../icons/v1/Queue';
import Tag from '../../icons/v1/Tag';
import { theme } from '../../style';
-import Button from '../common/Button';
import View from '../common/View';
import { FilterButton } from '../filters/FiltersMenu';
+import GraphButton from './GraphButton';
import { SaveReportMenuButton } from './SaveReport';
-function GraphButton({ selected, children, style, onSelect, title, disabled }) {
- return (
- <Button
- type="bare"
- style={{
- ...(selected && {
- backgroundColor: theme.buttonBareBackgroundHover,
- }),
- ...style,
- }}
- onClick={onSelect}
- title={title}
- disabled={disabled}
- >
- {children}
- </Button>
- );
-}
-
export function ReportTopbar({
graphType,
setGraphType,
@@ -67,6 +48,7 @@ export function ReportTopbar({
//setViewLegend(false);
setTypeDisabled([]);
}}
+ style={{ marginRight: 15 }}
>
<Queue width={15} height={15} />
</GraphButton>
@@ -86,7 +68,7 @@ export function ReportTopbar({
setBalanceType('Expense');
}
}}
- style={{ marginLeft: 15 }}
+ style={{ marginRight: 15 }}
>
<ChartBar width={15} height={15} />
</GraphButton>
@@ -99,7 +81,7 @@ export function ReportTopbar({
//setViewLegend(false);
setTypeDisabled([]);
}}
- style={{ marginLeft: 15 }}
+ style={{ marginRight: 15 }}
disabled={mode === 'total' ? false : true}
>
<Chart width={15} height={15} />
@@ -112,7 +94,7 @@ export function ReportTopbar({
setTypeDisabled(['Net']);
setBalanceType('Expense');
}}
- style={{ marginLeft: 15 }}
+ style={{ marginRight: 15 }}
disabled={mode === 'total' ? false : true}
>
<ChartPie width={15} height={15} />
@@ -121,8 +103,8 @@ export function ReportTopbar({
style={{
width: 1,
height: 30,
- backgroundColor: theme.altPillBorder,
- marginLeft: 15,
+ backgroundColor: theme.pillBorderDark,
+ marginRight: 15,
flexShrink: 0,
}}
/>
@@ -131,7 +113,7 @@ export function ReportTopbar({
onSelect={() => {
setViewLegend(!viewLegend);
}}
- style={{ marginLeft: 15 }}
+ style={{ marginRight: 15 }}
title="Show Legend"
disabled={
true //descoping for future PR
@@ -145,7 +127,7 @@ export function ReportTopbar({
onSelect={() => {
setViewSummary(!viewSummary);
}}
- style={{ marginLeft: 15 }}
+ style={{ marginRight: 15 }}
title="Show Summary"
>
<Calculator width={15} height={15} />
@@ -155,7 +137,7 @@ export function ReportTopbar({
onSelect={() => {
setViewLabels(!viewLabels);
}}
- style={{ marginLeft: 15 }}
+ style={{ marginRight: 15 }}
title="Show labels"
disabled={true}
>
@@ -165,13 +147,12 @@ export function ReportTopbar({
style={{
width: 1,
height: 30,
- backgroundColor: theme.altPillBorder,
+ backgroundColor: theme.pillBorderDark,
marginRight: 15,
- marginLeft: 15,
flexShrink: 0,
}}
/>
- <FilterButton onApply={onApplyFilter} type="reports" />
+ <FilterButton onApply={onApplyFilter} compact hover />
<View style={{ flex: 1 }} />
<SaveReportMenuButton />
</View>
diff --git a/packages/desktop-client/src/components/reports/getCustomTick.ts b/packages/desktop-client/src/components/reports/getCustomTick.ts
new file mode 100644
index 0000000000..07ab8f777b
--- /dev/null
+++ b/packages/desktop-client/src/components/reports/getCustomTick.ts
@@ -0,0 +1,9 @@
+const getCustomTick = (value: string, isPrivacyModeEnabled: boolean) => {
+ if (isPrivacyModeEnabled) {
+ return '...';
+ } else {
+ return value;
+ }
+};
+
+export default getCustomTick;
diff --git a/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx b/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx
index 174e649f1c..2370d57d0f 100644
--- a/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx
@@ -11,6 +11,7 @@ import {
ResponsiveContainer,
} from 'recharts';
+import usePrivacyMode from 'loot-core/src/client/privacy';
import { amountToCurrency } from 'loot-core/src/shared/util';
import { theme } from '../../../style';
@@ -94,14 +95,14 @@ type AreaGraphProps = {
data;
balanceTypeOp;
compact: boolean;
- domain?: {
- totalTotals?: [number, number];
- };
};
function AreaGraph({ style, data, balanceTypeOp, compact }: AreaGraphProps) {
+ let privacyMode = usePrivacyMode();
+
const tickFormatter = tick => {
- return `${Math.round(tick).toLocaleString()}`; // Formats the tick values as strings with commas
+ if (!privacyMode) return `${Math.round(tick).toLocaleString()}`; // Formats the tick values as strings with commas
+ return '...';
};
const gradientOffset = () => {
diff --git a/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx b/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx
index 79f169864a..6fdaf45a21 100644
--- a/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx
@@ -14,6 +14,7 @@ import {
ResponsiveContainer,
} from 'recharts';
+import usePrivacyMode from 'loot-core/src/client/privacy';
import { amountToCurrency } from 'loot-core/src/shared/util';
import { theme } from '../../../style';
@@ -22,6 +23,7 @@ import AlignedText from '../../common/AlignedText';
import PrivacyFilter from '../../PrivacyFilter';
import { getColorScale } from '../chart-theme';
import Container from '../Container';
+import getCustomTick from '../getCustomTick';
import numberFormatterTooltip from '../numberFormatter';
type PayloadChild = {
@@ -32,7 +34,6 @@ type PayloadChild = {
};
type PayloadItem = {
- value: string;
payload: {
name: string;
totalAssets: number | string;
@@ -105,7 +106,6 @@ const CustomTooltip = ({
);
}
};
-
/* Descoped for future PR
type CustomLegendProps = {
active?: boolean;
@@ -148,6 +148,8 @@ function BarGraph({
compact,
domain,
}: BarGraphProps) {
+ let privacyMode = usePrivacyMode();
+
const colorScale = getColorScale('qualitative');
const yAxis = ['Month', 'Year'].includes(groupBy) ? 'date' : 'name';
const splitData = ['Month', 'Year'].includes(groupBy) ? 'monthData' : 'data';
@@ -211,6 +213,7 @@ function BarGraph({
)}
{!compact && (
<YAxis
+ tickFormatter={value => getCustomTick(value, privacyMode)}
tick={{ fill: theme.pageText }}
tickLine={{ stroke: theme.pageText }}
/>
diff --git a/packages/desktop-client/src/components/reports/graphs/StackedBarGraph.tsx b/packages/desktop-client/src/components/reports/graphs/StackedBarGraph.tsx
index 228798f708..f0925ab9a1 100644
--- a/packages/desktop-client/src/components/reports/graphs/StackedBarGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/StackedBarGraph.tsx
@@ -12,6 +12,7 @@ import {
ResponsiveContainer,
} from 'recharts';
+import usePrivacyMode from 'loot-core/src/client/privacy';
import { amountToCurrency } from 'loot-core/src/shared/util';
import { theme } from '../../../style';
@@ -20,6 +21,7 @@ import AlignedText from '../../common/AlignedText';
import PrivacyFilter from '../../PrivacyFilter';
import { getColorScale } from '../chart-theme';
import Container from '../Container';
+import getCustomTick from '../getCustomTick';
import numberFormatterTooltip from '../numberFormatter';
type PayloadItem = {
@@ -116,28 +118,12 @@ type StackedBarGraphProps = {
data;
balanceTypeOp;
compact: boolean;
- domain?: {
- y?: [number, number];
- };
};
-function StackedBarGraph({
- style,
- data,
- balanceTypeOp,
- compact,
- domain,
-}: StackedBarGraphProps) {
+function StackedBarGraph({ style, data, compact }: StackedBarGraphProps) {
+ let privacyMode = usePrivacyMode();
const colorScale = getColorScale('qualitative');
- const getVal = (obj, key) => {
- if (balanceTypeOp === 'totalDebts') {
- return -1 * obj[key].amount;
- } else {
- return obj[key].amount;
- }
- };
-
return (
<Container
style={{
@@ -172,22 +158,19 @@ function StackedBarGraph({
/>
{!compact && (
<YAxis
+ tickFormatter={value => getCustomTick(value, privacyMode)}
tick={{ fill: theme.pageText }}
tickLine={{ stroke: theme.pageText }}
/>
)}
- {data.groupBy
- .slice(0)
- .reverse()
- .map((c, index) => (
- <Bar
- key={c.id}
- dataKey={val => getVal(val, c.name)}
- name={c.name}
- stackId="a"
- fill={colorScale[index % colorScale.length]}
- />
- ))}
+ {data.groupBy.reverse().map((c, index) => (
+ <Bar
+ key={c.date}
+ dataKey={c.name}
+ stackId="a"
+ fill={colorScale[index % colorScale.length]}
+ />
+ ))}
</BarChart>
</div>
</ResponsiveContainer>
diff --git a/packages/desktop-client/src/components/reports/reports/CashFlowCard.js b/packages/desktop-client/src/components/reports/reports/CashFlowCard.js
index 1ccf6dfc65..bc752f4bbf 100644
--- a/packages/desktop-client/src/components/reports/reports/CashFlowCard.js
+++ b/packages/desktop-client/src/components/reports/reports/CashFlowCard.js
@@ -13,7 +13,7 @@ import Change from '../Change';
import { chartTheme } from '../chart-theme';
import Container from '../Container';
import DateRange from '../DateRange';
-import { LoadingIndicator } from '../Overview';
+import LoadingIndicator from '../LoadingIndicator';
import ReportCard from '../ReportCard';
import { simpleCashFlow } from '../spreadsheets/cash-flow-spreadsheet';
import Tooltip from '../Tooltip';
@@ -56,7 +56,7 @@ function CashFlowCard() {
<PrivacyFilter activationFilters={[!isCardHovered]}>
<Change
amount={income - expense}
- style={{ color: theme.altTableText, fontWeight: 300 }}
+ style={{ color: theme.tableText, fontWeight: 300 }}
/>
</PrivacyFilter>
</View>
diff --git a/packages/desktop-client/src/components/reports/reports/CategorySpendingCard.js b/packages/desktop-client/src/components/reports/reports/CategorySpendingCard.js
index 1b4742c182..2a705305d9 100644
--- a/packages/desktop-client/src/components/reports/reports/CategorySpendingCard.js
+++ b/packages/desktop-client/src/components/reports/reports/CategorySpendingCard.js
@@ -8,7 +8,7 @@ import Block from '../../common/Block';
import View from '../../common/View';
import DateRange from '../DateRange';
import CategorySpendingGraph from '../graphs/CategorySpendingGraph';
-import { LoadingIndicator } from '../Overview';
+import LoadingIndicator from '../LoadingIndicator';
import ReportCard from '../ReportCard';
import categorySpendingSpreadsheet from '../spreadsheets/category-spending-spreadsheet';
import useReport from '../useReport';
diff --git a/packages/desktop-client/src/components/reports/reports/CustomReport.js b/packages/desktop-client/src/components/reports/reports/CustomReport.js
index 8aeb682c95..a2b43f8184 100644
--- a/packages/desktop-client/src/components/reports/reports/CustomReport.js
+++ b/packages/desktop-client/src/components/reports/reports/CustomReport.js
@@ -1,8 +1,9 @@
import React, { useState, useEffect, useMemo } from 'react';
-import { useSelector } from 'react-redux';
import * as d from 'date-fns';
+import { useCachedAccounts } from 'loot-core/src/client/data-hooks/accounts';
+import { useCachedPayees } from 'loot-core/src/client/data-hooks/payees';
import { send } from 'loot-core/src/platform/client/fetch';
import * as monthUtils from 'loot-core/src/shared/months';
import { amountToCurrency } from 'loot-core/src/shared/util';
@@ -18,6 +19,7 @@ import { AppliedFilters } from '../../filters/FiltersMenu';
import PrivacyFilter from '../../PrivacyFilter';
import { ChooseGraph } from '../ChooseGraph';
import Header from '../Header';
+import LoadingIndicator from '../LoadingIndicator';
import { ReportOptions } from '../ReportOptions';
import { ReportSidebar } from '../ReportSidebar';
import { ReportLegend, ReportSummary } from '../ReportSummary';
@@ -29,13 +31,6 @@ import { fromDateRepr } from '../util';
export default function CustomReport() {
const categories = useCategories();
- let { payees, accounts } = useSelector(state => {
- return {
- payees: state.queries.payees,
- accounts: state.queries.accounts,
- };
- });
-
const {
filters,
conditionsOp,
@@ -60,6 +55,7 @@ export default function CustomReport() {
const [hidden, setHidden] = useState(false);
const [uncat, setUncat] = useState(false);
const [dateRange, setDateRange] = useState('6 months');
+ const [dataCheck, setDataCheck] = useState(false);
const [graphType, setGraphType] = useState('BarGraph');
const [viewLegend, setViewLegend] = useState(false);
@@ -67,39 +63,8 @@ export default function CustomReport() {
const [viewLabels, setViewLabels] = useState(false);
//const [legend, setLegend] = useState([]);
let legend = [];
- const dateRangeLine = ReportOptions.dateRange.length - 1;
-
+ const dateRangeLine = ReportOptions.dateRange.length - 3;
const months = monthUtils.rangeInclusive(start, end);
- const getGraphData = useMemo(() => {
- return defaultSpreadsheet(
- start,
- end,
- groupBy,
- ReportOptions.balanceTypeMap.get(balanceType),
- categories,
- selectedCategories,
- payees,
- accounts,
- filters,
- conditionsOp,
- hidden,
- uncat,
- );
- }, [
- start,
- end,
- groupBy,
- balanceType,
- categories,
- selectedCategories,
- payees,
- accounts,
- filters,
- conditionsOp,
- hidden,
- uncat,
- ]);
- const data = useReport('default', getGraphData);
useEffect(() => {
if (selectedCategories === null && categories.list.length !== 0) {
@@ -136,6 +101,42 @@ export default function CustomReport() {
run();
}, []);
+ let payees = useCachedPayees();
+ let accounts = useCachedAccounts();
+
+ const getGraphData = useMemo(() => {
+ setDataCheck(false);
+ return defaultSpreadsheet(
+ start,
+ end,
+ groupBy,
+ ReportOptions.balanceTypeMap.get(balanceType),
+ categories,
+ selectedCategories,
+ payees,
+ accounts,
+ filters,
+ conditionsOp,
+ hidden,
+ uncat,
+ setDataCheck,
+ );
+ }, [
+ start,
+ end,
+ groupBy,
+ balanceType,
+ categories,
+ selectedCategories,
+ payees,
+ accounts,
+ filters,
+ conditionsOp,
+ hidden,
+ uncat,
+ ]);
+ const data = useReport('default', getGraphData);
+
let [scrollWidth, setScrollWidth] = useState(0);
if (!allMonths || !data) {
@@ -149,12 +150,7 @@ export default function CustomReport() {
return (
<View style={{ ...styles.page, minWidth: 650, overflow: 'hidden' }}>
- <Header
- title="Custom Reports"
- allMonths={allMonths}
- start={start}
- end={end}
- />
+ <Header title="Custom Reports" />
<View
style={{
display: 'flex',
@@ -287,19 +283,24 @@ export default function CustomReport() {
</View>
</View>
)}
- <ChooseGraph
- start={start}
- end={end}
- data={data}
- mode={mode}
- graphType={graphType}
- balanceType={balanceType}
- groupBy={groupBy}
- empty={empty}
- scrollWidth={scrollWidth}
- setScrollWidth={setScrollWidth}
- months={months}
- />
+
+ {dataCheck ? (
+ <ChooseGraph
+ start={start}
+ end={end}
+ data={data}
+ mode={mode}
+ graphType={graphType}
+ balanceType={balanceType}
+ groupBy={groupBy}
+ empty={empty}
+ scrollWidth={scrollWidth}
+ setScrollWidth={setScrollWidth}
+ months={months}
+ />
+ ) : (
+ <LoadingIndicator message={'Loading report...'} />
+ )}
</View>
{(viewLegend || viewSummary) && (
<View
diff --git a/packages/desktop-client/src/components/reports/reports/CustomReportCard.js b/packages/desktop-client/src/components/reports/reports/CustomReportCard.js
index 1dd43b0b92..6ad6a7c4a2 100644
--- a/packages/desktop-client/src/components/reports/reports/CustomReportCard.js
+++ b/packages/desktop-client/src/components/reports/reports/CustomReportCard.js
@@ -8,7 +8,7 @@ import Block from '../../common/Block';
import View from '../../common/View';
import DateRange from '../DateRange';
import BarGraph from '../graphs/BarGraph';
-import { LoadingIndicator } from '../Overview';
+import LoadingIndicator from '../LoadingIndicator';
import ReportCard from '../ReportCard';
import defaultSpreadsheet from '../spreadsheets/default-spreadsheet';
import useReport from '../useReport';
diff --git a/packages/desktop-client/src/components/reports/reports/NetWorthCard.js b/packages/desktop-client/src/components/reports/reports/NetWorthCard.js
index 060636e0a7..1c1f74ee6b 100644
--- a/packages/desktop-client/src/components/reports/reports/NetWorthCard.js
+++ b/packages/desktop-client/src/components/reports/reports/NetWorthCard.js
@@ -10,7 +10,7 @@ import PrivacyFilter from '../../PrivacyFilter';
import Change from '../Change';
import DateRange from '../DateRange';
import NetWorthGraph from '../graphs/NetWorthGraph';
-import { LoadingIndicator } from '../Overview';
+import LoadingIndicator from '../LoadingIndicator';
import ReportCard from '../ReportCard';
import netWorthSpreadsheet from '../spreadsheets/net-worth-spreadsheet';
import useReport from '../useReport';
@@ -61,7 +61,7 @@ function NetWorthCard({ accounts }) {
<PrivacyFilter activationFilters={[!isCardHovered]}>
<Change
amount={data.totalChange}
- style={{ color: theme.altTableText, fontWeight: 300 }}
+ style={{ color: theme.tableText, fontWeight: 300 }}
/>
</PrivacyFilter>
</View>
diff --git a/packages/desktop-client/src/components/reports/reports/SankeyCard.js b/packages/desktop-client/src/components/reports/reports/SankeyCard.js
index 1732311dbf..f79ec22726 100644
--- a/packages/desktop-client/src/components/reports/reports/SankeyCard.js
+++ b/packages/desktop-client/src/components/reports/reports/SankeyCard.js
@@ -8,7 +8,7 @@ import Block from '../../common/Block';
import View from '../../common/View';
import DateRange from '../DateRange';
import SankeyGraph from '../graphs/SankeyGraph';
-import { LoadingIndicator } from '../Overview';
+import LoadingIndicator from '../LoadingIndicator';
import ReportCard from '../ReportCard';
import sankeySpreadsheet from '../spreadsheets/sankey-spreadsheet';
import useReport from '../useReport';
diff --git a/packages/desktop-client/src/components/reports/spreadsheets/default-spreadsheet.tsx b/packages/desktop-client/src/components/reports/spreadsheets/default-spreadsheet.tsx
index 5e20982ce5..b55a7b71bd 100644
--- a/packages/desktop-client/src/components/reports/spreadsheets/default-spreadsheet.tsx
+++ b/packages/desktop-client/src/components/reports/spreadsheets/default-spreadsheet.tsx
@@ -5,13 +5,13 @@ import { send } from 'loot-core/src/platform/client/fetch';
import * as monthUtils from 'loot-core/src/shared/months';
import { integerToAmount, amountToInteger } from 'loot-core/src/shared/util';
-import { index } from '../util';
+import { index, indexStack } from '../util';
export default function createSpreadsheet(
start,
end,
groupBy,
- typeItem,
+ balanceTypeOp,
categories,
selectedCategories,
payees,
@@ -20,6 +20,7 @@ export default function createSpreadsheet(
conditionsOp,
hidden,
uncat,
+ setDataCheck,
) {
let uncatCat = {
name: 'Uncategorized',
@@ -282,8 +283,9 @@ export default function createSpreadsheet(
};
});
- const categoryGroupCalcData = catGroup.map(group => {
- if (hidden || group.hidden === 0) {
+ const categoryGroupCalcData = catGroup
+ .filter(f => hidden || f.hidden === 0)
+ .map(group => {
let groupedStarting = 0;
const mon = months.map(month => {
let groupedAssets = 0;
@@ -317,10 +319,7 @@ export default function createSpreadsheet(
hidden: group.hidden,
balances: index(mon, 'date'),
};
- } else {
- return null;
- }
- });
+ });
const groupByData = groupBy === 'Group' ? categoryGroupCalcData : calcData;
@@ -329,35 +328,37 @@ export default function createSpreadsheet(
return { ...calc };
});
- const categoryGroupData = catGroup.map(group => {
- const catData = group.categories.map(graph => {
- let catMatch = null;
- calcData.map(cat => {
- if (
- cat.id === null
- ? cat.uncat_id === graph.uncat_id
- : cat.id === graph.id
- ) {
- catMatch = cat;
+ const categoryGroupData = catGroup
+ .filter(f => hidden || f.hidden === 0)
+ .map(group => {
+ const catData = group.categories.map(graph => {
+ let catMatch = null;
+ calcData.map(cat => {
+ if (
+ cat.id === null
+ ? cat.uncat_id === graph.uncat_id
+ : cat.id === graph.id
+ ) {
+ catMatch = cat;
+ }
+ return null;
+ });
+ const calcCat = catMatch && recalculate(catMatch, start, end);
+ return { ...calcCat };
+ });
+ let groupMatch = null;
+ categoryGroupCalcData.map(split => {
+ if (split.id === group.id) {
+ groupMatch = split;
}
return null;
});
- const calcCat = catMatch && recalculate(catMatch, start, end);
- return { ...calcCat };
- });
- let groupMatch = null;
- categoryGroupCalcData.map(split => {
- if (split.id === group.id) {
- groupMatch = split;
- }
- return null;
+ const calcGroup = groupMatch && recalculate(groupMatch, start, end);
+ return {
+ ...calcGroup,
+ categories: catData,
+ };
});
- const calcGroup = groupMatch && recalculate(groupMatch, start, end);
- return {
- ...calcGroup,
- categories: catData,
- };
- });
let totalAssets = 0;
let totalDebts = 0;
@@ -393,26 +394,27 @@ export default function createSpreadsheet(
});
const stackedData = months.map(month => {
- let perMonthAmounts = 0;
const stacked = data.map(graph => {
let stackAmounts = 0;
if (graph.indexedMonthData[month]) {
- perMonthAmounts += graph.indexedMonthData[month][typeItem];
- stackAmounts += graph.indexedMonthData[month][typeItem];
+ stackAmounts += graph.indexedMonthData[month][balanceTypeOp];
}
return {
name: graph.name,
id: graph.id,
- amount: stackAmounts,
+ amount: Math.abs(stackAmounts),
};
});
- const indexedStack = index(stacked, 'name');
+ const indexedStack = indexStack(
+ stacked.filter(i => i[balanceTypeOp] !== 0),
+ 'name',
+ 'amount',
+ );
return {
// eslint-disable-next-line rulesdir/typography
date: d.format(d.parseISO(`${month}-01`), "MMM ''yy"),
...indexedStack,
- totalTotals: perMonthAmounts,
};
});
@@ -428,6 +430,7 @@ export default function createSpreadsheet(
totalAssets: integerToAmount(totalAssets),
totalTotals: integerToAmount(totalTotals),
});
+ setDataCheck?.(true);
};
}
diff --git a/packages/desktop-client/src/components/reports/util.js b/packages/desktop-client/src/components/reports/util.js
index 1cae0b43d3..b3cb72c85a 100644
--- a/packages/desktop-client/src/components/reports/util.js
+++ b/packages/desktop-client/src/components/reports/util.js
@@ -21,6 +21,14 @@ export function index(data, field, mapper) {
return result;
}
+export function indexStack(data, fieldName, field) {
+ const result = {};
+ data.forEach(item => {
+ result[item[fieldName]] = item[field];
+ });
+ return result;
+}
+
export function indexCashFlow(data, date, isTransfer) {
const results = {};
data.forEach(item => {
diff --git a/packages/desktop-client/src/icons/v2/CheckAll.tsx b/packages/desktop-client/src/icons/v2/CheckAll.tsx
new file mode 100644
index 0000000000..69d0dc0796
--- /dev/null
+++ b/packages/desktop-client/src/icons/v2/CheckAll.tsx
@@ -0,0 +1,19 @@
+import * as React from 'react';
+import type { SVGProps } from 'react';
+const SvgCheckAll = (props: SVGProps<SVGSVGElement>) => (
+ <svg
+ {...props}
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 26 26"
+ style={{
+ color: 'inherit',
+ ...props.style,
+ }}
+ >
+ <path
+ d="M 5 0 C 2.2545455 0 0 2.2545455 0 5 L 0 17 C 0 19.745455 2.2545455 22 5 22 L 17 22 C 19.745455 22 22 19.745455 22 17 L 22 5 C 22 2.2545455 19.745455 0 17 0 L 5 0 z M 5 2 L 17 2 C 18.654545 2 20 3.3454545 20 5 L 20 17 C 20 18.654545 18.654545 20 17 20 L 5 20 C 3.3454545 20 2 18.654545 2 17 L 2 5 C 2 3.3454545 3.3454545 2 5 2 z M 24 5.0253906 L 24 21 C 24 22.654 22.654 24 21 24 L 5.0253906 24 C 5.9383906 25.207 7.373 26 9 26 L 21 26 C 23.757 26 26 23.757 26 21 L 26 9 C 26 7.373 25.207 5.9383906 24 5.0253906 z M 15.173828 6.0058594 C 15.047953 6.0288594 14.932016 6.1013437 14.853516 6.2148438 L 10.072266 13.306641 L 7.9121094 11.146484 C 7.7171094 10.951484 7.4000781 10.951484 7.2050781 11.146484 L 6.1464844 12.207031 C 5.9514844 12.402031 5.9514844 12.719062 6.1464844 12.914062 L 9.3652344 16.134766 C 9.6012344 16.369766 9.92 16.5 10.25 16.5 C 10.287 16.5 10.324328 16.498141 10.361328 16.494141 C 10.730328 16.460141 11.067344 16.265937 11.277344 15.960938 L 16.910156 7.6347656 C 17.067156 7.4077656 17.010203 7.0964531 16.783203 6.9394531 L 15.548828 6.0878906 C 15.434828 6.0093906 15.299703 5.9828594 15.173828 6.0058594 z"
+ fill="currentColor"
+ />
+ </svg>
+);
+export default SvgCheckAll;
diff --git a/packages/desktop-client/src/icons/v2/UncheckAll.tsx b/packages/desktop-client/src/icons/v2/UncheckAll.tsx
new file mode 100644
index 0000000000..13698bbea4
--- /dev/null
+++ b/packages/desktop-client/src/icons/v2/UncheckAll.tsx
@@ -0,0 +1,19 @@
+import * as React from 'react';
+import type { SVGProps } from 'react';
+const SvgUncheckAll = (props: SVGProps<SVGSVGElement>) => (
+ <svg
+ {...props}
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 26 26"
+ style={{
+ color: 'inherit',
+ ...props.style,
+ }}
+ >
+ <path
+ d="M 5 0 C 2.2545455 0 0 2.2545455 0 5 L 0 17 C 0 19.745455 2.2545455 22 5 22 L 17 22 C 19.745455 22 22 19.745455 22 17 L 22 5 C 22 2.2545455 19.745455 0 17 0 L 5 0 z M 5 2 L 17 2 C 18.654545 2 20 3.3454545 20 5 L 20 17 C 20 18.654545 18.654545 20 17 20 L 5 20 C 3.3454545 20 2 18.654545 2 17 L 2 5 C 2 3.3454545 3.3454545 2 5 2 z M 24 5.0253906 L 24 21 C 24 22.654 22.654 24 21 24 L 5.0253906 24 C 5.9383906 25.207 7.373 26 9 26 L 21 26 C 23.757 26 26 23.757 26 21 L 26 9 C 26 7.373 25.207 5.9383906 24 5.0253906 z"
+ fill="currentColor"
+ />
+ </svg>
+);
+export default SvgUncheckAll;
diff --git a/packages/desktop-client/src/icons/v2/check-all.svg b/packages/desktop-client/src/icons/v2/check-all.svg
new file mode 100644
index 0000000000..25f62f457b
--- /dev/null
+++ b/packages/desktop-client/src/icons/v2/check-all.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" >
+<g>
+<path d="M 5 0 C 2.2545455 0 0 2.2545455 0 5 L 0 17 C 0 19.745455 2.2545455 22 5 22 L 17 22 C 19.745455 22 22 19.745455 22 17 L 22 5 C 22 2.2545455 19.745455 0 17 0 L 5 0 z M 5 2 L 17 2 C 18.654545 2 20 3.3454545 20 5 L 20 17 C 20 18.654545 18.654545 20 17 20 L 5 20 C 3.3454545 20 2 18.654545 2 17 L 2 5 C 2 3.3454545 3.3454545 2 5 2 z M 24 5.0253906 L 24 21 C 24 22.654 22.654 24 21 24 L 5.0253906 24 C 5.9383906 25.207 7.373 26 9 26 L 21 26 C 23.757 26 26 23.757 26 21 L 26 9 C 26 7.373 25.207 5.9383906 24 5.0253906 z M 15.173828 6.0058594 C 15.047953 6.0288594 14.932016 6.1013437 14.853516 6.2148438 L 10.072266 13.306641 L 7.9121094 11.146484 C 7.7171094 10.951484 7.4000781 10.951484 7.2050781 11.146484 L 6.1464844 12.207031 C 5.9514844 12.402031 5.9514844 12.719062 6.1464844 12.914062 L 9.3652344 16.134766 C 9.6012344 16.369766 9.92 16.5 10.25 16.5 C 10.287 16.5 10.324328 16.498141 10.361328 16.494141 C 10.730328 16.460141 11.067344 16.265937 11.277344 15.960938 L 16.910156 7.6347656 C 17.067156 7.4077656 17.010203 7.0964531 16.783203 6.9394531 L 15.548828 6.0878906 C 15.434828 6.0093906 15.299703 5.9828594 15.173828 6.0058594 z"/>
+</g>
+</svg>
diff --git a/packages/desktop-client/src/icons/v2/index.ts b/packages/desktop-client/src/icons/v2/index.ts
index c1455d4cdc..a27e73a12f 100644
--- a/packages/desktop-client/src/icons/v2/index.ts
+++ b/packages/desktop-client/src/icons/v2/index.ts
@@ -8,6 +8,7 @@ export { default as ArrowsShrink3 } from './ArrowsShrink3';
export { default as ArrowsSynchronize } from './ArrowsSynchronize';
export { default as Calendar3 } from './Calendar3';
export { default as Calendar } from './Calendar';
+export { default as CheckAll } from './CheckAll';
export { default as CheckCircle1 } from './CheckCircle1';
export { default as CheckCircleHollow } from './CheckCircleHollow';
export { default as Check } from './Check';
@@ -37,6 +38,7 @@ export { default as SearchAlternate } from './SearchAlternate';
export { default as SettingsSliderAlternate } from './SettingsSliderAlternate';
export { default as Subtract } from './Subtract';
export { default as Sun } from './Sun';
+export { default as UncheckAll } from './UncheckAll';
export { default as UploadThickBottom } from './UploadThickBottom';
export { default as ValidationCheck } from './ValidationCheck';
export { default as ViewHide } from './ViewHide';
diff --git a/packages/desktop-client/src/icons/v2/uncheck-all.svg b/packages/desktop-client/src/icons/v2/uncheck-all.svg
new file mode 100644
index 0000000000..b11cab4cc7
--- /dev/null
+++ b/packages/desktop-client/src/icons/v2/uncheck-all.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" >
+<g>
+<path d="M 5 0 C 2.2545455 0 0 2.2545455 0 5 L 0 17 C 0 19.745455 2.2545455 22 5 22 L 17 22 C 19.745455 22 22 19.745455 22 17 L 22 5 C 22 2.2545455 19.745455 0 17 0 L 5 0 z M 5 2 L 17 2 C 18.654545 2 20 3.3454545 20 5 L 20 17 C 20 18.654545 18.654545 20 17 20 L 5 20 C 3.3454545 20 2 18.654545 2 17 L 2 5 C 2 3.3454545 3.3454545 2 5 2 z M 24 5.0253906 L 24 21 C 24 22.654 22.654 24 21 24 L 5.0253906 24 C 5.9383906 25.207 7.373 26 9 26 L 21 26 C 23.757 26 26 23.757 26 21 L 26 9 C 26 7.373 25.207 5.9383906 24 5.0253906 z"/>
+</g>
+</svg>
\ No newline at end of file
diff --git a/packages/desktop-client/src/style/themes/dark.ts b/packages/desktop-client/src/style/themes/dark.ts
index c1808b6967..071f0a28d2 100644
--- a/packages/desktop-client/src/style/themes/dark.ts
+++ b/packages/desktop-client/src/style/themes/dark.ts
@@ -10,7 +10,7 @@ export const pageBackgroundLineBottom = colorPalette.navy150;
export const pageText = colorPalette.navy150;
export const pageTextLight = colorPalette.navy300;
export const pageTextSubdued = colorPalette.navy500;
-export const pageTextDark = colorPalette.navy800;
+export const pageTextDark = colorPalette.navy100;
export const pageTextPositive = colorPalette.purple200;
export const pageTextLink = colorPalette.purple400;
export const pageTextLinkLight = colorPalette.purple200;
diff --git a/packages/loot-core/src/shared/months.ts b/packages/loot-core/src/shared/months.ts
index c87d8694d6..d314391a82 100644
--- a/packages/loot-core/src/shared/months.ts
+++ b/packages/loot-core/src/shared/months.ts
@@ -118,6 +118,10 @@ export function nextMonth(month: DateLike): string {
return d.format(d.addMonths(_parse(month), 1), 'yyyy-MM');
}
+export function prevYear(month: DateLike): string {
+ return d.format(d.subMonths(_parse(month), 12), 'yyyy-MM');
+}
+
export function prevMonth(month: DateLike): string {
return d.format(d.subMonths(_parse(month), 1), 'yyyy-MM');
}
diff --git a/upcoming-release-notes/1930.md b/upcoming-release-notes/1930.md
new file mode 100644
index 0000000000..5ecd2fc472
--- /dev/null
+++ b/upcoming-release-notes/1930.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [carkom]
+---
+
+Bug fixes for custom reports.