Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ (dashboards) ability to save filters & timeframes on spending widgets #3432

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
6 changes: 6 additions & 0 deletions packages/desktop-client/src/components/reports/DateRange.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ export function DateRange({ start, end, type }: DateRangeProps): ReactElement {
: d.format(endDate, 'MMM yyyy')}
</div>
);
} else if (['budget', 'average'].includes(type || '')) {
content = (
<div>
Compare {d.format(startDate, 'MMM yyyy')} to {type}
</div>
);
} else {
content = d.format(endDate, 'MMMM yyyy');
}
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/reports/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function Header({
flexShrink: 0,
}}
>
{!['/reports/custom', '/reports/spending'].includes(path) && (
{!['/reports/custom'].includes(path) && (
<View
style={{
flexDirection: isNarrowWidth ? 'column' : 'row',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ export function Overview() {
/>
) : item.type === 'spending-card' ? (
<SpendingCard
widgetId={item.i}
isEditing={isEditing}
meta={item.meta}
onMetaChange={newMeta => onMetaChange(item, newMeta)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function ReportRouter() {
<Route path="/cash-flow/:id" element={<CashFlow />} />
<Route path="/custom" element={<CustomReport />} />
<Route path="/spending" element={<Spending />} />
<Route path="/spending/:id" element={<Spending />} />
</Routes>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export function SpendingGraph({
const privacyMode = usePrivacyMode();
const balanceTypeOp = 'cumulative';

const selection = mode === 'singleMonth' ? compareTo : mode;
const selection = mode === 'single-month' ? compareTo : mode;

const thisMonthMax = data.intervalData.reduce((a, b) =>
a.months[compare][balanceTypeOp] < b.months[compare][balanceTypeOp] ? a : b,
Expand Down
Loading
Loading