Skip to content

The open alternative to Salesforce, designed for AI.

Regroup Communication settings under channel tabs (#28001)

neo773d074e2881943
diff --git a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
index 19efe67e102..f7eef0891b8 100644
--- a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
+++ b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
@@ -244,6 +244,14 @@ const SettingsWorkspaceUnsubscribe = lazy(() =>
),
);
+const SettingsWorkspaceBlocklist = lazy(() =>
+ import('~/pages/settings/communications/SettingsWorkspaceBlocklist').then(
+ (module) => ({
+ default: module.SettingsWorkspaceBlocklist,
+ }),
+ ),
+);
+
const SettingsSubdomainPage = lazy(() =>
import('~/pages/settings/domains/SettingsSubdomainPage').then((module) => ({
default: module.SettingsSubdomainPage,
@@ -857,6 +865,10 @@ const createSettingsRouteElements = ({
path={SettingsPath.Unsubscribe}
element={<SettingsWorkspaceUnsubscribe />}
/>
+ <Route
+ path={SettingsPath.WorkspaceBlocklist}
+ element={<SettingsWorkspaceBlocklist />}
+ />
<Route path={SettingsPath.Billing} element={<SettingsBilling />} />
<Route
path={SettingsPath.BillingPlans}
diff --git a/packages/twenty-front/src/modules/settings/workspace/components/ClickTrackingSwitch.tsx b/packages/twenty-front/src/modules/settings/workspace/components/ClickTrackingSwitch.tsx
index dc906adc4c8..2dc60b2a498 100644
--- a/packages/twenty-front/src/modules/settings/workspace/components/ClickTrackingSwitch.tsx
+++ b/packages/twenty-front/src/modules/settings/workspace/components/ClickTrackingSwitch.tsx
@@ -6,11 +6,14 @@ import { useMutation } from '@apollo/client/react';
import { t } from '@lingui/core/macro';
import { IconClick } from 'twenty-ui/icon';
import { useToast } from 'twenty-ui/components/feedback';
-import { Card } from 'twenty-ui/primitives/surfaces';
import { UpdateWorkspaceDocument } from '~/generated-metadata/graphql';
import { doNotTranslate } from 'twenty-shared/i18n';
-export const ClickTrackingSwitch = () => {
+type ClickTrackingSwitchProps = {
+ divider?: boolean;
+};
+
+export const ClickTrackingSwitch = ({ divider }: ClickTrackingSwitchProps) => {
const { enqueueToast } = useToast();
const [currentWorkspace, setCurrentWorkspace] = useAtomState(
currentWorkspaceState,
@@ -47,16 +50,15 @@ export const ClickTrackingSwitch = () => {
return (
<>
{currentWorkspace ? (
- <Card.Root>
- <SettingsOptionCardContentSwitch
- Icon={IconClick}
- title={t`Track link clicks`}
- description={t`Count clicks by routing campaign links through Twenty before the original page.`}
- checked={currentWorkspace.isCampaignClickTrackingEnabled}
- disabled={loading}
- onChange={handleChange}
- />
- </Card.Root>
+ <SettingsOptionCardContentSwitch
+ Icon={IconClick}
+ title={t`Track link clicks`}
+ description={t`Count clicks by routing campaign links through Twenty before the original page.`}
+ divider={divider}
+ checked={currentWorkspace.isCampaignClickTrackingEnabled}
+ disabled={loading}
+ onChange={handleChange}
+ />
) : null}
</>
);
diff --git a/packages/twenty-front/src/modules/settings/workspace/components/OpenTrackingSwitch.tsx b/packages/twenty-front/src/modules/settings/workspace/components/OpenTrackingSwitch.tsx
index e5b907ab5ad..aafcf7e9e75 100644
--- a/packages/twenty-front/src/modules/settings/workspace/components/OpenTrackingSwitch.tsx
+++ b/packages/twenty-front/src/modules/settings/workspace/components/OpenTrackingSwitch.tsx
@@ -6,11 +6,14 @@ import { useMutation } from '@apollo/client/react';
import { t } from '@lingui/core/macro';
import { IconEye } from 'twenty-ui/icon';
import { useToast } from 'twenty-ui/components';
-import { Card } from 'twenty-ui/primitives/surfaces';
import { UpdateWorkspaceDocument } from '~/generated-metadata/graphql';
import { doNotTranslate } from 'twenty-shared/i18n';
-export const OpenTrackingSwitch = () => {
+type OpenTrackingSwitchProps = {
+ divider?: boolean;
+};
+
+export const OpenTrackingSwitch = ({ divider }: OpenTrackingSwitchProps) => {
const { enqueueToast } = useToast();
const [currentWorkspace, setCurrentWorkspace] = useAtomState(
currentWorkspaceState,
@@ -47,16 +50,15 @@ export const OpenTrackingSwitch = () => {
return (
<>
{currentWorkspace ? (
- <Card.Root>
- <SettingsOptionCardContentSwitch
- Icon={IconEye}
- title={t`Track opens`}
- description={t`Count opens with an invisible image. Mail apps can block or preload it.`}
- checked={currentWorkspace.isCampaignOpenTrackingEnabled}
- disabled={loading}
- onChange={handleChange}
- />
- </Card.Root>
+ <SettingsOptionCardContentSwitch
+ Icon={IconEye}
+ title={t`Track opens`}
+ description={t`Count opens with an invisible image. Mail apps can block or preload it.`}
+ divider={divider}
+ checked={currentWorkspace.isCampaignOpenTrackingEnabled}
+ disabled={loading}
+ onChange={handleChange}
+ />
) : null}
</>
);
diff --git a/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceBlocklist.tsx b/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceBlocklist.tsx
new file mode 100644
index 00000000000..b7e213b7714
--- /dev/null
+++ b/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceBlocklist.tsx
@@ -0,0 +1,32 @@
+import { useLingui } from '@lingui/react/macro';
+
+import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
+import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
+import { SettingsWorkspaceBlocklistSection } from '@/settings/workspace/components/SettingsWorkspaceBlocklistSection';
+import { SettingsPath } from 'twenty-shared/types';
+import { getSettingsPath } from 'twenty-shared/utils';
+
+export const SettingsWorkspaceBlocklist = () => {
+ const { t } = useLingui();
+
+ return (
+ <SettingsPageLayout
+ title={t`Blocklist`}
+ links={[
+ {
+ children: t`Workspace`,
+ href: getSettingsPath(SettingsPath.General),
+ },
+ {
+ children: t`Communication`,
+ href: getSettingsPath(SettingsPath.WorkspaceCommunications),
+ },
+ { children: t`Blocklist` },
+ ]}
+ >
+ <SettingsPageContainer>
+ <SettingsWorkspaceBlocklistSection />
+ </SettingsPageContainer>
+ </SettingsPageLayout>
+ );
+};
diff --git a/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceCommunications.tsx b/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceCommunications.tsx
index f65e2337c3a..55078ebea47 100644
--- a/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceCommunications.tsx
+++ b/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceCommunications.tsx
@@ -5,21 +5,30 @@ import { SettingsPageContainer } from '@/settings/components/SettingsPageContain
import { SettingsDiscoveryHeroCard } from '@/settings/components/SettingsDiscoveryHeroCard';
import { ClickTrackingSwitch } from '@/settings/workspace/components/ClickTrackingSwitch';
import { OpenTrackingSwitch } from '@/settings/workspace/components/OpenTrackingSwitch';
-import { SettingsWorkspaceBlocklistSection } from '@/settings/workspace/components/SettingsWorkspaceBlocklistSection';
import { SettingsWorkspaceEmailGroupSection } from '@/settings/workspace/components/SettingsWorkspaceEmailGroupSection';
import { SettingsWorkspaceEmailSyncSection } from '@/settings/workspace/components/SettingsWorkspaceEmailSyncSection';
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
+import { SettingsTabBar } from '@/settings/components/layout/SettingsTabBar';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { FeatureFlagKey, SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
-import { IconMailX } from 'twenty-ui/icon';
+import {
+ IconBrandWhatsapp,
+ IconForbid,
+ IconMail,
+ IconMailX,
+ IconPhone,
+} from 'twenty-ui/icon';
+import { Card } from 'twenty-ui/primitives/surfaces';
import coverDark from '~/pages/settings/communications/assets/cover-dark.png';
import coverLight from '~/pages/settings/communications/assets/cover-light.png';
import { SettingsCard } from '@/settings/components/SettingsCard';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+const COMMUNICATIONS_TABS_INSTANCE_ID = 'settings-communications-tabs';
+
const StyledCardsColumn = styled.div`
display: flex;
flex-direction: column;
@@ -37,9 +46,34 @@ export const SettingsWorkspaceCommunications = () => {
FeatureFlagKey.IS_MESSAGE_CAMPAIGN_ENABLED,
);
+ const tabs = [
+ { id: 'emails', title: t`Emails`, Icon: IconMail },
+ {
+ id: 'whatsapp',
+ title: t`Whatsapp`,
+ Icon: IconBrandWhatsapp,
+ disabled: true,
+ pill: t`Soon`,
+ },
+ {
+ id: 'calls',
+ title: t`Calls`,
+ Icon: IconPhone,
+ disabled: true,
+ pill: t`Soon`,
+ },
+ ];
+
return (
<SettingsPageLayout
title={t`Communication`}
+ secondaryBar={
+ <SettingsTabBar
+ aria-label={t`Workspace communications`}
+ tabs={tabs}
+ componentInstanceId={COMMUNICATIONS_TABS_INSTANCE_ID}
+ />
+ }
links={[
{
children: t`Workspace`,
@@ -58,16 +92,35 @@ export const SettingsWorkspaceCommunications = () => {
/>
</Section.Root>
<SettingsWorkspaceEmailGroupSection />
+ <SettingsWorkspaceEmailSyncSection />
+ <Section.Root>
+ <Section.Header
+ title={t`Blocklist`}
+ description={t`Exclude the following people and domains from the email and calendar sync of every workspace member`}
+ />
+ <StyledCardsColumn>
+ <SettingsCard
+ Icon={
+ <IconForbid
+ size={theme.icon.size.lg}
+ stroke={theme.icon.stroke.md}
+ />
+ }
+ title={t`Manage blocklist`}
+ onClick={() => navigateSettings(SettingsPath.WorkspaceBlocklist)}
+ />
+ </StyledCardsColumn>
+ </Section.Root>
{isMessageCampaignFeatureEnabled && (
<Section.Root>
<Section.Header
title={t`Tracking`}
description={t`Measure engagement on the campaigns this workspace sends`}
/>
- <StyledCardsColumn>
+ <Card.Root>
+ <OpenTrackingSwitch divider />
<ClickTrackingSwitch />
- <OpenTrackingSwitch />
- </StyledCardsColumn>
+ </Card.Root>
</Section.Root>
)}
{isMessageCampaignFeatureEnabled && (
@@ -90,8 +143,6 @@ export const SettingsWorkspaceCommunications = () => {
</StyledCardsColumn>
</Section.Root>
)}
- <SettingsWorkspaceEmailSyncSection />
- <SettingsWorkspaceBlocklistSection />
</SettingsPageContainer>
</SettingsPageLayout>
);
diff --git a/packages/twenty-shared/src/types/SettingsPath.ts b/packages/twenty-shared/src/types/SettingsPath.ts
index f1711e3861c..8224dea736d 100644
--- a/packages/twenty-shared/src/types/SettingsPath.ts
+++ b/packages/twenty-shared/src/types/SettingsPath.ts
@@ -45,6 +45,7 @@ export enum SettingsPath {
NewUnsubscribeTopic = 'email/new-unsubscribe-topic',
UnsubscribeTopicDetail = 'email/unsubscribe-topic/:unsubscribeTopicId',
Unsubscribe = 'communications/unsubscribe',
+ WorkspaceBlocklist = 'communications/blocklist',
NewApprovedAccessDomain = 'security/approved-access-domain/new',
Community = 'community',
AI = 'ai',