Skip to content

Commit 13ad5ea

Browse files
committed
Apply Gab's feedback
1 parent 436b32a commit 13ad5ea

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

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

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
ContentMessage,
77
ContextItem,
88
DropdownMenu,
9+
InformationCircleIcon,
910
Page,
1011
Popup,
1112
} from "@dust-tt/sparkle";
@@ -249,6 +250,8 @@ export default function DataSourcesView({
249250
>({} as Record<ConnectorProvider, boolean | undefined>);
250251
const [showUpgradePopupForProvider, setShowUpgradePopupForProvider] =
251252
useState<ConnectorProvider | null>(null);
253+
const [showPreviewPopupForProvider, setShowPreviewPopupForProvider] =
254+
useState<ConnectorProvider | null>(null);
252255
const handleEnableManagedDataSource = async (
253256
provider: ConnectorProvider,
254257
suffix: string | null
@@ -383,11 +386,9 @@ export default function DataSourcesView({
383386
<Button.List>
384387
{(() => {
385388
const disabled =
386-
!ds.isBuilt ||
387389
isLoadingByProvider[
388390
ds.connectorProvider as ConnectorProvider
389-
] ||
390-
!isAdmin;
391+
] || !isAdmin;
391392
const onClick = async () => {
392393
let isDataSourceAllowedInPlan: boolean;
393394

@@ -425,6 +426,10 @@ export default function DataSourcesView({
425426
ds.connectorProvider as ConnectorProvider,
426427
ds.setupWithSuffix
427428
);
429+
} else if (!ds.isBuilt) {
430+
setShowPreviewPopupForProvider(
431+
ds.connectorProvider
432+
);
428433
} else {
429434
setShowUpgradePopupForProvider(
430435
ds.connectorProvider as ConnectorProvider
@@ -433,7 +438,7 @@ export default function DataSourcesView({
433438
return;
434439
};
435440
const label = !ds.isBuilt
436-
? "Coming soon"
441+
? "Preview"
437442
: !isLoadingByProvider[
438443
ds.connectorProvider as ConnectorProvider
439444
] && !ds.fetchConnectorError
@@ -445,7 +450,11 @@ export default function DataSourcesView({
445450
{ds.connectorProvider !== "google_drive" && (
446451
<Button
447452
variant="primary"
448-
icon={CloudArrowLeftRightIcon}
453+
icon={
454+
ds.isBuilt
455+
? CloudArrowLeftRightIcon
456+
: InformationCircleIcon
457+
}
449458
disabled={disabled}
450459
onClick={onClick}
451460
label={label}
@@ -458,7 +467,11 @@ export default function DataSourcesView({
458467
variant="primary"
459468
label={label}
460469
disabled={disabled}
461-
icon={CloudArrowLeftRightIcon}
470+
icon={
471+
ds.isBuilt
472+
? CloudArrowLeftRightIcon
473+
: InformationCircleIcon
474+
}
462475
/>
463476
</DropdownMenu.Button>
464477
<DropdownMenu.Items
@@ -561,6 +574,23 @@ export default function DataSourcesView({
561574
setShowUpgradePopupForProvider(null);
562575
}}
563576
/>
577+
<Popup
578+
show={
579+
showPreviewPopupForProvider === ds.connectorProvider
580+
}
581+
className="absolute bottom-8 right-0"
582+
chipLabel="Coming Soon!"
583+
description="Please email us at team@dust.tt for early access."
584+
buttonLabel="Contact us"
585+
buttonClick={() => {
586+
window.open(
587+
"mailto:team@dust.tt?subject=Intersted in the Intercom connection"
588+
);
589+
}}
590+
onClose={() => {
591+
setShowPreviewPopupForProvider(null);
592+
}}
593+
/>
564594
</div>
565595
}
566596
>

0 commit comments

Comments
 (0)