Skip to content

Commit

Permalink
Merge branch 'master' into goal-template-apply
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreptschar authored Oct 29, 2024
2 parents 2459aaf + 59835a3 commit c50e039
Show file tree
Hide file tree
Showing 62 changed files with 113 additions and 22 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ function CategoryList({
<View>
<View
style={{
overflow: 'auto',
overflowY: 'auto',
willChange: 'transform',
padding: '5px 0',
...(!embedded && { maxHeight: 175 }),
}}
Expand Down
12 changes: 11 additions & 1 deletion packages/desktop-client/src/components/common/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { useModalState } from '../../hooks/useModalState';
import { AnimatedLoading } from '../../icons/AnimatedLoading';
import { SvgLogo } from '../../icons/logo';
import { SvgDelete } from '../../icons/v0';
import { useResponsive } from '../../ResponsiveProvider';
import { styles, theme } from '../../style';
import { tokens } from '../../tokens';

Expand Down Expand Up @@ -52,6 +53,7 @@ export const Modal = ({
containerProps,
...props
}: ModalProps) => {
const { isNarrowWidth } = useResponsive();
const { enableScope, disableScope } = useHotkeysContext();

// This deactivates any key handlers in the "app" scope
Expand Down Expand Up @@ -82,7 +84,15 @@ export const Modal = ({
alignItems: 'center',
justifyContent: 'center',
fontSize: 14,
backdropFilter: 'blur(1px) brightness(0.9)',
willChange: 'transform',
// on mobile, we disable the blurred background for performance reasons
...(isNarrowWidth
? {
backgroundColor: 'rgba(0, 0, 0, 0.4)',
}
: {
backdropFilter: 'blur(1px) brightness(0.9)',
}),
...style,
}}
{...props}
Expand Down
6 changes: 4 additions & 2 deletions packages/desktop-client/src/components/reports/DateRange.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React, { type ReactElement } from 'react';

import * as d from 'date-fns';

import * as monthUtils from 'loot-core/src/shared/months';

import { theme } from '../../style';
import { styles } from '../../style/styles';
import { Block } from '../common/Block';
Expand All @@ -14,8 +16,8 @@ type DateRangeProps = {
};

function checkDate(date: string) {
const dateParsed = new Date(date);
if (dateParsed.toString() !== 'Invalid Date') {
const dateParsed = monthUtils.parseDate(date);
if (dateParsed) {
return d.format(dateParsed, 'yyyy-MM-dd');
} else {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ export function createSpendingSpreadsheet({
}
return null;
});
if (month.month >= startDate && month.month < compare) {

if (
month.month >= monthUtils.monthFromDate(startDate) &&
month.month < compare
) {
if (day === '28') {
if (monthUtils.getMonthEnd(intervalItem) === intervalItem) {
averageSum += cumulativeAssets + cumulativeDebts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,7 @@ export function SchedulesTable({
<Field width="flex" name="name">
<Text
style={
schedule.name == null
? { color: theme.buttonNormalDisabledText }
: null
!schedule.name ? { color: theme.buttonNormalDisabledText } : null
}
title={schedule.name ? schedule.name : ''}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export function TransactionList({

const onSave = useCallback(async transaction => {
const changes = updateTransaction(transactionsLatest.current, transaction);
transactionsLatest.current = changes.data;

if (changes.diff.updated.length > 0) {
const dateChanged = !!changes.diff.updated[0].date;
Expand Down
10 changes: 8 additions & 2 deletions packages/loot-core/src/client/actions/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@ export function applyBudgetAction(month, type, args) {
dispatch(addNotification(await send('budget/check-templates')));
break;
case 'apply-goal-template':
await send('budget/apply-goal-template', { month });
dispatch(
addNotification(await send('budget/apply-goal-template', { month })),
);
break;
case 'overwrite-goal-template':
await send('budget/overwrite-goal-template', { month });
dispatch(
addNotification(
await send('budget/overwrite-goal-template', { month }),
),
);
break;
case 'cleanup-goal-template':
dispatch(
Expand Down
4 changes: 4 additions & 0 deletions packages/loot-core/src/server/accounts/rules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,10 @@ describe('Action', () => {
testHelper('{{month "2002-07-25"}}', '7');
testHelper('{{year "2002-07-25"}}', '2002');
testHelper('{{format "2002-07-25" "MM yyyy d"}}', '07 2002 25');
testHelper('{{day undefined}}', '');
testHelper('{{month undefined}}', '');
testHelper('{{year undefined}}', '');
testHelper('{{format undefined undefined}}', '');
});

test('{{debug}} should log the item', () => {
Expand Down
8 changes: 4 additions & 4 deletions packages/loot-core/src/server/accounts/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ function registerHandlebarsHelpers() {
min: mathHelper((a, b) => Math.min(a, b)),
max: mathHelper((a, b) => Math.max(a, b)),
fixed: (a: unknown, digits: unknown) => Number(a).toFixed(Number(digits)),
day: (date: string) => format(date, 'd'),
month: (date: string) => format(date, 'M'),
year: (date: string) => format(date, 'yyyy'),
format: (date: string, f: string) => format(date, f),
day: (date?: string) => date && format(date, 'd'),
month: (date?: string) => date && format(date, 'M'),
year: (date?: string) => date && format(date, 'yyyy'),
format: (date?: string, f?: string) => date && f && format(date, f),
debug: (value: unknown) => {
console.log(value);
},
Expand Down
4 changes: 3 additions & 1 deletion packages/loot-core/src/server/accounts/transaction-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,9 @@ export function conditionsToAQL(conditions, { recurDateBounds = 100 } = {}) {

return {
$and: tagValues.map(v => {
const regex = new RegExp(`(^|\\s)${v}(\\s|$)`);
const regex = new RegExp(
`(^|\\s)${v.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(\\s|$)`,
);
return apply(field, '$regexp', regex.source);
}),
};
Expand Down
23 changes: 16 additions & 7 deletions packages/loot-core/src/server/server-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,22 @@ export function setServer(url: string): void {
// `url` is optional; if not given it will provide the global config
export function getServer(url?: string): ServerConfig | null {
if (url) {
return {
BASE_SERVER: url,
SYNC_SERVER: joinURL(url, '/sync'),
SIGNUP_SERVER: joinURL(url, '/account'),
GOCARDLESS_SERVER: joinURL(url, '/gocardless'),
SIMPLEFIN_SERVER: joinURL(url, '/simplefin'),
};
try {
return {
BASE_SERVER: url,
SYNC_SERVER: joinURL(url, '/sync'),
SIGNUP_SERVER: joinURL(url, '/account'),
GOCARDLESS_SERVER: joinURL(url, '/gocardless'),
SIMPLEFIN_SERVER: joinURL(url, '/simplefin'),
};
} catch (error) {
console.warn(
'Unable to parse server URL - using the global config.',
{ config },
error,
);
return config;
}
}
return config;
}
6 changes: 6 additions & 0 deletions upcoming-release-notes/3343.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [tim-smart]
---

Fix slow scrolling in mobile modals
6 changes: 6 additions & 0 deletions upcoming-release-notes/3721.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [youngcw]
---

Fix template notifications not showing
6 changes: 6 additions & 0 deletions upcoming-release-notes/3723.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [joel-rich]
---

Fix issue with Monthly Spending report not properly averaging previous three months
6 changes: 6 additions & 0 deletions upcoming-release-notes/3725.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [joel-rich]
---

fix Tag filtering crashing app when tag has regex special character
6 changes: 6 additions & 0 deletions upcoming-release-notes/3728.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [lelemm]
---

Fix Distribute button calculates splits one at a time.
6 changes: 6 additions & 0 deletions upcoming-release-notes/3735.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [carkom]
---

Fix parse date in DateRange element which is causing the cards to display the wrong dates.
6 changes: 6 additions & 0 deletions upcoming-release-notes/3736.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [MikesGlitch]
---

Add extra error handling for when an incorrect server URL has been setup
6 changes: 6 additions & 0 deletions upcoming-release-notes/3739.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [aappaapp]
---

Fix "Name" field being in wrong colour in Schedules page
6 changes: 6 additions & 0 deletions upcoming-release-notes/3749.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [UnderKoen]
---

Fix usage of date functions in action rule templating.

0 comments on commit c50e039

Please sign in to comment.