Skip to content

Commit

Permalink
Release 'Splits in rules' feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdoming committed May 22, 2024
1 parent bbc123c commit f7538bd
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 10 deletions.
6 changes: 1 addition & 5 deletions packages/desktop-client/src/components/modals/EditRule.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -659,7 +658,6 @@ const conditionFields = [
]);

export function EditRule({ modalProps, defaultRule, onSave: originalOnSave }) {
const splitsEnabled = useFeatureFlag('splitsInRules');
const [conditions, setConditions] = useState(
defaultRule.conditions.map(parse),
);
Expand Down Expand Up @@ -887,9 +885,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion packages/desktop-client/src/hooks/useFeatureFlag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion packages/loot-core/src/server/accounts/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,8 @@ export function execActions(actions: Action[], transaction) {
) + 1;

let update = execNonSplitActions(parentActions, transaction);
if (!prefs.getPrefs()?.['flags.splitsInRules'] || totalSplitCount === 1) {
if (totalSplitCount === 1) {
//
return update;
}

Expand Down
3 changes: 1 addition & 2 deletions packages/loot-core/src/types/prefs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ export type FeatureFlag =
| 'goalTemplatesEnabled'
| 'customReports'
| 'spendingReport'
| 'simpleFinSync'
| 'splitsInRules';
| 'simpleFinSync';

export type LocalPrefs = Partial<
{
Expand Down

0 comments on commit f7538bd

Please sign in to comment.