mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-09 03:32:54 -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
|
||||
? 'Before split'
|
||||
? 'Apply to all'
|
||||
: `Split ${splitIndex}`}
|
||||
</Text>
|
||||
{splitIndex && (
|
||||
|
||||
@@ -139,7 +139,7 @@ export const RuleRow = memo(
|
||||
marginBottom: 6,
|
||||
}}
|
||||
>
|
||||
{i ? `Split ${i}` : 'Before split'}
|
||||
{i ? `Split ${i}` : 'Apply to all'}
|
||||
</Text>
|
||||
{split.actions.map((action, j) => (
|
||||
<ActionExpression
|
||||
|
||||
@@ -861,6 +861,7 @@ describe('Transactions', () => {
|
||||
{
|
||||
account: accounts[0].id,
|
||||
amount: -1000,
|
||||
category: null,
|
||||
cleared: false,
|
||||
date: '2017-01-01',
|
||||
error: null,
|
||||
@@ -874,6 +875,7 @@ describe('Transactions', () => {
|
||||
{
|
||||
account: accounts[0].id,
|
||||
amount: -1777,
|
||||
category: null,
|
||||
cleared: false,
|
||||
date: '2017-01-01',
|
||||
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.
|
||||
update.subtransactions = update.subtransactions.slice(1);
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ export function makeChild<T extends GenericTransactionEntity>(
|
||||
return {
|
||||
amount: 0,
|
||||
...data,
|
||||
category: 'category' in data ? data.category : parent.category,
|
||||
payee: 'payee' in data ? data.payee : parent.payee,
|
||||
id: 'id' in data ? data.id : prefix + uuidv4(),
|
||||
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