refactor: simplify connector management and update dashboard layout

- Removed the Connectors management page and integrated its functionality into a popup for better user experience.
- Updated the DashboardLayout to reflect changes in navigation, removing references to the Connectors page.
- Streamlined the breadcrumb component by eliminating unnecessary connector-related sections.
- Enhanced the ConnectorIndicator to facilitate easier access to connector management features.
- Improved overall UI consistency and accessibility across the dashboard components.
This commit is contained in:
Anish Sarkar 2026-01-01 21:41:31 +05:30
parent b909032e32
commit 3ae8fe3a7e
7 changed files with 65 additions and 999 deletions

View file

@ -688,29 +688,7 @@ export const useConnectorDialog = () => {
const handleStartEdit = useCallback((connector: SearchSourceConnector) => {
if (!searchSpaceId) return;
// Check if this is an OAuth connector
const isOAuthConnector = OAUTH_CONNECTORS.some(
(oauthConnector) => oauthConnector.connectorType === connector.connector_type
);
// Check if this is webcrawler, Tavily API, SearxNG, Linkup, Baidu, Linear, Elasticsearch, Slack, Discord, or Notion (can be managed in popup)
const isWebcrawler = connector.connector_type === EnumConnectorName.WEBCRAWLER_CONNECTOR;
const isTavilyApi = connector.connector_type === EnumConnectorName.TAVILY_API;
const isSearxng = connector.connector_type === EnumConnectorName.SEARXNG_API;
const isLinkup = connector.connector_type === EnumConnectorName.LINKUP_API;
const isBaidu = connector.connector_type === EnumConnectorName.BAIDU_SEARCH_API;
const isLinear = connector.connector_type === EnumConnectorName.LINEAR_CONNECTOR;
const isElasticsearch = connector.connector_type === EnumConnectorName.ELASTICSEARCH_CONNECTOR;
const isSlack = connector.connector_type === EnumConnectorName.SLACK_CONNECTOR;
const isDiscord = connector.connector_type === EnumConnectorName.DISCORD_CONNECTOR;
const isNotion = connector.connector_type === EnumConnectorName.NOTION_CONNECTOR;
// If not OAuth, not webcrawler, not Tavily API, not SearxNG, not Linkup, not Baidu, not Linear, not Elasticsearch, not Slack, not Discord, and not Notion, redirect to old connector edit page
if (!isOAuthConnector && !isWebcrawler && !isTavilyApi && !isSearxng && !isLinkup && !isBaidu && !isLinear && !isElasticsearch && !isSlack && !isDiscord && !isNotion) {
router.push(`/dashboard/${searchSpaceId}/connectors/${connector.id}/edit`);
return;
}
// All connector types should be handled in the popup edit view
// Validate connector data
const connectorValidation = searchSourceConnector.safeParse(connector);
if (!connectorValidation.success) {
@ -733,7 +711,7 @@ export const useConnectorDialog = () => {
url.searchParams.set("view", "edit");
url.searchParams.set("connectorId", connector.id.toString());
window.history.pushState({ modal: true }, "", url.toString());
}, [searchSpaceId, router]);
}, [searchSpaceId]);
// Handle saving connector changes
const handleSaveConnector = useCallback(async (refreshConnectors: () => void) => {