fix: use CALDAV_ENABLED for calendar feature flag (#1070)

* fix: add FF_ENABLE_CALDAV feature flag for CalDAV functionality

Introduces a new dedicated feature flag for CalDAV sync that checks
both FF_ENABLE_CALDAV and CALDAV_ENABLED environment variables. This
allows the CalDAV tab to appear in profile settings when users set
CALDAV_ENABLED=true as documented.

The existing FF_ENABLE_CALENDAR remains unchanged as it's for a
separate (hidden) calendar feature.

Changes:
- Added 'caldav' feature flag to backend service (checks FF_ENABLE_CALDAV
  or CALDAV_ENABLED)
- Updated frontend FeatureFlags interface to include 'caldav'
- Changed CalDAV tab to use 'caldav' feature flag instead of 'calendar'
- Added FF_ENABLE_CALDAV to .env.example, .env.test, Dockerfile, and CI

Fixes #1048

* fix: add caldav property to all FeatureFlags initializations

Fixes TypeScript errors where FeatureFlags objects were missing the
new caldav property in:
- frontend/utils/featureFlags.ts (defaultFlags and error return)
- frontend/components/Navbar.tsx
- frontend/components/Sidebar.tsx
- frontend/components/Sidebar/SidebarNav.tsx
This commit is contained in:
Chris 2026-04-25 18:21:53 +03:00 committed by GitHub
parent 2103f633eb
commit 57a6e558f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 16 additions and 1 deletions

View file

@ -42,6 +42,7 @@ const Navbar: React.FC<NavbarProps> = ({
const [featureFlags, setFeatureFlags] = useState<FeatureFlags>({
backups: false,
calendar: false,
caldav: false,
habits: false,
mcp: false,
});

View file

@ -144,6 +144,7 @@ const ProfileSettings: React.FC<ProfileSettingsProps> = ({
const [featureFlags, setFeatureFlags] = useState<FeatureFlags>({
backups: false,
calendar: false,
caldav: false,
habits: false,
mcp: false,
});
@ -1174,7 +1175,7 @@ const ProfileSettings: React.FC<ProfileSettingsProps> = ({
id: 'caldav',
name: t('profile.tabs.caldav', 'CalDAV Sync'),
icon: <CalendarIcon className="w-5 h-5" />,
featureFlag: 'calendar',
featureFlag: 'caldav',
},
{
id: 'mcp',

View file

@ -56,6 +56,7 @@ const Sidebar: React.FC<SidebarProps> = ({
const [featureFlags, setFeatureFlags] = useState<FeatureFlags>({
backups: false,
calendar: false,
caldav: false,
habits: false,
mcp: false,
});

View file

@ -30,6 +30,7 @@ const SidebarNav: React.FC<SidebarNavProps> = ({
const [featureFlags, setFeatureFlags] = useState<FeatureFlags>({
backups: false,
calendar: false,
caldav: false,
habits: false,
mcp: false,
});

View file

@ -3,6 +3,7 @@ import { getApiPath } from '../config/paths';
export interface FeatureFlags {
backups: boolean;
calendar: boolean;
caldav: boolean;
habits: boolean;
mcp: boolean;
}
@ -24,6 +25,7 @@ export const getFeatureFlags = async (): Promise<FeatureFlags> => {
return {
backups: false,
calendar: false,
caldav: false,
habits: false,
mcp: false,
};
@ -33,6 +35,7 @@ export const getFeatureFlags = async (): Promise<FeatureFlags> => {
const defaultFlags: FeatureFlags = {
backups: false,
calendar: false,
caldav: false,
habits: false,
mcp: false,
};
@ -46,6 +49,7 @@ export const getFeatureFlags = async (): Promise<FeatureFlags> => {
return {
backups: false,
calendar: false,
caldav: false,
habits: false,
mcp: false,
};