Skip to content

Commit

Permalink
fix: additionally start knowledge polling when source is pending
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhopperlowe committed Dec 20, 2024
1 parent fa7372d commit 5abb422
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
5 changes: 4 additions & 1 deletion ui/admin/app/components/knowledge/AddSourceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ export const AddSourceModal: FC<AddSourceModalProps> = ({

return (
<Dialog open={isOpen} onOpenChange={onOpenChange}>
<DialogContent aria-describedby={undefined} className="max-w-2xl">
<DialogContent
aria-describedby="add-source-modal"
className="max-w-2xl"
>
<DialogTitle className="flex flex-row items-center text-xl font-semibold mb-4 justify-between">
<div className="flex flex-row items-center">
<KnowledgeSourceAvatar
Expand Down
2 changes: 1 addition & 1 deletion ui/admin/app/components/knowledge/CronDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const CronDialog: FC<CronDialogProps> = ({

return (
<Dialog open={isOpen} onOpenChange={onOpenChange}>
<DialogContent aria-describedby={undefined} className="max-w-md">
<DialogContent aria-describedby="cron-dialog" className="max-w-md">
<DialogTitle className="text-xl font-semibold mb-4">
Enter Cron Expression
</DialogTitle>
Expand Down
11 changes: 10 additions & 1 deletion ui/admin/app/components/knowledge/KnowledgeSourceDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ import KnowledgeSourceAvatar from "~/components/knowledge/KnowledgeSourceAvatar"
import OauthSignDialog from "~/components/knowledge/OAuthSignDialog";
import { LoadingSpinner } from "~/components/ui/LoadingSpinner";
import { Button } from "~/components/ui/button";
import { Dialog, DialogContent, DialogTitle } from "~/components/ui/dialog";
import {
Dialog,
DialogContent,
DialogDescription,
DialogTitle,
} from "~/components/ui/dialog";
import {
DropdownMenu,
DropdownMenuCheckboxItem,
Expand Down Expand Up @@ -122,6 +127,10 @@ export const KnowledgeSourceDetail: FC<KnowledgeSourceDetailProps> = ({
onScroll={handleScroll}
ref={tableContainerRef}
>
<DialogDescription hidden>
Knowledge Source Detail
</DialogDescription>

<DialogTitle className="flex justify-between items-center">
<div className="flex flex-row items-center">
<KnowledgeSourceAvatar
Expand Down
5 changes: 4 additions & 1 deletion ui/admin/app/hooks/knowledge/useKnowledgeSourceFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export function useKnowledgeSourceFiles(
if (blockPollingFiles) setBlockPollingFiles(false);
};

if (knowledgeSource.state === KnowledgeSourceStatus.Syncing) {
if (
knowledgeSource.state === KnowledgeSourceStatus.Syncing ||
knowledgeSource.state === KnowledgeSourceStatus.Pending
) {
startPolling();
}

Expand Down

0 comments on commit 5abb422

Please sign in to comment.