Skip to content

Commit

Permalink
ni
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Jan 7, 2025
1 parent d9e9c69 commit aeaf991
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 29 deletions.
Empty file added backend/test
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,18 @@ import { FetchError, errorHandlingFetcher } from "@/lib/fetcher";
import { ErrorCallout } from "@/components/ErrorCallout";
import { LoadingAnimation } from "@/components/Loading";
import { usePopup } from "@/components/admin/connectors/Popup";
import { ConnectorIndexingStatus, ValidSources } from "@/lib/types";
import {
usePublicCredentials,
useConnectorCredentialIndexingStatus,
} from "@/lib/hooks";
import { ValidSources } from "@/lib/types";
import { usePublicCredentials } from "@/lib/hooks";
import Title from "@/components/ui/title";
import { DriveJsonUploadSection, DriveAuthSection } from "./Credential";
import {
Credential,
GoogleDriveCredentialJson,
GoogleDriveServiceAccountCredentialJson,
} from "@/lib/connectors/credentials";
import {
ConnectorSnapshot,
GoogleDriveConfig,
} from "@/lib/connectors/connectors";
import { ConnectorSnapshot } from "@/lib/connectors/connectors";
import { useUser } from "@/components/user/UserProvider";
import { buildSimilarCredentialInfoURL } from "@/app/admin/connector/[ccPairId]/lib";
import { fetchConnectors } from "@/lib/connector";

const useConnectorsByCredentialId = (credential_id: number | null) => {
let url: string | null = null;
Expand Down
22 changes: 3 additions & 19 deletions web/src/app/admin/documents/sets/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import Text from "@/components/ui/text";
import Title from "@/components/ui/title";
import { Separator } from "@/components/ui/separator";
import { Button } from "@/components/ui/button";
import { useConnectorCredentialIndexingStatus } from "@/lib/hooks";
import { ConnectorIndexingStatus, DocumentSet } from "@/lib/types";
import { DocumentSet } from "@/lib/types";
import { useState } from "react";
import { useDocumentSets } from "./hooks";
import { ConnectorTitle } from "@/components/admin/connectors/ConnectorTitle";
Expand Down Expand Up @@ -99,7 +98,6 @@ const EditRow = ({

interface DocumentFeedbackTableProps {
documentSets: DocumentSet[];
ccPairs: ConnectorIndexingStatus<any, any>[];
refresh: () => void;
refreshEditable: () => void;
setPopup: (popupSpec: PopupSpec | null) => void;
Expand Down Expand Up @@ -275,24 +273,15 @@ const Main = () => {
error: documentSetsError,
refreshDocumentSets,
} = useDocumentSets();

const {
data: editableDocumentSets,
isLoading: isEditableDocumentSetsLoading,
error: editableDocumentSetsError,
refreshDocumentSets: refreshEditableDocumentSets,
} = useDocumentSets(true);

const {
data: ccPairs,
isLoading: isCCPairsLoading,
error: ccPairsError,
} = useConnectorCredentialIndexingStatus();

if (
isDocumentSetsLoading ||
isCCPairsLoading ||
isEditableDocumentSetsLoading
) {
if (isDocumentSetsLoading || isEditableDocumentSetsLoading) {
return <ThreeDotsLoader />;
}

Expand All @@ -304,10 +293,6 @@ const Main = () => {
return <div>Error: {editableDocumentSetsError}</div>;
}

if (ccPairsError || !ccPairs) {
return <div>Error: {ccPairsError}</div>;
}

return (
<div className="mb-8">
{popup}
Expand All @@ -331,7 +316,6 @@ const Main = () => {
<DocumentSetTable
documentSets={documentSets}
editableDocumentSets={editableDocumentSets}
ccPairs={ccPairs}
refresh={refreshDocumentSets}
refreshEditable={refreshEditableDocumentSets}
setPopup={setPopup}
Expand Down

0 comments on commit aeaf991

Please sign in to comment.