The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Integrations: design fixes and remove feature flag (#4003)
Charles Bocheta5ecbf7df5c6
diff --git a/packages/twenty-front/public/images/integrations/Github.png b/packages/twenty-front/public/images/integrations/Github.pngdeleted file mode 100644index a8aff42a6e0..00000000000Binary files a/packages/twenty-front/public/images/integrations/Github.png and /dev/null differdiff --git a/packages/twenty-front/public/images/integrations/Cal.png b/packages/twenty-front/public/images/integrations/cal-logo.pngsimilarity index 100%rename from packages/twenty-front/public/images/integrations/Cal.pngrename to packages/twenty-front/public/images/integrations/cal-logo.pngdiff --git a/packages/twenty-front/public/images/integrations/github-logo.png b/packages/twenty-front/public/images/integrations/github-logo.pngnew file mode 100644index 00000000000..6cb3b705d01Binary files /dev/null and b/packages/twenty-front/public/images/integrations/github-logo.png differdiff --git a/packages/twenty-front/public/images/integrations/MailChimp.png b/packages/twenty-front/public/images/integrations/mailchimp-logo.pngsimilarity index 100%rename from packages/twenty-front/public/images/integrations/MailChimp.pngrename to packages/twenty-front/public/images/integrations/mailchimp-logo.pngdiff --git a/packages/twenty-front/public/images/integrations/Slack.png b/packages/twenty-front/public/images/integrations/slack-logo.pngsimilarity index 100%rename from packages/twenty-front/public/images/integrations/Slack.pngrename to packages/twenty-front/public/images/integrations/slack-logo.pngdiff --git a/packages/twenty-front/public/images/integrations/Tally.png b/packages/twenty-front/public/images/integrations/tally-logo.pngsimilarity index 100%rename from packages/twenty-front/public/images/integrations/Tally.pngrename to packages/twenty-front/public/images/integrations/tally-logo.pngdiff --git a/packages/twenty-front/public/images/integrations/Twenty.svg b/packages/twenty-front/public/images/integrations/twenty-logo.svgsimilarity index 100%rename from packages/twenty-front/public/images/integrations/Twenty.svgrename to packages/twenty-front/public/images/integrations/twenty-logo.svgdiff --git a/packages/twenty-front/public/images/integrations/Windmill.png b/packages/twenty-front/public/images/integrations/windmill-logo.pngsimilarity index 100%rename from packages/twenty-front/public/images/integrations/Windmill.pngrename to packages/twenty-front/public/images/integrations/windmill-logo.pngdiff --git a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsxindex d5ae7b3a7ac..b588faa30c3 100644--- a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx+++ b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx@@ -32,7 +32,6 @@ export const SettingsNavigationDrawerItems = () => {}, [signOut, navigate]);const isMessagingEnabled = useIsFeatureEnabled('IS_MESSAGING_ENABLED');- const isIntegrationsEnabled = useIsFeatureEnabled('IS_INTEGRATIONS_ENABLED');const isIntegrationsItemActive = !!useMatch({path: useResolvedPath('/settings/integrations').pathname,end: true,@@ -144,14 +143,12 @@ export const SettingsNavigationDrawerItems = () => {})}/>- {isIntegrationsEnabled && (- <NavigationDrawerItem- label="Integrations"- to="/settings/integrations"- Icon={IconApps}- active={isIntegrationsItemActive}- />- )}+ <NavigationDrawerItem+ label="Integrations"+ to="/settings/integrations"+ Icon={IconApps}+ active={isIntegrationsItemActive}+ /></NavigationDrawerSection><NavigationDrawerSection>diff --git a/packages/twenty-front/src/modules/workspace/types/FeatureFlagKey.ts b/packages/twenty-front/src/modules/workspace/types/FeatureFlagKey.tsindex 3d23fb7d26e..b0b10fef244 100644--- a/packages/twenty-front/src/modules/workspace/types/FeatureFlagKey.ts+++ b/packages/twenty-front/src/modules/workspace/types/FeatureFlagKey.ts@@ -1,6 +1,5 @@export type FeatureFlagKey =| 'IS_MESSAGING_ENABLED'| 'IS_BLOCKLIST_ENABLED'- | 'IS_INTEGRATIONS_ENABLED'| 'IS_QUICK_ACTIONS_ENABLED'| 'IS_NEW_RECORD_BOARD_ENABLED';diff --git a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationComponent.tsx b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationComponent.tsxindex 19345b70206..0886dbd6543 100644--- a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationComponent.tsx+++ b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationComponent.tsx@@ -1,12 +1,12 @@-import { useTheme } from '@emotion/react';import styled from '@emotion/styled';-import { SoonPill } from 'tsup.ui.index';import { IconArrowUpRight, IconBolt } from '@/ui/display/icon';+import { SoonPill } from '@/ui/display/pill/components/SoonPill';+import { Button } from '@/ui/input/button/components/Button';+import { SettingsIntegration } from '~/pages/settings/integrations/types/SettingsIntegration';-import { Integration, IntegrationType } from './constants/IntegrationTypes';interface SettingsIntegrationComponentProps {- integration: Integration;+ integration: SettingsIntegration;}const StyledContainer = styled.div`@@ -36,20 +36,6 @@ const StyledIntegrationLogo = styled.div`color: ${({ theme }) => theme.border.color.strong};`;-const StyledButton = styled.button`- align-items: center;- background: ${({ theme }) => theme.background.secondary};- border: 1px solid ${({ theme }) => theme.border.color.light};- border-radius: ${({ theme }) => theme.border.radius.sm};- color: ${({ theme }) => theme.font.color.secondary};- display: flex;- flex-direction: row;- font-size: ${({ theme }) => theme.font.size.md};- gap: ${({ theme }) => theme.spacing(1)};- padding: ${({ theme }) => theme.spacing(1)} ${({ theme }) => theme.spacing(2)};- cursor: pointer;-`;-const StyledSoonPill = styled(SoonPill)`padding: ${({ theme }) => theme.spacing(1)} ${({ theme }) => theme.spacing(2)};`;@@ -62,7 +48,6 @@ const StyledLogo = styled.img`export const SettingsIntegrationComponent = ({integration,}: SettingsIntegrationComponentProps) => {- const theme = useTheme();const openLinkInTab = (link: string) => {window.open(link);};@@ -83,21 +68,15 @@ export const SettingsIntegrationComponent = ({</StyledIntegrationLogo>{integration.text}</StyledSection>- {integration.type === IntegrationType.Soon ? (+ {integration.type === 'Soon' ? (<StyledSoonPill />) : (- <StyledButton onClick={() => openLinkInTab(integration.link)}>- {integration.type === IntegrationType.Use ? (- <IconBolt size={theme.icon.size.md} />- ) : (- <IconArrowUpRight size={theme.icon.size.md} />- )}- {integration.type === IntegrationType.Goto ? (- <div>{integration.linkText}</div>- ) : (- <div>Use</div>- )}- </StyledButton>+ <Button+ onClick={() => openLinkInTab(integration.link)}+ Icon={integration.type === 'Goto' ? IconArrowUpRight : IconBolt}+ title={integration.type === 'Goto' ? integration.linkText : 'Use'}+ size="small"+ />)}</StyledContainer>);diff --git a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationGroup.tsx b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationGroup.tsxindex f742d7d69ba..1ad1efa465b 100644--- a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationGroup.tsx+++ b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationGroup.tsx@@ -3,11 +3,10 @@ import styled from '@emotion/styled';import { H2Title } from '@/ui/display/typography/components/H2Title';import { Section } from '@/ui/layout/section/components/Section';import { SettingsIntegrationComponent } from '~/pages/settings/integrations/SettingsIntegrationComponent';--import { IntegrationCategory } from './constants/IntegrationTypes';+import { SettingsIntegrationCategory } from '~/pages/settings/integrations/types/SettingsIntegrationCategory';interface SettingsIntegrationGroupProps {- integrationGroup: IntegrationCategory;+ integrationGroup: SettingsIntegrationCategory;}const StyledIntegrationGroupHeader = styled.div`diff --git a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrations.tsx b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrations.tsxindex c488bf17962..616b2d19a34 100644--- a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrations.tsx+++ b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrations.tsx@@ -2,16 +2,15 @@ import { SettingsPageContainer } from '@/settings/components/SettingsPageContainimport { IconSettings } from '@/ui/display/icon';import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb';+import { SETTINGS_INTEGRATION_CATEGORIES } from '~/pages/settings/integrations/constants/SettingsIntegrationCategories';import { SettingsIntegrationGroup } from '~/pages/settings/integrations/SettingsIntegrationGroup';-import integrationCategories from './constants/Integrations';-export const SettingsIntegrations = () => {return (<SubMenuTopBarContainer Icon={IconSettings} title="Settings"><SettingsPageContainer><Breadcrumb links={[{ children: 'Integrations' }]} />- {integrationCategories.map((group) => {+ {SETTINGS_INTEGRATION_CATEGORIES.map((group) => {return <SettingsIntegrationGroup integrationGroup={group} />;})}</SettingsPageContainer>diff --git a/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrations.stories.tsx b/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrations.stories.tsxnew file mode 100644index 00000000000..a0032bbf618--- /dev/null+++ b/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrations.stories.tsx@@ -0,0 +1,34 @@+import { Meta, StoryObj } from '@storybook/react';+import { within } from '@storybook/test';++import { SettingsIntegrations } from '~/pages/settings/integrations/SettingsIntegrations';+import {+ PageDecorator,+ PageDecoratorArgs,+} from '~/testing/decorators/PageDecorator';+import { graphqlMocks } from '~/testing/graphqlMocks';+import { sleep } from '~/testing/sleep';++const meta: Meta<PageDecoratorArgs> = {+ title: 'Pages/Settings/Integrations/SettingsIntegrations',+ component: SettingsIntegrations,+ decorators: [PageDecorator],+ args: { routePath: '/settings/integrations' },+ parameters: {+ msw: graphqlMocks,+ },+};++export default meta;++export type Story = StoryObj<typeof SettingsIntegrations>;++export const Default: Story = {+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);++ await sleep(1000);++ await canvas.findByText('Go to GitHub');+ },+};diff --git a/packages/twenty-front/src/pages/settings/integrations/constants/IntegrationTypes.ts b/packages/twenty-front/src/pages/settings/integrations/constants/IntegrationTypes.tsdeleted file mode 100644index 37eca610dac..00000000000--- a/packages/twenty-front/src/pages/settings/integrations/constants/IntegrationTypes.ts+++ /dev/null@@ -1,22 +0,0 @@-export enum IntegrationType {- Use = 'Use',- Goto = 'Goto',- Soon = 'Soon',-}--export interface Integration {- from: { key: string; image: string };- to: { key: string; image: string } | null;- type: IntegrationType;- linkText?: string;- link: string;- text: string;-}--export interface IntegrationCategory {- key: string;- title: string;- hyperlinkText?: string;- hyperlink: string | null;- integrations: Integration[];-}diff --git a/packages/twenty-front/src/pages/settings/integrations/constants/Integrations.ts b/packages/twenty-front/src/pages/settings/integrations/constants/Integrations.tsdeleted file mode 100644index cf1f1ae785c..00000000000--- a/packages/twenty-front/src/pages/settings/integrations/constants/Integrations.ts+++ /dev/null@@ -1,12 +0,0 @@-import { IntegrationCategory } from './IntegrationTypes';-import requestIntegrations from './Request';-import windmillIntegrations from './Windmill';-import zapierIntegrations from './Zapier';--const integrationCategories: IntegrationCategory[] = [- zapierIntegrations,- windmillIntegrations,- requestIntegrations,-];--export default integrationCategories;diff --git a/packages/twenty-front/src/pages/settings/integrations/constants/Request.ts b/packages/twenty-front/src/pages/settings/integrations/constants/Request.tsdeleted file mode 100644index 92a15fef489..00000000000--- a/packages/twenty-front/src/pages/settings/integrations/constants/Request.ts+++ /dev/null@@ -1,19 +0,0 @@-import { IntegrationCategory, IntegrationType } from './IntegrationTypes';--const requestIntegrations: IntegrationCategory = {- key: 'request',- title: 'Request an integration',- hyperlink: null,- integrations: [- {- from: { key: 'github', image: '/images/integrations/Github.png' },- to: null,- type: IntegrationType.Goto,- text: 'Request an integration on Github conversations',- link: 'https://github.com/twentyhq/twenty/issues/new/choose',- linkText: 'Go to GitHub',- },- ],-};--export default requestIntegrations;diff --git a/packages/twenty-front/src/pages/settings/integrations/constants/SettingsIntegrationCategories.ts b/packages/twenty-front/src/pages/settings/integrations/constants/SettingsIntegrationCategories.tsnew file mode 100644index 00000000000..c233445cb46--- /dev/null+++ b/packages/twenty-front/src/pages/settings/integrations/constants/SettingsIntegrationCategories.ts@@ -0,0 +1,10 @@+import { SETTINGS_INTEGRATION_REQUEST_CATEGORY } from '~/pages/settings/integrations/constants/SettingsIntegrationRequest';+import { SETTINGS_INTEGRATION_WINDMILL_CATEGORY } from '~/pages/settings/integrations/constants/SettingsIntegrationWindmill';+import { SETTINGS_INTEGRATION_ZAPIER_CATEGORY } from '~/pages/settings/integrations/constants/SettingsIntegrationZapier';+import { SettingsIntegrationCategory } from '~/pages/settings/integrations/types/SettingsIntegrationCategory';++export const SETTINGS_INTEGRATION_CATEGORIES: SettingsIntegrationCategory[] = [+ SETTINGS_INTEGRATION_ZAPIER_CATEGORY,+ SETTINGS_INTEGRATION_WINDMILL_CATEGORY,+ SETTINGS_INTEGRATION_REQUEST_CATEGORY,+];diff --git a/packages/twenty-front/src/pages/settings/integrations/constants/SettingsIntegrationRequest.ts b/packages/twenty-front/src/pages/settings/integrations/constants/SettingsIntegrationRequest.tsnew file mode 100644index 00000000000..084959da056--- /dev/null+++ b/packages/twenty-front/src/pages/settings/integrations/constants/SettingsIntegrationRequest.ts@@ -0,0 +1,18 @@+import { SettingsIntegrationCategory } from '~/pages/settings/integrations/types/SettingsIntegrationCategory';++export const SETTINGS_INTEGRATION_REQUEST_CATEGORY: SettingsIntegrationCategory =+ {+ key: 'request',+ title: 'Request an integration',+ hyperlink: null,+ integrations: [+ {+ from: { key: 'github', image: '/images/integrations/github-logo.png' },+ to: null,+ type: 'Goto',+ text: 'Request an integration on Github conversations',+ link: 'https://github.com/twentyhq/twenty/discussions/categories/ideas',+ linkText: 'Go to GitHub',+ },+ ],+ };diff --git a/packages/twenty-front/src/pages/settings/integrations/constants/SettingsIntegrationWindmill.ts b/packages/twenty-front/src/pages/settings/integrations/constants/SettingsIntegrationWindmill.tsnew file mode 100644index 00000000000..45452a6b4c6--- /dev/null+++ b/packages/twenty-front/src/pages/settings/integrations/constants/SettingsIntegrationWindmill.ts@@ -0,0 +1,21 @@+import { SettingsIntegrationCategory } from '~/pages/settings/integrations/types/SettingsIntegrationCategory';++export const SETTINGS_INTEGRATION_WINDMILL_CATEGORY: SettingsIntegrationCategory =+ {+ key: 'windmill',+ title: 'With Windmill',+ hyperlink: null,+ integrations: [+ {+ from: {+ key: 'windmill',+ image: '/images/integrations/windmill-logo.png',+ },+ to: null,+ type: 'Goto',+ text: 'Create a workflow with Windmill',+ link: 'https://www.windmill.dev',+ linkText: 'Go to Windmill',+ },+ ],+ };diff --git a/packages/twenty-front/src/pages/settings/integrations/constants/SettingsIntegrationZapier.ts b/packages/twenty-front/src/pages/settings/integrations/constants/SettingsIntegrationZapier.tsnew file mode 100644index 00000000000..a331d819a20--- /dev/null+++ b/packages/twenty-front/src/pages/settings/integrations/constants/SettingsIntegrationZapier.ts@@ -0,0 +1,42 @@+import { SettingsIntegrationCategory } from '~/pages/settings/integrations/types/SettingsIntegrationCategory';++export const SETTINGS_INTEGRATION_ZAPIER_CATEGORY: SettingsIntegrationCategory =+ {+ key: 'zapier',+ title: 'With Zapier',+ hyperlinkText: 'See all zaps',+ hyperlink: 'https://zapier.com/apps/twenty/integrations',+ integrations: [+ {+ from: { key: 'twenty', image: '/images/integrations/twenty-logo.svg' },+ to: { key: 'slack', image: '/images/integrations/slack-logo.png' },+ type: 'Use',+ text: 'Post to Slack when a company is updated',+ link: 'https://zapier.com/apps/twenty/integrations/slack',+ },+ {+ from: { key: 'cal', image: '/images/integrations/cal-logo.png' },+ to: { key: 'twenty', image: '/images/integrations/twenty-logo.svg' },+ type: 'Use',+ text: 'Create a person when Cal.com event is created',+ link: 'https://zapier.com/apps/twenty/integrations/calcom',+ },+ {+ from: {+ key: 'mailchimp',+ image: '/images/integrations/mailchimp-logo.png',+ },+ to: { key: 'twenty', image: '/images/integrations/twenty-logo.svg' },+ type: 'Use',+ text: 'Create a person when a MailChimp sub is created',+ link: 'https://zapier.com/apps/twenty/integrations/mailchimp',+ },+ {+ from: { key: 'tally', image: '/images/integrations/tally-logo.png' },+ to: { key: 'twenty', image: '/images/integrations/twenty-logo.svg' },+ type: 'Use',+ text: 'Create a company when a Tally form is sent',+ link: 'https://zapier.com/apps/twenty/integrations/tally',+ },+ ],+ };diff --git a/packages/twenty-front/src/pages/settings/integrations/constants/Windmill.ts b/packages/twenty-front/src/pages/settings/integrations/constants/Windmill.tsdeleted file mode 100644index 4711837db15..00000000000--- a/packages/twenty-front/src/pages/settings/integrations/constants/Windmill.ts+++ /dev/null@@ -1,19 +0,0 @@-import { IntegrationCategory, IntegrationType } from './IntegrationTypes';--const windmillIntegrations: IntegrationCategory = {- key: 'windmill',- title: 'With Windmill',- hyperlink: null,- integrations: [- {- from: { key: 'windmill', image: '/images/integrations/Windmill.png' },- to: null,- type: IntegrationType.Goto,- text: 'Create a workflow with Windmill',- link: 'https://www.windmill.dev',- linkText: 'Go to Windmill',- },- ],-};--export default windmillIntegrations;diff --git a/packages/twenty-front/src/pages/settings/integrations/constants/Zapier.ts b/packages/twenty-front/src/pages/settings/integrations/constants/Zapier.tsdeleted file mode 100644index 75b0a506433..00000000000--- a/packages/twenty-front/src/pages/settings/integrations/constants/Zapier.ts+++ /dev/null@@ -1,40 +0,0 @@-import { IntegrationCategory, IntegrationType } from './IntegrationTypes';--const zapierIntegrations: IntegrationCategory = {- key: 'zapier',- title: 'With Zapier',- hyperlinkText: 'See all zaps',- hyperlink: 'https://zapier.com/apps/twenty/integrations',- integrations: [- {- from: { key: 'twenty', image: '/images/integrations/Twenty.svg' },- to: { key: 'slack', image: '/images/integrations/Slack.png' },- type: IntegrationType.Use,- text: 'Post to Slack when a company is updated',- link: 'https://zapier.com/apps/twenty/integrations/slack',- },- {- from: { key: 'cal', image: '/images/integrations/Cal.png' },- to: { key: 'twenty', image: '/images/integrations/Twenty.svg' },- type: IntegrationType.Use,- text: 'Create a person when Cal.com event is created',- link: 'https://zapier.com/apps/twenty/integrations/calcom',- },- {- from: { key: 'mailchimp', image: '/images/integrations/MailChimp.png' },- to: { key: 'twenty', image: '/images/integrations/Twenty.svg' },- type: IntegrationType.Use,- text: 'Create a person when a MailChimp sub is created',- link: 'https://zapier.com/apps/twenty/integrations/mailchimp',- },- {- from: { key: 'tally', image: '/images/integrations/Tally.png' },- to: { key: 'twenty', image: '/images/integrations/Twenty.svg' },- type: IntegrationType.Use,- text: 'Create a company when a Tally form is sent',- link: 'https://zapier.com/apps/twenty/integrations/tally',- },- ],-};--export default zapierIntegrations;diff --git a/packages/twenty-front/src/pages/settings/integrations/types/SettingsIntegration.ts b/packages/twenty-front/src/pages/settings/integrations/types/SettingsIntegration.tsnew file mode 100644index 00000000000..d132ce13aba--- /dev/null+++ b/packages/twenty-front/src/pages/settings/integrations/types/SettingsIntegration.ts@@ -0,0 +1,10 @@+export type SettingsIntegrationType = 'Use' | 'Goto' | 'Soon';++export type SettingsIntegration = {+ from: { key: string; image: string };+ to: { key: string; image: string } | null;+ type: SettingsIntegrationType;+ linkText?: string;+ link: string;+ text: string;+};diff --git a/packages/twenty-front/src/pages/settings/integrations/types/SettingsIntegrationCategory.ts b/packages/twenty-front/src/pages/settings/integrations/types/SettingsIntegrationCategory.tsnew file mode 100644index 00000000000..661689679a2--- /dev/null+++ b/packages/twenty-front/src/pages/settings/integrations/types/SettingsIntegrationCategory.ts@@ -0,0 +1,9 @@+import { SettingsIntegration } from '~/pages/settings/integrations/types/SettingsIntegration';++export type SettingsIntegrationCategory = {+ key: string;+ title: string;+ hyperlinkText?: string;+ hyperlink: string | null;+ integrations: SettingsIntegration[];+};diff --git a/packages/twenty-server/src/core/feature-flag/feature-flag.entity.ts b/packages/twenty-server/src/core/feature-flag/feature-flag.entity.tsindex d09f135c8b4..f106028ba8d 100644--- a/packages/twenty-server/src/core/feature-flag/feature-flag.entity.ts+++ b/packages/twenty-server/src/core/feature-flag/feature-flag.entity.ts@@ -14,7 +14,6 @@ import { IDField } from '@ptc-org/nestjs-query-graphql';import { Workspace } from 'src/core/workspace/workspace.entity';export enum FeatureFlagKeys {- IsIntegrationsEnabled = 'IS_INTEGRATIONS_ENABLED',IsMessagingEnabled = 'IS_MESSAGING_ENABLED',IsBlocklistEnabled = 'IS_BLOCKLIST_ENABLED',IsWorkspaceCleanable = 'IS_WORKSPACE_CLEANABLE',