Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/actualbudget/actual
Browse files Browse the repository at this point in the history
  • Loading branch information
pprimor committed Oct 23, 2024
2 parents f2640c2 + 4d89a9b commit eb54988
Show file tree
Hide file tree
Showing 259 changed files with 2,278 additions and 1,319 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.
2 changes: 1 addition & 1 deletion packages/desktop-client/e2e/reports.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test.describe.parallel('Reports', () => {
test('loads net worth and cash flow reports', async () => {
const reports = await reportsPage.getAvailableReportList();

expect(reports).toEqual(['Net Worth', 'Cash Flow']);
expect(reports).toEqual(['Net Worth', 'Cash Flow', 'Monthly Spending']);
await expect(page).toMatchThemeScreenshots();
});

Expand Down
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.
7 changes: 7 additions & 0 deletions packages/desktop-client/globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
import { type CSSObject } from '@emotion/css/dist/declarations/src/create-instance';

// Allow images to be imported
declare module '*.png';

declare module 'react' {
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions, @typescript-eslint/no-empty-object-type
interface CSSProperties extends CSSObject {}
}
2 changes: 1 addition & 1 deletion packages/desktop-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"build"
],
"devDependencies": {
"@emotion/css": "^11.13.4",
"@fontsource/redacted-script": "^5.0.21",
"@juggle/resize-observer": "^3.4.0",
"@playwright/test": "1.41.1",
Expand Down Expand Up @@ -36,7 +37,6 @@
"debounce": "^1.2.1",
"downshift": "7.6.2",
"focus-visible": "^4.1.5",
"glamor": "^2.20.40",
"i18next": "^23.11.5",
"i18next-parser": "^9.0.0",
"i18next-resources-to-backend": "^1.2.1",
Expand Down
5 changes: 2 additions & 3 deletions packages/desktop-client/src/components/AnimatedRefresh.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// @ts-strict-ignore
import React from 'react';
import React, { type CSSProperties } from 'react';

import { keyframes } from 'glamor';
import { keyframes } from '@emotion/css';

import { SvgRefresh } from '../icons/v1';
import { type CSSProperties } from '../style';

import { View } from './common/View';

Expand Down
6 changes: 3 additions & 3 deletions packages/desktop-client/src/components/AppBackground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { useSelector } from 'react-redux';
import { useTransition, animated } from 'react-spring';

import { css } from 'glamor';
import { css } from '@emotion/css';

import { AnimatedLoading } from '../icons/AnimatedLoading';
import { theme } from '../style';
Expand Down Expand Up @@ -33,7 +33,7 @@ export function AppBackground({ isLoading }: AppBackgroundProps) {
transitions((style, item) => (
<animated.div key={item} style={style}>
<View
className={`${css({
className={css({
position: 'absolute',
top: 0,
left: 0,
Expand All @@ -42,7 +42,7 @@ export function AppBackground({ isLoading }: AppBackgroundProps) {
paddingTop: 200,
color: theme.pageText,
alignItems: 'center',
})}`}
})}
>
<Block style={{ marginBottom: 20, fontSize: 18 }}>
{loadingText}
Expand Down
3 changes: 1 addition & 2 deletions packages/desktop-client/src/components/FixedSizeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import {
type Ref,
type MutableRefObject,
type UIEvent,
type CSSProperties,
} from 'react';

import memoizeOne from 'memoize-one';

import { type CSSProperties } from '../style';

import { View } from './common/View';

const IS_SCROLLING_DEBOUNCE_INTERVAL = 150;
Expand Down
36 changes: 12 additions & 24 deletions packages/desktop-client/src/components/HelpMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ import { useLocation } from 'react-router-dom';

import { useToggle } from 'usehooks-ts';

import { openDocsForCurrentPage } from 'loot-core/client/actions';
import { pushModal } from 'loot-core/client/actions/modals';

import { useFeatureFlag } from '../hooks/useFeatureFlag';
import { SvgHelp } from '../icons/v2/Help';
import { openUrl } from '../util/router-tools';

import { Button } from './common/Button2';
import { Menu } from './common/Menu';
import { Popover } from './common/Popover';
import { SpaceBetween } from './common/SpaceBetween';

type HelpMenuItem = 'docs' | 'keyboard-shortcuts';
type HelpMenuItem = 'docs' | 'keyboard-shortcuts' | 'goal-templates';

type HelpButtonProps = {
onPress?: () => void;
Expand Down Expand Up @@ -45,27 +46,8 @@ const HelpButton = forwardRef<HTMLButtonElement, HelpButtonProps>(

HelpButton.displayName = 'HelpButton';

const getPageDocs = (page: string) => {
switch (page) {
case '/budget':
return 'https://actualbudget.org/docs/getting-started/envelope-budgeting';
case '/reports':
return 'https://actualbudget.org/docs/reports/';
case '/schedules':
return 'https://actualbudget.org/docs/schedules';
case '/payees':
return 'https://actualbudget.org/docs/transactions/payees';
case '/rules':
return 'https://actualbudget.org/docs/budgeting/rules';
case '/settings':
return 'https://actualbudget.org/docs/settings';
default:
// All pages under /accounts, plus any missing pages
return 'https://actualbudget.org/docs';
}
};

export const HelpMenu = () => {
const showGoalTemplates = useFeatureFlag('goalTemplatesEnabled');
const { t } = useTranslation();
const [isMenuOpen, toggleMenuOpen, setMenuOpen] = useToggle();
const menuButtonRef = useRef(null);
Expand All @@ -76,11 +58,14 @@ export const HelpMenu = () => {
const handleItemSelect = (item: HelpMenuItem) => {
switch (item) {
case 'docs':
openUrl(getPageDocs(page));
dispatch(openDocsForCurrentPage());
break;
case 'keyboard-shortcuts':
dispatch(pushModal('keyboard-shortcuts'));
break;
case 'goal-templates':
dispatch(pushModal('goal-templates'));
break;
}
};

Expand All @@ -98,7 +83,7 @@ export const HelpMenu = () => {
onOpenChange={() => setMenuOpen(false)}
>
<Menu
onMenuSelect={item => {
onMenuSelect={(item: HelpMenuItem) => {
setMenuOpen(false);
handleItemSelect(item);
}}
Expand All @@ -108,6 +93,9 @@ export const HelpMenu = () => {
text: t('Documentation'),
},
{ name: 'keyboard-shortcuts', text: t('Keyboard shortcuts') },
...(showGoalTemplates && page === '/budget'
? [{ name: 'goal-templates', text: t('Goal templates') }]
: []),
]}
/>
</Popover>
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/src/components/LoggedInUser.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// @ts-strict-ignore
import React, { useState, useEffect, useRef } from 'react';
import React, { useState, useEffect, useRef, type CSSProperties } from 'react';
import { Trans, useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';

import { type State } from 'loot-core/src/client/state-types';

import { useActions } from '../hooks/useActions';
import { theme, styles, type CSSProperties } from '../style';
import { theme, styles } from '../style';

import { Button } from './common/Button2';
import { Menu } from './common/Menu';
Expand Down
11 changes: 4 additions & 7 deletions packages/desktop-client/src/components/ManageRules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,14 @@ export function ManageRules({
const { list: categories } = useCategories();
const payees = usePayees();
const accounts = useAccounts();
const state = {
payees,
accounts,
schedules,
};
const filterData = useMemo(
() => ({
...state,
payees,
accounts,
schedules,
categories,
}),
[state, categories],
[payees, accounts, schedules, categories],
);

const filteredRules = useMemo(
Expand Down
4 changes: 4 additions & 0 deletions packages/desktop-client/src/components/Modals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { EnvelopeBudgetMonthMenuModal } from './modals/EnvelopeBudgetMonthMenuMo
import { EnvelopeBudgetSummaryModal } from './modals/EnvelopeBudgetSummaryModal';
import { EnvelopeToBudgetMenuModal } from './modals/EnvelopeToBudgetMenuModal';
import { FixEncryptionKeyModal } from './modals/FixEncryptionKeyModal';
import { GoalTemplateModal } from './modals/GoalTemplateModal';
import { GoCardlessExternalMsgModal } from './modals/GoCardlessExternalMsgModal';
import { GoCardlessInitialiseModal } from './modals/GoCardlessInitialiseModal';
import { HoldBufferModal } from './modals/HoldBufferModal';
Expand Down Expand Up @@ -83,6 +84,9 @@ export function Modals() {
const modals = modalStack
.map(({ name, options }) => {
switch (name) {
case 'goal-templates':
return budgetId ? <GoalTemplateModal key={name} /> : null;

case 'keyboard-shortcuts':
// don't show the hotkey help modal when a budget is not open
return budgetId ? <KeyboardShortcutModal key={name} /> : null;
Expand Down
12 changes: 6 additions & 6 deletions packages/desktop-client/src/components/Notes.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// @ts-strict-ignore
import React, { useEffect, useRef } from 'react';
import React, { useEffect, useRef, type CSSProperties } from 'react';
import ReactMarkdown from 'react-markdown';

import { css } from 'glamor';
import { css } from '@emotion/css';
import remarkGfm from 'remark-gfm';

import { useResponsive } from '../ResponsiveProvider';
import { type CSSProperties, theme } from '../style';
import { theme } from '../style';
import { remarkBreaks, sequentialNewlinesPlugin } from '../util/markdown';

import { Text } from './common/Text';
Expand Down Expand Up @@ -110,22 +110,22 @@ export function Notes({
return editable ? (
<textarea
ref={textAreaRef}
className={`${css({
className={css({
border: '1px solid ' + theme.buttonNormalBorder,
padding: 7,
...(!isNarrowWidth && { minWidth: 350, minHeight: 120 }),
outline: 'none',
backgroundColor: theme.tableBackground,
color: theme.tableText,
...getStyle?.(editable),
})}`}
})}
value={notes || ''}
onChange={e => onChange?.(e.target.value)}
onBlur={e => onBlur?.(e.target.value)}
placeholder="Notes (markdown supported)"
/>
) : (
<Text {...markdownStyles} style={{ ...getStyle?.(editable) }}>
<Text className={css([markdownStyles, getStyle?.(editable)])}>
<ReactMarkdown remarkPlugins={remarkPlugins} linkTarget="_blank">
{notes}
</ReactMarkdown>
Expand Down
10 changes: 8 additions & 2 deletions packages/desktop-client/src/components/NotesButton.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import React, { useEffect, useRef, useState, type ComponentProps } from 'react';
import React, {
useEffect,
useRef,
useState,
type ComponentProps,
type CSSProperties,
} from 'react';

import { send } from 'loot-core/src/platform/client/fetch';

import { useNotes } from '../hooks/useNotes';
import { SvgCustomNotesPaper } from '../icons/v2';
import { type CSSProperties, theme } from '../style';
import { theme } from '../style';

import { Button } from './common/Button2';
import { Popover } from './common/Popover';
Expand Down
49 changes: 24 additions & 25 deletions packages/desktop-client/src/components/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import React, {
useEffect,
useMemo,
type SetStateAction,
type CSSProperties,
} from 'react';
import { useDispatch, useSelector } from 'react-redux';

import { css } from 'glamor';
import { css } from '@emotion/css';

import { removeNotification } from 'loot-core/client/actions';
import { type State } from 'loot-core/src/client/state-types';
Expand All @@ -16,7 +17,7 @@ import type { NotificationWithId } from 'loot-core/src/client/state-types/notifi
import { AnimatedLoading } from '../icons/AnimatedLoading';
import { SvgDelete } from '../icons/v0';
import { useResponsive } from '../ResponsiveProvider';
import { styles, theme, type CSSProperties } from '../style';
import { styles, theme } from '../style';

import { Button, ButtonWithLoading } from './common/Button2';
import { Link } from './common/Link';
Expand Down Expand Up @@ -202,29 +203,27 @@ function Notification({
onRemove();
setLoading(false);
}}
className={String(
css({
backgroundColor: 'transparent',
border: `1px solid ${
positive
? theme.noticeBorder
: error
? theme.errorBorder
: theme.warningBorder
}`,
color: 'currentColor',
...styles.mediumText,
flexShrink: 0,
'&[data-hovered], &[data-pressed]': {
backgroundColor: positive
? theme.noticeBackground
: error
? theme.errorBackground
: theme.warningBackground,
},
...narrowStyle,
}),
)}
className={css({
backgroundColor: 'transparent',
border: `1px solid ${
positive
? theme.noticeBorder
: error
? theme.errorBorder
: theme.warningBorder
}`,
color: 'currentColor',
...styles.mediumText,
flexShrink: 0,
'&[data-hovered], &[data-pressed]': {
backgroundColor: positive
? theme.noticeBackground
: error
? theme.errorBackground
: theme.warningBackground,
},
...narrowStyle,
})}
>
{button.title}
</ButtonWithLoading>
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/src/components/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { type ReactNode } from 'react';
import React, { type ReactNode, type CSSProperties } from 'react';

import { useResponsive } from '../ResponsiveProvider';
import { theme, styles, type CSSProperties } from '../style';
import { theme, styles } from '../style';

import { Text } from './common/Text';
import { View } from './common/View';
Expand Down
Loading

0 comments on commit eb54988

Please sign in to comment.