Skip to content

OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.

Python

fix page crash for skipped pages (#2452)

Mike Fortman6db6e4d8b54a
diff --git a/frontend/app/knowledge/page.test.tsx b/frontend/app/knowledge/page.test.tsx
index 6d194d3e8..f7cc415cc 100644
--- a/frontend/app/knowledge/page.test.tsx
+++ b/frontend/app/knowledge/page.test.tsx
@@ -348,6 +348,18 @@ describe("StatusCellContent", () => {
expect(container.textContent?.toLowerCase()).toContain("cancel");
});
+ it("renders a Skipped badge for skip reasons other than duplicate content", () => {
+ render(
+ <TooltipProvider>
+ <StatusCellContent
+ {...baseProps}
+ data={f({ status: "skipped", skip_reason: "duplicate_filename" })}
+ />
+ </TooltipProvider>,
+ );
+ expect(screen.getByText("Skipped")).toBeInTheDocument();
+ });
+
it("renders the Refreshing indicator when hasOpenragRefreshCue and isOpenragDocsRow", () => {
render(
<TooltipProvider>
diff --git a/frontend/components/ui/status-badge.tsx b/frontend/components/ui/status-badge.tsx
index 23836403a..cedb1472e 100644
--- a/frontend/components/ui/status-badge.tsx
+++ b/frontend/components/ui/status-badge.tsx
@@ -8,10 +8,10 @@ export type Status =
| "sync"
| "failed"
| "cancelled"
+ | "skipped"
| "ready"
| "fallback"
- | "not-configured"
- | "skipped";
+ | "not-configured";
interface StatusBadgeProps {
/**
@@ -23,7 +23,7 @@ interface StatusBadgeProps {
className?: string;
}
-const statusConfig = {
+const statusConfig: Record<Status, { label: string; className: string }> = {
processing: {
label: "Processing",
className: "text-muted-foreground ",
@@ -44,6 +44,10 @@ const statusConfig = {
label: "Cancelled",
className: "text-muted-foreground ",
},
+ skipped: {
+ label: "Skipped",
+ className: "text-muted-foreground ",
+ },
hidden: {
label: "Hidden",
className: "text-muted-foreground ",
@@ -64,10 +68,6 @@ const statusConfig = {
label: "Not configured",
className: "text-muted-foreground ",
},
- skipped: {
- label: "Skipped",
- className: "text-muted-foreground ",
- },
};
/** Title-cases a status this badge has no entry for: "in_progress" → "In progress". */