diff --git a/packages/twenty-front/src/modules/ai/components/AgentChatProvider.tsx b/packages/twenty-front/src/modules/ai/components/AgentChatProvider.tsx index 6318382aca..6b54afa292 100644 --- a/packages/twenty-front/src/modules/ai/components/AgentChatProvider.tsx +++ b/packages/twenty-front/src/modules/ai/components/AgentChatProvider.tsx @@ -9,9 +9,9 @@ export const AgentChatProvider = ({ }) => { const isAiEnabled = useIsFeatureEnabled(FeatureFlagKey.IS_AI_ENABLED); - if (!isAiEnabled) { - return <>{children}; - } - - return {children}; + return ( + + {children} + + ); }; diff --git a/packages/twenty-front/src/modules/ai/components/AgentChatProviderContent.tsx b/packages/twenty-front/src/modules/ai/components/AgentChatProviderContent.tsx index df09313e27..5f3f8edcfc 100644 --- a/packages/twenty-front/src/modules/ai/components/AgentChatProviderContent.tsx +++ b/packages/twenty-front/src/modules/ai/components/AgentChatProviderContent.tsx @@ -10,20 +10,26 @@ import { Suspense } from 'react'; export const AgentChatProviderContent = ({ children, + isAiEnabled, }: { children: React.ReactNode; + isAiEnabled: boolean; }) => { return ( - - - - - - + {isAiEnabled && ( + <> + + + + + + + + )} {children} diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx index 5e400339e6..ff83f7d0d9 100644 --- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx +++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx @@ -6,6 +6,7 @@ import { SettingsPath } from 'twenty-shared/types'; import { getSettingsPath, isDefined } from 'twenty-shared/utils'; import { currentUserState } from '@/auth/states/currentUserState'; +import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState'; import { canManageFeatureFlagsState } from '@/client-config/states/canManageFeatureFlagsState'; import { AI_ADMIN_PATH } from '@/settings/admin-panel/ai/constants/AiAdminPath'; import { useApolloAdminClient } from '@/settings/admin-panel/apollo/hooks/useApolloAdminClient'; @@ -64,6 +65,7 @@ export const SettingsAdminWorkspaceDetail = () => { ); const currentUser = useAtomStateValue(currentUserState); + const currentWorkspace = useAtomStateValue(currentWorkspaceState); const canManageFeatureFlags = useAtomStateValue(canManageFeatureFlagsState); const { enqueueErrorSnackBar } = useSnackBar(); const { updateFeatureFlagState } = useFeatureFlagState(); @@ -262,25 +264,34 @@ export const SettingsAdminWorkspaceDetail = () => { {t`Feature Flag`} {t`Status`} - {workspace.featureFlags?.map((flag) => ( - - {flag.key} - - {isDefined(flag.key) && ( - - handleFeatureFlagUpdate(flag.key!, newValue) - } - /> - )} - - - ))} + {workspace.featureFlags?.map((flag) => { + const currentWorkspaceValue = + currentWorkspace?.id === workspaceId + ? currentWorkspace?.featureFlags?.find( + (f) => f.key === flag.key, + )?.value + : undefined; + const displayedValue = currentWorkspaceValue ?? flag.value; + return ( + + {flag.key} + + {isDefined(flag.key) && ( + + handleFeatureFlagUpdate(flag.key!, newValue) + } + /> + )} + + + ); + })} diff --git a/packages/twenty-ui/src/input/components/CardPicker.tsx b/packages/twenty-ui/src/input/components/CardPicker.tsx index eb9a4b0932..2c72a480f2 100644 --- a/packages/twenty-ui/src/input/components/CardPicker.tsx +++ b/packages/twenty-ui/src/input/components/CardPicker.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { styled } from '@linaria/react'; +import React from 'react'; import { themeCssVariables } from '@ui/theme-constants'; import { Radio } from './Radio'; @@ -8,16 +8,23 @@ const StyledSubscriptionCardContainer = styled.button` background-color: ${themeCssVariables.background.secondary}; border: 1px solid ${themeCssVariables.border.color.medium}; border-radius: ${themeCssVariables.border.radius.md}; + cursor: pointer; display: flex; - padding: ${themeCssVariables.spacing[4]} ${themeCssVariables.spacing[3]}; + padding: 0; position: relative; + text-align: left; width: 100%; :hover { - cursor: pointer; background: ${themeCssVariables.background.tertiary}; } `; +const StyledCardInner = styled.div` + display: flex; + padding: ${themeCssVariables.spacing[4]} ${themeCssVariables.spacing[3]}; + width: 100%; +`; + const StyledRadioContainer = styled.div` position: absolute; right: ${themeCssVariables.spacing[2]}; @@ -40,7 +47,7 @@ export const CardPicker = ({ - {children} + {children} ); };