Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'actualbudget:master' into duplicate-budget
Browse files Browse the repository at this point in the history
tlesicka authored Dec 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 890486a + a289227 commit d9c0e48
Showing 5 changed files with 34 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-strict-ignore
import React, { useEffect, useRef, useState } from 'react';
import React, { useEffect, useState } from 'react';
import { DialogTrigger } from 'react-aria-components';
import { useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';

@@ -30,13 +30,12 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) {
const { t } = useTranslation();
const syncServerStatus = useSyncServerStatus();
const dispatch = useDispatch();
const [isGoCardlessSetupComplete, setIsGoCardlessSetupComplete] =
useState(null);
const [isSimpleFinSetupComplete, setIsSimpleFinSetupComplete] =
useState(null);
const [menuGoCardlessOpen, setGoCardlessMenuOpen] = useState<boolean>(false);
const triggerRef = useRef(null);
const [menuSimplefinOpen, setSimplefinMenuOpen] = useState<boolean>(false);
const [isGoCardlessSetupComplete, setIsGoCardlessSetupComplete] = useState<
boolean | null
>(null);
const [isSimpleFinSetupComplete, setIsSimpleFinSetupComplete] = useState<
boolean | null
>(null);

const onConnectGoCardless = () => {
if (!isGoCardlessSetupComplete) {
@@ -139,7 +138,6 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) {
value: null,
}).then(() => {
setIsGoCardlessSetupComplete(false);
setGoCardlessMenuOpen(false);
});
});
};
@@ -154,7 +152,6 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) {
value: null,
}).then(() => {
setIsSimpleFinSetupComplete(false);
setSimplefinMenuOpen(false);
});
});
};
@@ -248,12 +245,10 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) {
: t('Set up GoCardless for bank sync')}
</ButtonWithLoading>
{isGoCardlessSetupComplete && (
<>
<DialogTrigger>
<Button
ref={triggerRef}
variant="bare"
onPress={() => setGoCardlessMenuOpen(true)}
aria-label="GoCardless menu"
aria-label={t('GoCardless menu')}
>
<SvgDotsHorizontalTriple
width={15}
@@ -262,11 +257,7 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) {
/>
</Button>

<Popover
triggerRef={triggerRef}
isOpen={menuGoCardlessOpen}
onOpenChange={() => setGoCardlessMenuOpen(false)}
>
<Popover>
<Menu
onMenuSelect={item => {
if (item === 'reconfigure') {
@@ -281,7 +272,7 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) {
]}
/>
</Popover>
</>
</DialogTrigger>
)}
</View>
<Text style={{ lineHeight: '1.4em', fontSize: 15 }}>
@@ -317,24 +308,15 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) {
: t('Set up SimpleFIN for bank sync')}
</ButtonWithLoading>
{isSimpleFinSetupComplete && (
<>
<Button
ref={triggerRef}
variant="bare"
onPress={() => setSimplefinMenuOpen(true)}
aria-label="SimpleFIN menu"
>
<DialogTrigger>
<Button variant="bare" aria-label={t('SimpleFIN menu')}>
<SvgDotsHorizontalTriple
width={15}
height={15}
style={{ transform: 'rotateZ(90deg)' }}
/>
</Button>
<Popover
triggerRef={triggerRef}
isOpen={menuSimplefinOpen}
onOpenChange={() => setSimplefinMenuOpen(false)}
>
<Popover>
<Menu
onMenuSelect={item => {
if (item === 'reconfigure') {
@@ -349,7 +331,7 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) {
]}
/>
</Popover>
</>
</DialogTrigger>
)}
</View>
<Text style={{ lineHeight: '1.4em', fontSize: 15 }}>
6 changes: 5 additions & 1 deletion packages/loot-core/src/server/accounts/transaction-rules.ts
Original file line number Diff line number Diff line change
@@ -291,7 +291,11 @@ export async function runRules(trans) {
return await finalizeTransactionForRules(finalTrans);
}

function conditionSpecialCases(cond: Condition): Condition {
function conditionSpecialCases(cond: Condition | null): Condition | null {
if (!cond) {
return cond;
}

//special cases that require multiple conditions
if (cond.op === 'is' && cond.field === 'category' && cond.value === null) {
return new Condition(
2 changes: 1 addition & 1 deletion packages/loot-core/src/types/server-handlers.d.ts
Original file line number Diff line number Diff line change
@@ -178,7 +178,7 @@ export interface ServerHandlers {

'account-move': (arg: { id; targetId }) => Promise<unknown>;

'secret-set': (arg: { name: string; value: string }) => Promise<null>;
'secret-set': (arg: { name: string; value: string | null }) => Promise<null>;
'secret-check': (arg: string) => Promise<string | { error?: string }>;

'gocardless-poll-web-token': (arg: {
6 changes: 6 additions & 0 deletions upcoming-release-notes/3942.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [MatissJanis]
---

Fix misaligned gocardless credential popover.
6 changes: 6 additions & 0 deletions upcoming-release-notes/3943.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [MatissJanis]
---

Fix rule creation throwing error for "notes contains (nothing)" condition.

0 comments on commit d9c0e48

Please sign in to comment.