Skip to content

Commit 46690a2

Browse files
authored
Front: Display Intercom connections as coming soon (#2569)
* Front: Display Intercom connections as coming soon * Apply Gab's feedback
1 parent 3fe2359 commit 46690a2

File tree

20 files changed

+116
-9
lines changed

20 files changed

+116
-9
lines changed

front/admin/cli.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ const workspace = async (command: string, args: parseArgs.ParsedArgs) => {
8181
console.log(
8282
` managed Github: ${plan.limits.connections.isGithubAllowed}`
8383
);
84+
console.log(
85+
` managed Intercom: ${plan.limits.connections.isIntercomAllowed}`
86+
);
8487
console.log(
8588
` managed Google Drive: ${plan.limits.connections.isGoogleDriveAllowed}`
8689
);

front/components/ConnectorPermissionsModal.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const CONNECTOR_TYPE_TO_RESOURCE_NAME: Record<ConnectorProvider, string> = {
2020
google_drive: "Google Drive folders",
2121
slack: "Slack channels",
2222
github: "GitHub repositories",
23+
intercom: "Intercom Help Center articles",
2324
};
2425

2526
const CONNECTOR_TYPE_TO_RESOURCE_LIST_TITLE_TEXT: Record<
@@ -30,6 +31,7 @@ const CONNECTOR_TYPE_TO_RESOURCE_LIST_TITLE_TEXT: Record<
3031
notion: null,
3132
google_drive: null,
3233
github: null,
34+
intercom: null,
3335
};
3436

3537
const CONNECTOR_TYPE_TO_DEFAULT_PERMISSION_TITLE_TEXT: Record<
@@ -40,6 +42,7 @@ const CONNECTOR_TYPE_TO_DEFAULT_PERMISSION_TITLE_TEXT: Record<
4042
notion: null,
4143
google_drive: null,
4244
github: null,
45+
intercom: null,
4346
};
4447

4548
const PERMISSIONS_EDITABLE_CONNECTOR_TYPES: Set<ConnectorProvider> = new Set([

front/components/ConnectorPermissionsTree.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const CONNECTOR_TYPE_TO_PERMISSIONS: Record<
3131
},
3232
notion: undefined,
3333
github: undefined,
34+
intercom: undefined,
3435
};
3536

