Update 'next' package version and refactor user account handling
This commit updates the 'next' package from version 14.2.0 to 14.2.1 across various modules. It also refactors the code for user account handling to make it controlled by an enableTeamAccounts flag in the featureFlagsConfig, essentially allowing the enabling or disabling of the 'team accounts' feature according to the specified flag.
This commit is contained in:
@@ -8,7 +8,6 @@ import featureFlagsConfig from '~/config/feature-flags.config';
|
||||
import pathsConfig from '~/config/paths.config';
|
||||
|
||||
const features = {
|
||||
enableTeamAccounts: featureFlagsConfig.enableTeamAccounts,
|
||||
enableTeamCreation: featureFlagsConfig.enableTeamCreation,
|
||||
};
|
||||
|
||||
|
||||
@@ -2,8 +2,11 @@ import { use } from 'react';
|
||||
|
||||
import { cookies } from 'next/headers';
|
||||
|
||||
import { If } from '@kit/ui/if';
|
||||
import { Sidebar, SidebarContent, SidebarNavigation } from '@kit/ui/sidebar';
|
||||
|
||||
import { AppLogo } from '~/components/app-logo';
|
||||
import featuresFlagConfig from '~/config/feature-flags.config';
|
||||
import { personalAccountSidebarConfig } from '~/config/personal-account-sidebar.config';
|
||||
|
||||
// home imports
|
||||
@@ -18,7 +21,15 @@ export function HomeSidebar() {
|
||||
return (
|
||||
<Sidebar collapsed={collapsed}>
|
||||
<SidebarContent className={'my-4'}>
|
||||
<HomeSidebarAccountSelector collapsed={collapsed} accounts={accounts} />
|
||||
<If
|
||||
condition={featuresFlagConfig.enableTeamAccounts}
|
||||
fallback={<AppLogo className={'py-2'} />}
|
||||
>
|
||||
<HomeSidebarAccountSelector
|
||||
collapsed={collapsed}
|
||||
accounts={accounts}
|
||||
/>
|
||||
</If>
|
||||
</SidebarContent>
|
||||
|
||||
<SidebarContent className={`h-[calc(100%-160px)] overflow-y-auto`}>
|
||||
|
||||
@@ -2,12 +2,14 @@ import { cache } from 'react';
|
||||
|
||||
import { getSupabaseServerComponentClient } from '@kit/supabase/server-component-client';
|
||||
|
||||
import featureFlagsConfig from '~/config/feature-flags.config';
|
||||
import { Database } from '~/lib/database.types';
|
||||
|
||||
export const loadUserWorkspace = cache(async () => {
|
||||
const client = getSupabaseServerComponentClient();
|
||||
const loadAccounts = featureFlagsConfig.enableTeamAccounts;
|
||||
|
||||
const accounts = await loadUserAccounts(client);
|
||||
const accounts = loadAccounts ? await loadUserAccounts(client) : [];
|
||||
const { data } = await client.auth.getSession();
|
||||
|
||||
return {
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
"i18next": "^23.11.1",
|
||||
"i18next-resources-to-backend": "^1.2.1",
|
||||
"lucide-react": "^0.367.0",
|
||||
"next": "14.2.0",
|
||||
"next": "14.2.1",
|
||||
"next-sitemap": "^4.2.3",
|
||||
"next-themes": "0.3.0",
|
||||
"react": "18.2.0",
|
||||
|
||||
Reference in New Issue
Block a user