feat(messaging): add workspace toggle to sync internal emails (#20457)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -85,6 +85,7 @@ const mockWorkspace = {
|
||||
routerModel: 'auto',
|
||||
enabledAiModelIds: [],
|
||||
useRecommendedModels: true,
|
||||
isInternalMessagesImportEnabled: false,
|
||||
workspaceCustomApplication: CUSTOM_WORKSPACE_APPLICATION_MOCK,
|
||||
workspaceCustomApplicationId: CUSTOM_WORKSPACE_APPLICATION_MOCK.id,
|
||||
installedApplications: [],
|
||||
|
||||
@@ -42,6 +42,7 @@ export type CurrentWorkspace = Pick<
|
||||
| 'editableProfileFields'
|
||||
| 'enabledAiModelIds'
|
||||
| 'useRecommendedModels'
|
||||
| 'isInternalMessagesImportEnabled'
|
||||
> & {
|
||||
defaultRole?: Omit<Role, 'workspaceMembers' | 'agents' | 'apiKeys'> | null;
|
||||
workspaceCustomApplication: Pick<Application, 'id'> | null;
|
||||
|
||||
+1
@@ -75,6 +75,7 @@ describe('useColumnDefinitionsFromObjectMetadata', () => {
|
||||
smartModel: AUTO_SELECT_SMART_MODEL_ID,
|
||||
enabledAiModelIds: [],
|
||||
useRecommendedModels: true,
|
||||
isInternalMessagesImportEnabled: false,
|
||||
});
|
||||
|
||||
const companyObjectMetadata = getTestEnrichedObjectMetadataItemsMock().find(
|
||||
|
||||
+10
-1
@@ -1,4 +1,5 @@
|
||||
import { type BlocklistItem } from '@/accounts/types/BlocklistItem';
|
||||
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
|
||||
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
|
||||
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
|
||||
import { CoreObjectNameSingular } from 'twenty-shared/types';
|
||||
@@ -16,9 +17,13 @@ export const SettingsAccountsBlocklistSection = () => {
|
||||
const { t } = useLingui();
|
||||
|
||||
const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
|
||||
const currentWorkspace = useAtomStateValue(currentWorkspaceState);
|
||||
|
||||
const currentWorkspaceMemberId = currentWorkspaceMember?.id ?? '';
|
||||
|
||||
const isInternalMessagesImportEnabled =
|
||||
currentWorkspace?.isInternalMessagesImportEnabled ?? false;
|
||||
|
||||
const { records: blocklist } = useFindManyRecords<BlocklistItem>({
|
||||
objectNameSingular: CoreObjectNameSingular.Blocklist,
|
||||
filter: {
|
||||
@@ -53,7 +58,11 @@ export const SettingsAccountsBlocklistSection = () => {
|
||||
<Section>
|
||||
<H2Title
|
||||
title={t`Blocklist`}
|
||||
description={t`Exclude the following people and domains from my email sync. Internal conversations will not be imported`}
|
||||
description={
|
||||
isInternalMessagesImportEnabled
|
||||
? t`Exclude the following people and domains from my email sync.`
|
||||
: t`Exclude the following people and domains from my email sync. Internal conversations will not be imported`
|
||||
}
|
||||
/>
|
||||
<SettingsAccountsBlocklistInput
|
||||
blockedEmailOrDomainList={blocklist.map((item) => item.handle)}
|
||||
|
||||
@@ -104,6 +104,7 @@ export const USER_QUERY_FRAGMENT = gql`
|
||||
trashRetentionDays
|
||||
eventLogRetentionDays
|
||||
editableProfileFields
|
||||
isInternalMessagesImportEnabled
|
||||
}
|
||||
availableWorkspaces {
|
||||
...AvailableWorkspacesFragment
|
||||
|
||||
@@ -16,6 +16,7 @@ export const UPDATE_WORKSPACE = gql`
|
||||
isMicrosoftAuthEnabled
|
||||
isPasswordAuthEnabled
|
||||
isTwoFactorAuthenticationEnforced
|
||||
isInternalMessagesImportEnabled
|
||||
defaultRole {
|
||||
...RoleFragment
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user