mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-30 10:14:53 -05:00
Improve 'Before split' section in rule splits (#2651)
* Copy category from parent transaction when splitting * Rename 'Before split' -> 'Apply to all' * Add release notes * Update tests to reflect change
This commit is contained in:
committed by
GitHub
parent
4c29afd424
commit
cdad43ff32
@@ -1020,7 +1020,7 @@ export function EditRule({ modalProps, defaultRule, onSave: originalOnSave }) {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{splitIndex === 0
|
{splitIndex === 0
|
||||||
? 'Before split'
|
? 'Apply to all'
|
||||||
: `Split ${splitIndex}`}
|
: `Split ${splitIndex}`}
|
||||||
</Text>
|
</Text>
|
||||||
{splitIndex && (
|
{splitIndex && (
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ export const RuleRow = memo(
|
|||||||
marginBottom: 6,
|
marginBottom: 6,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{i ? `Split ${i}` : 'Before split'}
|
{i ? `Split ${i}` : 'Apply to all'}
|
||||||
</Text>
|
</Text>
|
||||||
{split.actions.map((action, j) => (
|
{split.actions.map((action, j) => (
|
||||||
<ActionExpression
|
<ActionExpression
|
||||||
|
|||||||
@@ -861,6 +861,7 @@ describe('Transactions', () => {
|
|||||||
{
|
{
|
||||||
account: accounts[0].id,
|
account: accounts[0].id,
|
||||||
amount: -1000,
|
amount: -1000,
|
||||||
|
category: null,
|
||||||
cleared: false,
|
cleared: false,
|
||||||
date: '2017-01-01',
|
date: '2017-01-01',
|
||||||
error: null,
|
error: null,
|
||||||
@@ -874,6 +875,7 @@ describe('Transactions', () => {
|
|||||||
{
|
{
|
||||||
account: accounts[0].id,
|
account: accounts[0].id,
|
||||||
amount: -1777,
|
amount: -1777,
|
||||||
|
category: null,
|
||||||
cleared: false,
|
cleared: false,
|
||||||
date: '2017-01-01',
|
date: '2017-01-01',
|
||||||
error: null,
|
error: null,
|
||||||
|
|||||||
@@ -622,7 +622,7 @@ export function execActions(actions: Action[], transaction) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The split index 0 is reserved for "Before split" actions.
|
// The split index 0 is reserved for "Apply to all" actions.
|
||||||
// Remove that entry from the subtransactions.
|
// Remove that entry from the subtransactions.
|
||||||
update.subtransactions = update.subtransactions.slice(1);
|
update.subtransactions = update.subtransactions.slice(1);
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ export function makeChild<T extends GenericTransactionEntity>(
|
|||||||
return {
|
return {
|
||||||
amount: 0,
|
amount: 0,
|
||||||
...data,
|
...data,
|
||||||
|
category: 'category' in data ? data.category : parent.category,
|
||||||
payee: 'payee' in data ? data.payee : parent.payee,
|
payee: 'payee' in data ? data.payee : parent.payee,
|
||||||
id: 'id' in data ? data.id : prefix + uuidv4(),
|
id: 'id' in data ? data.id : prefix + uuidv4(),
|
||||||
account: parent.account,
|
account: parent.account,
|
||||||
|
|||||||
6
upcoming-release-notes/2651.md
Normal file
6
upcoming-release-notes/2651.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
category: Enhancements
|
||||||
|
authors: [jfdoming]
|
||||||
|
---
|
||||||
|
|
||||||
|
Make the 'Apply to all' section (fka 'Before split') of rule splits more intuitive
|
||||||
Reference in New Issue
Block a user