Skip to content

Commit

Permalink
Add Upcoming length adjustment feature flag (#3651)
Browse files Browse the repository at this point in the history
* feature flag created

* feature flag implemented

* feature toggle setting added

* added release notes

* Update packages/desktop-client/src/components/settings/Experimental.tsx

Co-authored-by: Matiss Janis Aboltins <[email protected]>

* vrt

* vrt

---------

Co-authored-by: Matiss Janis Aboltins <[email protected]>
  • Loading branch information
SamBobBarnes and MatissJanis authored Oct 18, 2024
1 parent 225c939 commit 3f31d19
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ export function ExperimentalFeatures() {
>
<Trans>Rule action templating</Trans>
</FeatureToggle>
<FeatureToggle
flag="upcomingLengthAdjustment"
feedbackLink="https://github.com/actualbudget/actual/issues/3660"
>
<Trans>Scheduled transaction upcoming length adjustment</Trans>
</FeatureToggle>
</View>
) : (
<Link
Expand Down
5 changes: 5 additions & 0 deletions packages/desktop-client/src/components/settings/Upcoming.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Column } from 'glamor/jsxstyle';

import { type SyncedPrefs } from 'loot-core/types/prefs';

import { useFeatureFlag } from '../../hooks/useFeatureFlag';
import { useSyncedPref } from '../../hooks/useSyncedPref';
import { type CSSProperties, theme } from '../../style';
import { Button } from '../common/Button2';
Expand Down Expand Up @@ -38,9 +39,13 @@ export function UpcomingLengthSettings() {
},
};

const enabled = useFeatureFlag('upcomingLengthAdjustment');

const location = useLocation();
const [expanded, setExpanded] = useState(location.hash === '#upcomingLength');

if (!enabled) return null;

return expanded ? (
<Setting
primaryAction={
Expand Down
1 change: 1 addition & 0 deletions packages/desktop-client/src/hooks/useFeatureFlag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const DEFAULT_FEATURE_FLAG_STATE: Record<FeatureFlag, boolean> = {
spendingReport: false,
dashboards: false,
actionTemplating: false,
upcomingLengthAdjustment: false,
};

export function useFeatureFlag(name: FeatureFlag): boolean {
Expand Down
3 changes: 2 additions & 1 deletion packages/loot-core/src/types/prefs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ export type FeatureFlag =
| 'reportBudget'
| 'goalTemplatesEnabled'
| 'spendingReport'
| 'actionTemplating';
| 'actionTemplating'
| 'upcomingLengthAdjustment';

/**
* Cross-device preferences. These sync across devices when they are changed.
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3651.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [ SamBobBarnes ]
---

Add feature flag for upcoming length adjustment setting.

0 comments on commit 3f31d19

Please sign in to comment.