From fbff310d70d828a2be504728913f4bb7c9da6a39 Mon Sep 17 00:00:00 2001 From: Aric Lasry Date: Thu, 12 Oct 2023 12:05:07 +0200 Subject: [PATCH] Add Google sensitive scope disclosure when connecting Gdrive DS (#2080) --- .../w/[wId]/builder/data-sources/index.tsx | 118 +++++++++++++----- 1 file changed, 84 insertions(+), 34 deletions(-) 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 (