3637
function PermissionTreeChildren({

front/components/assistant_builder/AssistantBuilder.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export const CONNECTOR_PROVIDER_TO_RESOURCE_NAME: Record<
103103
google_drive: { singular: "folder", plural: "folders" },
104104
slack: { singular: "channel", plural: "channels" },
105105
github: { singular: "repository", plural: "repositories" },
106+
intercom: { singular: "article", plural: "articles" },
106107
};
107108

108109
export type AssistantBuilderDataSourceConfiguration = {

front/components/assistant_builder/shared.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const CONNECTOR_PROVIDER_TO_RESOURCE_NAME: Record<
2626
google_drive: { singular: "folder", plural: "folders" },
2727
slack: { singular: "channel", plural: "channels" },
2828
github: { singular: "repository", plural: "repositories" },
29+
intercom: { singular: "article", plural: "articles" },
2930
};
3031

3132
export const DROID_AVATARS_BASE_PATH = "/static/droidavatar/";

front/components/poke/plans/form.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
DropdownMenu,
55
GithubLogo,
66
Input,
7+
IntercomLogo,
78
NotionLogo,
89
SlackLogo,
910
} from "@dust-tt/sparkle";
@@ -21,6 +22,7 @@ export type EditingPlanType = {
2122
isNotionAllowed: boolean;
2223
isGoogleDriveAllowed: boolean;
2324
isGithubAllowed: boolean;
25+
isIntercomAllowed: boolean;
2426
maxMessages: string | number;
2527
dataSourcesCount: string | number;
2628
dataSourcesDocumentsCount: string | number;
@@ -40,6 +42,7 @@ export const fromPlanType = (plan: PlanType): EditingPlanType => {
4042
isNotionAllowed: plan.limits.connections.isNotionAllowed,
4143
isGoogleDriveAllowed: plan.limits.connections.isGoogleDriveAllowed,
4244
isGithubAllowed: plan.limits.connections.isGithubAllowed,
45+
isIntercomAllowed: plan.limits.connections.isIntercomAllowed,
4346
maxMessages: plan.limits.assistant.maxMessages,
4447
dataSourcesCount: plan.limits.dataSources.count,
4548
dataSourcesDocumentsCount: plan.limits.dataSources.documents.count,
@@ -64,6 +67,7 @@ export const toPlanType = (editingPlan: EditingPlanType): PlanType => {
6467
isNotionAllowed: editingPlan.isNotionAllowed,
6568
isGoogleDriveAllowed: editingPlan.isGoogleDriveAllowed,
6669
isGithubAllowed: editingPlan.isGithubAllowed,
70+
isIntercomAllowed: editingPlan.isIntercomAllowed,
6771
},
6872
dataSources: {
6973
count: parseInt(editingPlan.dataSourcesCount.toString(), 10),
@@ -92,6 +96,7 @@ const getEmptyPlan = (): EditingPlanType => ({
9296
isNotionAllowed: false,
9397
isGoogleDriveAllowed: false,
9498
isGithubAllowed: false,
99+
isIntercomAllowed: false,
95100
maxMessages: "",
96101
dataSourcesCount: "",
97102
dataSourcesDocumentsCount: "",
@@ -199,6 +204,12 @@ export const PLAN_FIELDS = {
199204
title: "Github",
200205
IconComponent: () => <GithubLogo className="h-4 w-4" />,
201206
},
207+
isIntercomAllowed: {
208+
type: "boolean",
209+
width: "tiny",
210+
title: "Intercom",
211+
IconComponent: () => <IntercomLogo className="h-4 w-4" />,
212+
},
202213
maxMessages: {
203214
type: "number",
204215
width: "medium",

front/lib/auth.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ export async function subscriptionForWorkspace(
540540
isNotionAllowed: plan.isManagedNotionAllowed,
541541
isGoogleDriveAllowed: plan.isManagedGoogleDriveAllowed,
542542
isGithubAllowed: plan.isManagedGithubAllowed,
543+
isIntercomAllowed: plan.isManagedIntercomAllowed,
543544
},
544545
dataSources: {
545546
count: plan.maxDataSourcesCount,

front/lib/connector_providers.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
import { DriveLogo, GithubLogo, NotionLogo, SlackLogo } from "@dust-tt/sparkle";
1+
import {
2+
DriveLogo,
3+
GithubLogo,
4+
IntercomLogo,
5+
NotionLogo,
6+
SlackLogo,
7+
} from "@dust-tt/sparkle";
28

39
import { ConnectorProvider } from "@app/lib/connectors_api";
10+
import { isDevelopment } from "@app/lib/development";
411

512
export const CONNECTOR_CONFIGURATIONS: Record<
613
ConnectorProvider,
@@ -54,4 +61,14 @@ export const CONNECTOR_CONFIGURATIONS: Record<
5461
logoComponent: GithubLogo,
5562
isNested: false,
5663
},
64+
intercom: {
65+
name: "Intercom",
66+
connectorProvider: "intercom",
67+
isBuilt: isDevelopment(), // TODO @daph Activate Intercom connector
68+
logoPath: "/static/intercom_32x32.png",
69+
description:
70+
"Authorize granular access to your company's Intercom Help Centers. Dust does not access your conversations.",
71+
logoComponent: IntercomLogo,
72+
isNested: false,
73+
},
5774
};

front/lib/connectors_api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ const CONNECTOR_PROVIDERS = [
2222
"notion",
2323
"github",
2424
"google_drive",
25+
"intercom",
2526
] as const;
2627
export type ConnectorProvider = (typeof CONNECTOR_PROVIDERS)[number];
2728
export const CONNECTOR_PROVIDERS_USING_NANGO = [
2829
"slack",
2930
"notion",
3031
"google_drive",
32+
"intercom",
3133
] as const;
3234
type ConnectorProviderUsingNango =
3335
(typeof CONNECTOR_PROVIDERS_USING_NANGO)[number];

front/lib/data_sources.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export function getProviderLogoPathForDataSource(
2121
return `/static/github_black_32x32.png`;
2222
case "google_drive":
2323
return `/static/google_drive_32x32.png`;
24-
24+
case "intercom":
25+
return `/static/intercom_32x32.png`;
2526
default:
2627
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2728
((_provider: never) => {

front/lib/models/plan.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export class Plan extends Model<
4141
declare isManagedNotionAllowed: boolean;
4242
declare isManagedGoogleDriveAllowed: boolean;
4343
declare isManagedGithubAllowed: boolean;
44+
declare isManagedIntercomAllowed: boolean;
4445
declare maxDataSourcesCount: number;
4546
declare maxDataSourcesDocumentsCount: number;
4647
declare maxDataSourcesDocumentsSizeMb: number;
@@ -110,6 +111,10 @@ Plan.init(
110111
type: DataTypes.BOOLEAN,
111112
defaultValue: false,
112113
},
114+
isManagedIntercomAllowed: {
115+
type: DataTypes.BOOLEAN,
116+
defaultValue: false,
117+
},
113118
maxDataSourcesCount: {
114119
type: DataTypes.INTEGER,
115120
allowNull: false,

front/lib/plans/enterprise_plans.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const ENT_PLAN_FAKE_DATA: PlanAttributes = {
3030
isManagedNotionAllowed: true,
3131
isManagedGoogleDriveAllowed: true,
3232
isManagedGithubAllowed: true,
33+
isManagedIntercomAllowed: true,
3334
maxDataSourcesCount: -1,
3435
maxDataSourcesDocumentsCount: -1,
3536
maxDataSourcesDocumentsSizeMb: 2,

front/lib/plans/free_plans.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const FREE_TEST_PLAN_DATA: PlanAttributes = {
3636
isManagedNotionAllowed: false,
3737
isManagedGoogleDriveAllowed: false,
3838
isManagedGithubAllowed: false,
39+
isManagedIntercomAllowed: false,
3940
maxDataSourcesCount: 5,
4041
maxDataSourcesDocumentsCount: 10,
4142
maxDataSourcesDocumentsSizeMb: 2,
@@ -58,6 +59,7 @@ const FREE_PLANS_DATA: PlanAttributes[] = [
5859
isManagedNotionAllowed: true,
5960
isManagedGoogleDriveAllowed: true,
6061
isManagedGithubAllowed: true,
62+
isManagedIntercomAllowed: true,
6163
maxDataSourcesCount: -1,
6264
maxDataSourcesDocumentsCount: -1,
6365
maxDataSourcesDocumentsSizeMb: 2,

front/lib/plans/pro_plans.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ if (isDevelopment()) {
4040
isManagedNotionAllowed: true,
4141
isManagedGoogleDriveAllowed: true,
4242
isManagedGithubAllowed: true,
43+
isManagedIntercomAllowed: true,
4344
maxDataSourcesCount: -1,
4445
maxDataSourcesDocumentsCount: -1,
4546
maxDataSourcesDocumentsSizeMb: 2,

front/lib/plans/subscription.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export const internalSubscribeWorkspaceToFreeTestPlan = async ({
8282
isNotionAllowed: freeTestPlan.isManagedNotionAllowed,
8383
isGoogleDriveAllowed: freeTestPlan.isManagedGoogleDriveAllowed,
8484
isGithubAllowed: freeTestPlan.isManagedGithubAllowed,
85+
isIntercomAllowed: freeTestPlan.isManagedIntercomAllowed,
8586
},
8687
dataSources: {
8788
count: freeTestPlan.maxDataSourcesCount,
@@ -178,6 +179,7 @@ export const internalSubscribeWorkspaceToFreeUpgradedPlan = async ({
178179
isNotionAllowed: plan.isManagedNotionAllowed,
179180
isGoogleDriveAllowed: plan.isManagedGoogleDriveAllowed,
180181
isGithubAllowed: plan.isManagedGithubAllowed,
182+
isIntercomAllowed: plan.isManagedIntercomAllowed,
181183
},
182184
dataSources: {
183185
count: plan.maxDataSourcesCount,
@@ -332,6 +334,7 @@ export const getCheckoutUrlForUpgrade = async (
332334
isNotionAllowed: plan.isManagedNotionAllowed,
333335
isGoogleDriveAllowed: plan.isManagedGoogleDriveAllowed,
334336
isGithubAllowed: plan.isManagedGithubAllowed,
337+
isIntercomAllowed: plan.isManagedIntercomAllowed,
335338
},
336339
dataSources: {
337340
count: plan.maxDataSourcesCount,

front/pages/api/poke/plans.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const PlanTypeSchema = t.type({
2424
isNotionAllowed: t.boolean,
2525
isGoogleDriveAllowed: t.boolean,
2626
isGithubAllowed: t.boolean,
27+
isIntercomAllowed: t.boolean,
2728
}),
2829
dataSources: t.type({
2930
count: t.number,
@@ -91,6 +92,7 @@ async function handler(
9192
isNotionAllowed: plan.isManagedNotionAllowed,
9293
isGoogleDriveAllowed: plan.isManagedGoogleDriveAllowed,
9394
isGithubAllowed: plan.isManagedGithubAllowed,
95+
isIntercomAllowed: plan.isManagedIntercomAllowed,
9496
},
9597
dataSources: {
9698
count: plan.maxDataSourcesCount,
@@ -178,6 +180,7 @@ async function handler(
178180
isManagedGoogleDriveAllowed:
179181
body.limits.connections.isGoogleDriveAllowed,
180182
isManagedGithubAllowed: body.limits.connections.isGithubAllowed,
183+
isManagedIntercomAllowed: body.limits.connections.isIntercomAllowed,
181184
maxDataSourcesCount: body.limits.dataSources.count,
182185
maxDataSourcesDocumentsCount: body.limits.dataSources.documents.count,
183186
maxDataSourcesDocumentsSizeMb: body.limits.dataSources.documents.sizeMb,

front/pages/api/w/[wId]/data_sources/managed.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async function handler(
8282

8383
if (
8484
!req.body.provider ||
85-
!["slack", "notion", "github", "google_drive"].includes(
85+
!["slack", "notion", "github", "google_drive", "intercom"].includes(
8686
req.body.provider
8787
)
8888
) {
@@ -133,6 +133,9 @@ async function handler(
133133
isDataSourceAllowedInPlan =
134134
plan.limits.connections.isGoogleDriveAllowed;
135135
break;
136+
case "intercom":
137+
isDataSourceAllowedInPlan = plan.limits.connections.isIntercomAllowed;
138+
break;
136139
default:
137140
isDataSourceAllowedInPlan = false; // default to false if provider is not recognized
138141
}

front/pages/w/[wId]/builder/data-sources/[name]/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const {
4949
NANGO_SLACK_CONNECTOR_ID = "",
5050
NANGO_NOTION_CONNECTOR_ID = "",
5151
NANGO_GOOGLE_DRIVE_CONNECTOR_ID = "",
52+
NANGO_INTERCOM_CONNECTOR_ID = "",
5253
NANGO_PUBLIC_KEY = "",
5354
GITHUB_APP_URL = "",
5455
} = process.env;
@@ -67,6 +68,7 @@ export const getServerSideProps: GetServerSideProps<{
6768
slackConnectorId: string;
6869
notionConnectorId: string;
6970
googleDriveConnectorId: string;
71+
intercomConnectorId: string;
7072
};
7173
githubAppUrl: string;
7274
gaTrackingId: string;
@@ -125,6 +127,7 @@ export const getServerSideProps: GetServerSideProps<{
125127
slackConnectorId: NANGO_SLACK_CONNECTOR_ID,
126128
notionConnectorId: NANGO_NOTION_CONNECTOR_ID,
127129
googleDriveConnectorId: NANGO_GOOGLE_DRIVE_CONNECTOR_ID,
130+
intercomConnectorId: NANGO_INTERCOM_CONNECTOR_ID,
128131
},
129132
githubAppUrl: GITHUB_APP_URL,
130133
gaTrackingId: GA_TRACKING_ID,
@@ -434,6 +437,7 @@ const CONNECTOR_TYPE_TO_HELPER_TEXT: Record<ConnectorProvider, string> = {
434437
google_drive: "Google Drive folders and files Dust has access to.",
435438
slack: "Slack channels synchronized with Dust:",
436439
github: "GitHub repositories Dust has access to.",
440+
intercom: "Intercom Help Centers synchronized with Dust:",
437441
};
438442

439443
const CONNECTOR_TYPE_TO_MISMATCH_ERROR: Record<ConnectorProvider, string> = {
@@ -444,6 +448,8 @@ const CONNECTOR_TYPE_TO_MISMATCH_ERROR: Record<ConnectorProvider, string> = {
444448
"You cannot select another Github Organization.\nPlease contact us at team@dust.tt if you initially selected a wrong Organization.",
445449
google_drive:
446450
"You cannot select another Google Drive Domain.\nPlease contact us at team@dust.tt if you initially selected a wrong shared Drive.",
451+
intercom:
452+
"You cannot select another Intercom Workspace.\nPlease contact us at team@dust.tt if you initially selected a wrong Workspace.",
447453
};
448454

449455
function ManagedDataSourceView({
@@ -466,6 +472,7 @@ function ManagedDataSourceView({
466472
slackConnectorId: string;
467473
notionConnectorId: string;
468474
googleDriveConnectorId: string;
475+
intercomConnectorId: string;
469476
};
470477
githubAppUrl: string;
471478
plan: PlanType;
@@ -518,6 +525,7 @@ function ManagedDataSourceView({
518525
slack: nangoConfig.slackConnectorId,
519526
notion: nangoConfig.notionConnectorId,
520527
google_drive: nangoConfig.googleDriveConnectorId,
528+
intercom: nangoConfig.intercomConnectorId,
521529
}[provider];
522530

523531
const nango = new Nango({ publicKey: nangoConfig.publicKey });
@@ -670,6 +678,7 @@ function ManagedDataSourceView({
670678
);
671679
case "notion":
672680
case "github":
681+
case "intercom":
673682
return (
674683
<Button
675684
label="Add / Remove data, manage permissions"

0 commit comments

Comments
 (0)