mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 10:33:02 -05:00
Release 'Splits in rules' feature (#2789)
* Release 'Splits in rules' feature * Add release notes * Add missed comment * Remove unused import * Fix failing test
This commit is contained in:
committed by
GitHub
parent
5fd1d05670
commit
7d960579f9
@@ -69,11 +69,6 @@ test.describe('Rules', () => {
|
||||
});
|
||||
|
||||
test('creates a split transaction rule and makes sure it is applied when creating a transaction', async () => {
|
||||
const settingsPage = await navigation.goToSettingsPage();
|
||||
await settingsPage.enableExperimentalFeature('splits in rules');
|
||||
|
||||
await expect(settingsPage.page.getByLabel('splits in rules')).toBeChecked();
|
||||
|
||||
rulesPage = await navigation.goToRulesPage();
|
||||
|
||||
await rulesPage.createRule({
|
||||
|
||||
@@ -30,7 +30,6 @@ import {
|
||||
} from 'loot-core/src/shared/util';
|
||||
|
||||
import { useDateFormat } from '../../hooks/useDateFormat';
|
||||
import { useFeatureFlag } from '../../hooks/useFeatureFlag';
|
||||
import { useSelected, SelectedProvider } from '../../hooks/useSelected';
|
||||
import { SvgDelete, SvgAdd, SvgSubtract } from '../../icons/v0';
|
||||
import { SvgInformationOutline } from '../../icons/v1';
|
||||
@@ -655,7 +654,6 @@ const conditionFields = [
|
||||
]);
|
||||
|
||||
export function EditRule({ modalProps, defaultRule, onSave: originalOnSave }) {
|
||||
const splitsEnabled = useFeatureFlag('splitsInRules');
|
||||
const [conditions, setConditions] = useState(
|
||||
defaultRule.conditions.map(parse),
|
||||
);
|
||||
@@ -883,9 +881,7 @@ export function EditRule({ modalProps, defaultRule, onSave: originalOnSave }) {
|
||||
};
|
||||
|
||||
// Enable editing existing split rules even if the feature has since been disabled.
|
||||
const showSplitButton = splitsEnabled
|
||||
? actionSplits.length > 0
|
||||
: actionSplits.length > 1;
|
||||
const showSplitButton = actionSplits.length > 0;
|
||||
|
||||
return (
|
||||
<Modal
|
||||
|
||||
@@ -90,7 +90,6 @@ export function ExperimentalFeatures() {
|
||||
Goal templates
|
||||
</FeatureToggle>
|
||||
<FeatureToggle flag="simpleFinSync">SimpleFIN sync</FeatureToggle>
|
||||
<FeatureToggle flag="splitsInRules">Splits in rules</FeatureToggle>
|
||||
</View>
|
||||
) : (
|
||||
<Link
|
||||
|
||||
@@ -9,7 +9,6 @@ const DEFAULT_FEATURE_FLAG_STATE: Record<FeatureFlag, boolean> = {
|
||||
customReports: false,
|
||||
spendingReport: false,
|
||||
simpleFinSync: false,
|
||||
splitsInRules: false,
|
||||
};
|
||||
|
||||
export function useFeatureFlag(name: FeatureFlag): boolean {
|
||||
|
||||
@@ -21,7 +21,6 @@ import {
|
||||
import { fastSetMerge } from '../../shared/util';
|
||||
import { RuleConditionEntity } from '../../types/models';
|
||||
import { RuleError } from '../errors';
|
||||
import * as prefs from '../prefs';
|
||||
import { Schedule as RSchedule } from '../util/rschedule';
|
||||
|
||||
function assert(test, type, msg) {
|
||||
@@ -509,7 +508,8 @@ export function execActions(actions: Action[], transaction) {
|
||||
) + 1;
|
||||
|
||||
let update = execNonSplitActions(parentActions, transaction);
|
||||
if (!prefs.getPrefs()?.['flags.splitsInRules'] || totalSplitCount === 1) {
|
||||
if (totalSplitCount === 1) {
|
||||
// No splits, no need to do anything else.
|
||||
return update;
|
||||
}
|
||||
|
||||
|
||||
3
packages/loot-core/src/types/prefs.d.ts
vendored
3
packages/loot-core/src/types/prefs.d.ts
vendored
@@ -5,8 +5,7 @@ export type FeatureFlag =
|
||||
| 'goalTemplatesEnabled'
|
||||
| 'customReports'
|
||||
| 'spendingReport'
|
||||
| 'simpleFinSync'
|
||||
| 'splitsInRules';
|
||||
| 'simpleFinSync';
|
||||
|
||||
export type LocalPrefs = Partial<
|
||||
{
|
||||
|
||||
6
upcoming-release-notes/2789.md
Normal file
6
upcoming-release-notes/2789.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Features
|
||||
authors: [jfdoming]
|
||||
---
|
||||
|
||||
Release 'Splits in rules' feature
|
||||
Reference in New Issue
Block a user