+
+ void restrictHelpers.setValue(checked)}
+ />
+
+
+ {restrict.value && (
+ <>
+
+
+ {selectedGroups.length === 0 ? (
+
+ ) : (
+
+ {selectedGroups.map((group) => (
+
+ removeGroup(group.id)}
+ />
+ }
+ />
+
+ ))}
+
+ )}
+ >
+ )}
+
+ );
+}
diff --git a/web/src/views/admin/connectors/AddConnectorPage/AddConnector.tsx b/web/src/views/admin/connectors/AddConnectorPage/AddConnector.tsx
index 35e574086b..aae76a3e77 100644
--- a/web/src/views/admin/connectors/AddConnectorPage/AddConnector.tsx
+++ b/web/src/views/admin/connectors/AddConnectorPage/AddConnector.tsx
@@ -66,6 +66,7 @@ import { deleteConnector } from "@/lib/connector";
import ConnectorDocsLink from "@/components/admin/connectors/ConnectorDocsLink";
import { SvgArrowExchange, SvgKey, SvgSimpleLoader } from "@opal/icons";
import { useTranslations } from "next-intl";
+import { toWireAccess } from "@/lib/connectors/accessType";
export interface AdvancedConfig {
refreshFreq: number;
@@ -334,7 +335,9 @@ export default function AddConnector({
const {
name,
groups,
- access_type,
+ access_type: formAccessType,
+ restrict_access_to_groups,
+ restriction_group_ids,
pruneFreq,
indexingStart,
refreshFreq,
@@ -342,6 +345,12 @@ export default function AddConnector({
...connector_specific_config
} = values;
+ const wireAccess = toWireAccess(formAccessType, {
+ restrict_access_to_groups,
+ restriction_group_ids,
+ });
+ const access_type = wireAccess.access_type;
+
// Apply special transforms according to application logic
const transformedConnectorSpecificConfig = Object.entries(
connector_specific_config
@@ -473,6 +482,8 @@ export default function AddConnector({
currentCredential ||
liveGDriveCredential ||
liveGmailCredential;
+ // TODO(evan, ENG-4342): send wireAccess.restriction_group_ids
+ // once the backend accepts them; this call creates the cc-pair.
const linkCredentialResponse = await linkCredential(
response.id,
credential!.id,
diff --git a/web/src/views/admin/connectors/ConnectorDetailPage/index.tsx b/web/src/views/admin/connectors/ConnectorDetailPage/index.tsx
index d9f08721e7..60e4d8f2a2 100644
--- a/web/src/views/admin/connectors/ConnectorDetailPage/index.tsx
+++ b/web/src/views/admin/connectors/ConnectorDetailPage/index.tsx
@@ -69,6 +69,7 @@ import { useUser } from "@/providers/UserProvider";
import { resolveAllErrorsForCCPair } from "@/lib/targeted_reindex";
import { SWR_KEYS } from "@/lib/swr-keys";
import { can } from "@/lib/permissions/resource-actions";
+import { isPermSynced } from "@/lib/connectors/accessType";
// synchronize these validations with the SQLAlchemy connector class until we have a
// centralized schema for both frontend and backend
const RefreshFrequencySchema = Yup.object().shape({
@@ -666,7 +667,7 @@ function Main({ ccPairId }: { ccPairId: number }) {
- {ccPair.access_type === "sync" && (
+ {isPermSynced(ccPair.access_type) && (
<>
{/* TODO: Remove className and switch to text03 once Text is fully integrated across this page */}
@@ -783,7 +784,7 @@ function Main({ ccPairId }: { ccPairId: number }) {
)}
{indexAttempts &&
- (ccPair.access_type === "sync" ? (
+ (isPermSynced(ccPair.access_type) ? (
{t("status.access.organizationPublic.label")}
- ) : ccPairsIndexingStatus.access_type === "sync" ? (
+ ) : isPermSynced(ccPairsIndexingStatus.access_type) ? (