diff --git a/ui/admin/app/components/knowledge/notion/NotionModal.tsx b/ui/admin/app/components/knowledge/notion/NotionModal.tsx
index 662a60dd8..17d81d3fd 100644
--- a/ui/admin/app/components/knowledge/notion/NotionModal.tsx
+++ b/ui/admin/app/components/knowledge/notion/NotionModal.tsx
@@ -22,6 +22,12 @@ import {
DialogTitle,
} from "~/components/ui/dialog";
import { ScrollArea } from "~/components/ui/scroll-area";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "~/components/ui/tooltip";
import IngestionStatusComponent from "../IngestionStatus";
@@ -60,6 +66,8 @@ export const NotionModal: FC = ({
startPolling();
};
+ const hasKnowledgeFiles = knowledgeFiles.length > 0;
+
return (
-
-
-
+
+
+
+
+
+
+ Refresh
+
+
+
+
+
+ Settings
+
+
diff --git a/ui/admin/app/components/knowledge/onedrive/OneDriveModal.tsx b/ui/admin/app/components/knowledge/onedrive/OneDriveModal.tsx
index 9f45b2733..894f499a9 100644
--- a/ui/admin/app/components/knowledge/onedrive/OneDriveModal.tsx
+++ b/ui/admin/app/components/knowledge/onedrive/OneDriveModal.tsx
@@ -24,6 +24,12 @@ import { Avatar } from "~/components/ui/avatar";
import { Button } from "~/components/ui/button";
import { Dialog, DialogContent, DialogTitle } from "~/components/ui/dialog";
import { ScrollArea } from "~/components/ui/scroll-area";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "~/components/ui/tooltip";
import IngestionStatusComponent from "../IngestionStatus";
import RemoteFileItemChip from "../RemoteFileItemChip";
@@ -95,6 +101,7 @@ export const OnedriveModal: FC
= ({
startPolling();
};
+ const hasKnowledgeFiles = knowledgeFiles.length > 0;
return (
-
-
-
+
+
+
+
+
+ Add
+
+
+
+
+
+ Refresh
+
+
+
+
+
+ Settings
+
+
{links.map((link, index) => (
- {/* eslint-disable-next-line */}
-
{
if (
showTable[index] === undefined ||
@@ -222,12 +256,11 @@ export const OnedriveModal: FC = ({
) : (
))}
-
+
{showTable[index] && (
{knowledgeFiles
-
.filter((item) =>
onedriveSource?.state?.onedriveState?.files?.[
item.uploadID!
@@ -274,19 +307,22 @@ export const OnedriveModal: FC
= ({
))}
{knowledgeFiles
- .filter(
- (item) =>
- !links.some(
- (link) =>
- onedriveSource?.state?.onedriveState?.files?.[
- item.uploadID!
- ]?.folderPath?.startsWith(
- onedriveSource?.state
- ?.onedriveState
- ?.links?.[link]?.name ??
- ""
- ) ?? false
- )
+ .filter((item) =>
+ links.every((link) => {
+ // If we have file state and find out that file doesn't belong to any link, then we should it as separate files as this link is pointing to a file
+ const fileState =
+ onedriveSource?.state?.onedriveState
+ ?.files?.[item.uploadID!];
+ return (
+ fileState &&
+ !fileState?.folderPath?.startsWith(
+ onedriveSource?.state
+ ?.onedriveState?.links?.[
+ link
+ ]?.name ?? ""
+ )
+ );
+ })
)
.map((item) => (
= ({
{knowledgeFiles?.some((item) => item.approved) && (
)}
- {onedriveSource?.runID && (
-
- )}
+ {onedriveSource?.state?.onedriveState?.links &&
+ onedriveSource?.runID && (
+
+ )}
-
-
-
+
+
+
+
+
+ Add
+
+
+
+
+
+ Refresh
+
+
+
+
+
+ Settings
+
+
@@ -246,7 +281,7 @@ export const WebsiteModal: FC = ({
handleApproveAll();
setLoading(false);
}}
- disabled={loading}
+ disabled={loading || !hasKnowledgeFiles}
>
{loading ? (