Skip to content

Commit

Permalink
✨ release tracking budget feature
Browse files Browse the repository at this point in the history
Solves #2999
  • Loading branch information
MatissJanis committed Nov 14, 2024
1 parent 58baf74 commit 3d8527d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 22 deletions.
19 changes: 0 additions & 19 deletions packages/desktop-client/src/components/settings/Experimental.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,6 @@ function FeatureToggle({
);
}

function TrackingBudgetFeature() {
const { t } = useTranslation();
const [budgetType = 'rollover'] = useSyncedPref('budgetType');
const enabled = useFeatureFlag('reportBudget');
const blockToggleOff = budgetType === 'report' && enabled;
return (
<FeatureToggle
flag="reportBudget"
disableToggle={blockToggleOff}
error={t('Switch to a envelope budget before turning off this feature')}
feedbackLink="https://github.com/actualbudget/actual/issues/2999"
>
<Trans>Budget mode toggle</Trans>
</FeatureToggle>
);
}

export function ExperimentalFeatures() {
const [expanded, setExpanded] = useState(false);

Expand All @@ -92,8 +75,6 @@ export function ExperimentalFeatures() {
primaryAction={
expanded ? (
<View style={{ gap: '1em' }}>
<TrackingBudgetFeature />

<FeatureToggle flag="goalTemplatesEnabled">
<Trans>Goal templates</Trans>
</FeatureToggle>
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export function Settings() {
<ThemeSettings />
<FormatSettings />
<EncryptionSettings />
{useFeatureFlag('reportBudget') && <BudgetTypeSettings />}
<BudgetTypeSettings />
{isElectron() && <Backups />}
<ExportBudget />
<AdvancedToggle>
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 @@ -3,7 +3,6 @@ import type { FeatureFlag } from 'loot-core/src/types/prefs';
import { useSyncedPref } from './useSyncedPref';

const DEFAULT_FEATURE_FLAG_STATE: Record<FeatureFlag, boolean> = {
reportBudget: false,
goalTemplatesEnabled: false,
dashboards: false,
actionTemplating: false,
Expand Down
1 change: 0 additions & 1 deletion packages/loot-core/src/types/prefs.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export type FeatureFlag =
| 'dashboards'
| 'reportBudget'
| 'goalTemplatesEnabled'
| 'actionTemplating'
| 'upcomingLengthAdjustment'
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3833.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Features
authors: [MatissJanis]
---

Release tracking budget feature.

0 comments on commit 3d8527d

Please sign in to comment.