Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

[MISC] Fix connector sharing and Google Drive folder path issues (#1513)

Chandrasekharan M25db8afa0f2f
diff --git a/backend/connector_v2/views.py b/backend/connector_v2/views.py
index ef857ff2d..7469658ae 100644
--- a/backend/connector_v2/views.py
+++ b/backend/connector_v2/views.py
@@ -31,7 +31,7 @@ class ConnectorInstanceViewSet(viewsets.ModelViewSet):
serializer_class = ConnectorInstanceSerializer
def get_permissions(self) -> list[Any]:
- if self.action == "destroy":
+ if self.action in ["update", "destroy", "partial_update"]:
return [IsOwner()]
return [IsOwnerOrSharedUserOrSharedToOrg()]
diff --git a/frontend/src/components/agency/configure-connector-modal/ConfigureConnectorModal.jsx b/frontend/src/components/agency/configure-connector-modal/ConfigureConnectorModal.jsx
index 2a066179c..cc6fe810e 100644
--- a/frontend/src/components/agency/configure-connector-modal/ConfigureConnectorModal.jsx
+++ b/frontend/src/components/agency/configure-connector-modal/ConfigureConnectorModal.jsx
@@ -63,6 +63,7 @@ function ConfigureConnectorModal({
const [isSpecConfigLoading, setIsSpecConfigLoading] = useState(false);
const [selectedFolderPath, setSelectedFolderPath] = useState("");
const [isFolderSelected, setIsFolderSelected] = useState(false);
+ const [isPathFromFileBrowser, setIsPathFromFileBrowser] = useState(false);
const [initialFormDataConfig, setInitialFormDataConfig] = useState({});
const [initialConnectorId, setInitialConnectorId] = useState(null);
const [showUnsavedChangesModal, setShowUnsavedChangesModal] = useState(false);
@@ -213,30 +214,43 @@ function ConfigureConnectorModal({
const handleFolderSelect = (folderPath, itemType) => {
setSelectedFolderPath(folderPath);
setIsFolderSelected(itemType === "folder");
+ setIsPathFromFileBrowser(true);
};
const handleAddFolder = () => {
if (!selectedFolderPath) return;
+ // HACK: For GDrive connectors, strip the "root/" prefix to avoid duplication
+ // since backend will add it back during execution. This helps avoid a migration
+ let folderPath = selectedFolderPath;
+ if (
+ isPathFromFileBrowser &&
+ connDetails?.connector_id?.startsWith("gdrive") &&
+ folderPath.startsWith("root/")
+ ) {
+ folderPath = folderPath.substring(5); // Remove "root/" prefix
+ }
+
if (connType === "input") {
// SOURCE mode: Add to folders array (existing behavior)
const currentFolders = formDataConfig?.folders || [];
- if (!currentFolders.includes(selectedFolderPath)) {
+ if (!currentFolders.includes(folderPath)) {
setFormDataConfig((prev) => ({
...prev,
- folders: [...currentFolders, selectedFolderPath],
+ folders: [...currentFolders, folderPath],
}));
}
} else if (connType === "output") {
// DESTINATION mode: Set outputFolder as single value
setFormDataConfig((prev) => ({
...prev,
- outputFolder: selectedFolderPath,
+ outputFolder: folderPath,
}));
}
setSelectedFolderPath("");
setIsFolderSelected(false);
+ setIsPathFromFileBrowser(false);
};
// Configuration for UI text based on connector type
@@ -391,6 +405,7 @@ function ConfigureConnectorModal({
) {
setSelectedFolderPath("");
setIsFolderSelected(false);
+ setIsPathFromFileBrowser(false);
}
};
diff --git a/frontend/src/components/navigations/top-nav-bar/TopNavBar.css b/frontend/src/components/navigations/top-nav-bar/TopNavBar.css
index dc6bdabb2..32f22fd73 100644
--- a/frontend/src/components/navigations/top-nav-bar/TopNavBar.css
+++ b/frontend/src/components/navigations/top-nav-bar/TopNavBar.css
@@ -35,6 +35,14 @@
height: auto;
border-radius: 0;
border-color: transparent;
+ width: 100%;
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+
+.logout-button:hover {
+ background-color: rgba(0, 0, 0, 0.04);
}
.logout-button:active {
@@ -59,6 +67,19 @@
display: block;
}
+.user-profile-menu .ant-dropdown-menu-item .ant-dropdown-trigger {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ padding: 5px 12px;
+ gap: 8px;
+ cursor: pointer;
+}
+
+.user-profile-menu .ant-dropdown-menu-item .ant-dropdown-trigger:hover {
+ background-color: rgba(0, 0, 0, 0.04);
+}
+
.page-identifier {
vertical-align: super;
color: white;
diff --git a/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx b/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx
index 3c0c69138..3ca4d67c7 100644
--- a/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx
+++ b/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx
@@ -281,7 +281,7 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) {
}}
placement="left"
>
- <div>
+ <div className="ant-dropdown-trigger">
<UserSwitchOutlined /> Switch Org
</div>
</Dropdown>
diff --git a/frontend/src/pages/ConnectorsPage.jsx b/frontend/src/pages/ConnectorsPage.jsx
index 658561df3..80ffaab86 100644
--- a/frontend/src/pages/ConnectorsPage.jsx
+++ b/frontend/src/pages/ConnectorsPage.jsx
@@ -52,10 +52,12 @@ function ConnectorsPage() {
const response = await axiosPrivate.get(getUrl("users/"));
const users = response?.data?.members || [];
setUserList(
- users.map((user) => ({
- id: user?.id,
- email: user?.email,
- }))
+ users
+ .filter((user) => user?.id !== sessionDetails?.id)
+ .map((user) => ({
+ id: user?.id,
+ email: user?.email,
+ }))
);
} catch (error) {
setAlertDetails(handleException(error, "Failed to load users"));