diff --git a/front/pages/w/[wId]/builder/data-sources/index.tsx b/front/pages/w/[wId]/builder/data-sources/index.tsx index 41c0efe62443..313b065e3485 100644 --- a/front/pages/w/[wId]/builder/data-sources/index.tsx +++ b/front/pages/w/[wId]/builder/data-sources/index.tsx @@ -2,6 +2,7 @@ import { Button, CloudArrowDownIcon, Cog6ToothIcon, + DropdownMenu, PageHeader, PlusIcon, SectionHeader, @@ -433,42 +434,91 @@ export default function DataSourcesView({
{(() => { + const disabled = + !ds.isBuilt || + isLoadingByProvider[ + ds.connectorProvider as ConnectorProvider + ] || + !isAdmin; + const onclick = canUseManagedDataSources + ? async () => { + await handleEnableManagedDataSource( + ds.connectorProvider as ConnectorProvider, + ds.setupWithSuffix + ); + } + : () => { + window.alert( + "Managed Data Sources are only available on our paid plans. Contact us at team@dust.tt to get access." + ); + }; + const label = !ds.isBuilt + ? "Coming soon" + : !isLoadingByProvider[ + ds.connectorProvider as ConnectorProvider + ] && !ds.fetchConnectorError + ? "Activate" + : "Connecting..."; if (!ds || !ds.connector) { return ( -
+ + + + )} + ); } else { return (