From 3d5d5e1295918945f561e482abdd6e16d34907de Mon Sep 17 00:00:00 2001 From: ryan-crabbe-berri Date: Thu, 9 Jul 2026 22:19:11 -0700 Subject: [PATCH] refactor(ui): colocate tag-management and vector-stores views, keeping the shared selectors (#32719) Two of the group-1 colocation splits. Each of these folders lived in the shared src/components dump but is only partly shared: the page's management view is segment-owned, while a selector widget is reused by other features. So this splits them rather than moving wholesale. tag-management: TagSelector (used by playground) and its types stay in @/components/tag_management; the management view (index, tag_info, TagTable, CreateTagModal) moves to tag-management/_components. vector-stores: VectorStoreSelector (used by organizations and playground) and its types stay in @/components/vector_store_management; the rest of the management UI moves to vector-stores/_components. The moved files' imports of the retained shared files are rewritten to absolute @/components paths, escaping relative imports are absolutized, and moved test files have both their `from` imports and `vi.mock` paths rewritten to match. Grandfathered lint suppressions for moved files are re-keyed. The external consumers of the selectors are untouched (the selectors did not move). No behavior change. --- ui/litellm-dashboard/eslint-suppressions.json | 18 +++++++++--------- .../_components}/TagTable.test.tsx | 2 +- .../tag-management/_components}/TagTable.tsx | 2 +- .../components/CreateTagModal.test.tsx | 0 .../_components}/components/CreateTagModal.tsx | 4 ++-- .../tag-management/_components}/index.tsx | 8 ++++---- .../tag-management/_components}/tag_info.tsx | 14 +++++++------- .../app/(dashboard)/tag-management/page.tsx | 2 +- .../_components}/CreateVectorStore.test.tsx | 8 ++++---- .../_components}/CreateVectorStore.tsx | 8 ++++---- .../_components}/DocumentsTable.test.tsx | 2 +- .../_components}/DocumentsTable.tsx | 2 +- .../_components}/S3VectorsConfig.test.tsx | 0 .../_components}/S3VectorsConfig.tsx | 0 .../_components}/TestVectorStoreTab.test.tsx | 2 +- .../_components}/TestVectorStoreTab.tsx | 2 +- .../_components}/VectorStoreForm.test.tsx | 4 ++-- .../_components}/VectorStoreForm.tsx | 6 +++--- .../_components}/VectorStoreTable.test.tsx | 6 +++--- .../_components}/VectorStoreTable.tsx | 6 +++--- .../_components}/VectorStoreTester.tsx | 4 ++-- .../vector-stores/_components}/index.tsx | 13 +++++++++---- .../_components}/vector_store_info.tsx | 13 +++++++++---- .../src/app/(dashboard)/vector-stores/page.tsx | 2 +- .../tests/CreateKeyPage.expiredToken.test.tsx | 4 ++-- 25 files changed, 71 insertions(+), 61 deletions(-) rename ui/litellm-dashboard/src/{components/tag_management => app/(dashboard)/tag-management/_components}/TagTable.test.tsx (98%) rename ui/litellm-dashboard/src/{components/tag_management => app/(dashboard)/tag-management/_components}/TagTable.tsx (99%) rename ui/litellm-dashboard/src/{components/tag_management => app/(dashboard)/tag-management/_components}/components/CreateTagModal.test.tsx (100%) rename ui/litellm-dashboard/src/{components/tag_management => app/(dashboard)/tag-management/_components}/components/CreateTagModal.tsx (96%) rename ui/litellm-dashboard/src/{components/tag_management => app/(dashboard)/tag-management/_components}/index.tsx (96%) rename ui/litellm-dashboard/src/{components/tag_management => app/(dashboard)/tag-management/_components}/tag_info.tsx (95%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/CreateVectorStore.test.tsx (97%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/CreateVectorStore.tsx (98%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/DocumentsTable.test.tsx (97%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/DocumentsTable.tsx (97%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/S3VectorsConfig.test.tsx (100%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/S3VectorsConfig.tsx (100%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/TestVectorStoreTab.test.tsx (97%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/TestVectorStoreTab.tsx (96%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/VectorStoreForm.test.tsx (88%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/VectorStoreForm.tsx (98%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/VectorStoreTable.test.tsx (98%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/VectorStoreTable.tsx (96%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/VectorStoreTester.tsx (98%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/index.tsx (94%) rename ui/litellm-dashboard/src/{components/vector_store_management => app/(dashboard)/vector-stores/_components}/vector_store_info.tsx (97%) diff --git a/ui/litellm-dashboard/eslint-suppressions.json b/ui/litellm-dashboard/eslint-suppressions.json index 33b09ce12e5..1c15d51d6b6 100644 --- a/ui/litellm-dashboard/eslint-suppressions.json +++ b/ui/litellm-dashboard/eslint-suppressions.json @@ -2272,17 +2272,17 @@ "count": 1 } }, - "src/components/tag_management/TagTable.tsx": { + "src/app/(dashboard)/tag-management/_components/TagTable.tsx": { "no-restricted-imports": { "count": 1 } }, - "src/components/tag_management/components/CreateTagModal.tsx": { + "src/app/(dashboard)/tag-management/_components/components/CreateTagModal.tsx": { "no-restricted-imports": { "count": 1 } }, - "src/components/tag_management/index.tsx": { + "src/app/(dashboard)/tag-management/_components/index.tsx": { "no-restricted-imports": { "count": 1 }, @@ -2290,7 +2290,7 @@ "count": 1 } }, - "src/components/tag_management/tag_info.tsx": { + "src/app/(dashboard)/tag-management/_components/tag_info.tsx": { "no-restricted-imports": { "count": 1 }, @@ -2388,12 +2388,12 @@ "count": 2 } }, - "src/components/vector_store_management/CreateVectorStore.tsx": { + "src/app/(dashboard)/vector-stores/_components/CreateVectorStore.tsx": { "no-restricted-imports": { "count": 1 } }, - "src/components/vector_store_management/VectorStoreForm.tsx": { + "src/app/(dashboard)/vector-stores/_components/VectorStoreForm.tsx": { "no-nested-ternary": { "count": 2 }, @@ -2404,12 +2404,12 @@ "count": 1 } }, - "src/components/vector_store_management/VectorStoreTable.tsx": { + "src/app/(dashboard)/vector-stores/_components/VectorStoreTable.tsx": { "no-restricted-imports": { "count": 1 } }, - "src/components/vector_store_management/index.tsx": { + "src/app/(dashboard)/vector-stores/_components/index.tsx": { "no-restricted-imports": { "count": 1 }, @@ -2417,7 +2417,7 @@ "count": 1 } }, - "src/components/vector_store_management/vector_store_info.tsx": { + "src/app/(dashboard)/vector-stores/_components/vector_store_info.tsx": { "no-restricted-imports": { "count": 1 }, diff --git a/ui/litellm-dashboard/src/components/tag_management/TagTable.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/TagTable.test.tsx similarity index 98% rename from ui/litellm-dashboard/src/components/tag_management/TagTable.test.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/TagTable.test.tsx index 057f30ccee5..e9a35d961f9 100644 --- a/ui/litellm-dashboard/src/components/tag_management/TagTable.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/TagTable.test.tsx @@ -2,7 +2,7 @@ import { fireEvent, render, screen } from "@testing-library/react"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { formatCellDate } from "@/components/shared/table_cells"; import TagTable from "./TagTable"; -import { Tag } from "./types"; +import { Tag } from "@/components/tag_management/types"; describe("TagTable", () => { const mockOnEdit = vi.fn(); diff --git a/ui/litellm-dashboard/src/components/tag_management/TagTable.tsx b/ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/TagTable.tsx similarity index 99% rename from ui/litellm-dashboard/src/components/tag_management/TagTable.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/TagTable.tsx index e34653cc702..21bf4657a47 100644 --- a/ui/litellm-dashboard/src/components/tag_management/TagTable.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/TagTable.tsx @@ -11,7 +11,7 @@ import { Badge, Icon, Table, TableBody, TableCell, TableHead, TableHeaderCell, T import { Tooltip } from "antd"; import React from "react"; import { DateCell, IdCell } from "@/components/shared/table_cells"; -import { Tag } from "./types"; +import { Tag } from "@/components/tag_management/types"; interface TagTableProps { data: Tag[]; diff --git a/ui/litellm-dashboard/src/components/tag_management/components/CreateTagModal.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/components/CreateTagModal.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/tag_management/components/CreateTagModal.test.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/components/CreateTagModal.test.tsx diff --git a/ui/litellm-dashboard/src/components/tag_management/components/CreateTagModal.tsx b/ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/components/CreateTagModal.tsx similarity index 96% rename from ui/litellm-dashboard/src/components/tag_management/components/CreateTagModal.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/components/CreateTagModal.tsx index 4b1f7d34853..6fd50cbe823 100644 --- a/ui/litellm-dashboard/src/components/tag_management/components/CreateTagModal.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/components/CreateTagModal.tsx @@ -2,8 +2,8 @@ import { InfoCircleOutlined } from "@ant-design/icons"; import { Accordion, AccordionBody, AccordionHeader, Button, TextInput, Title } from "@tremor/react"; import { Form, Input, Modal, Select as Select2, Tooltip } from "antd"; import React from "react"; -import BudgetDurationDropdown from "../../common_components/budget_duration_dropdown"; -import NumericalInput from "../../shared/numerical_input"; +import BudgetDurationDropdown from "@/components/common_components/budget_duration_dropdown"; +import NumericalInput from "@/components/shared/numerical_input"; interface ModelInfo { model_name: string; diff --git a/ui/litellm-dashboard/src/components/tag_management/index.tsx b/ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/index.tsx similarity index 96% rename from ui/litellm-dashboard/src/components/tag_management/index.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/index.tsx index 1026f5842f9..043d229e3c1 100644 --- a/ui/litellm-dashboard/src/components/tag_management/index.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/index.tsx @@ -2,11 +2,11 @@ import React, { useState, useEffect } from "react"; import { Icon, Button, Col, Text, Grid } from "@tremor/react"; import { RefreshIcon } from "@heroicons/react/outline"; import TagInfoView from "./tag_info"; -import { modelInfoCall } from "../networking"; -import { tagCreateCall, tagListCall, tagDeleteCall } from "../networking"; -import { Tag } from "./types"; +import { modelInfoCall } from "@/components/networking"; +import { tagCreateCall, tagListCall, tagDeleteCall } from "@/components/networking"; +import { Tag } from "@/components/tag_management/types"; import TagTable from "./TagTable"; -import NotificationsManager from "../molecules/notifications_manager"; +import NotificationsManager from "@/components/molecules/notifications_manager"; import CreateTagModal from "./components/CreateTagModal"; interface ModelInfo { diff --git a/ui/litellm-dashboard/src/components/tag_management/tag_info.tsx b/ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/tag_info.tsx similarity index 95% rename from ui/litellm-dashboard/src/components/tag_management/tag_info.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/tag_info.tsx index 63725d5884f..19e08429730 100644 --- a/ui/litellm-dashboard/src/components/tag_management/tag_info.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/tag-management/_components/tag_info.tsx @@ -12,13 +12,13 @@ import { } from "@tremor/react"; import { Form, Input, Select as Select2, Tooltip } from "antd"; import { InfoCircleOutlined } from "@ant-design/icons"; -import { fetchUserModels } from "../organisms/create_key_button"; -import { getModelDisplayName } from "../key_team_helpers/fetch_available_models_team_key"; -import { tagInfoCall, tagUpdateCall } from "../networking"; -import { Tag } from "./types"; -import NotificationsManager from "../molecules/notifications_manager"; -import NumericalInput from "../shared/numerical_input"; -import BudgetDurationDropdown from "../common_components/budget_duration_dropdown"; +import { fetchUserModels } from "@/components/organisms/create_key_button"; +import { getModelDisplayName } from "@/components/key_team_helpers/fetch_available_models_team_key"; +import { tagInfoCall, tagUpdateCall } from "@/components/networking"; +import { Tag } from "@/components/tag_management/types"; +import NotificationsManager from "@/components/molecules/notifications_manager"; +import NumericalInput from "@/components/shared/numerical_input"; +import BudgetDurationDropdown from "@/components/common_components/budget_duration_dropdown"; import { copyToClipboard as utilCopyToClipboard } from "@/utils/dataUtils"; import { CheckIcon, CopyIcon } from "lucide-react"; import { Button as AntdButton } from "antd"; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/tag-management/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/tag-management/page.tsx index 8a6ffd67388..5a1df715e76 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/tag-management/page.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/tag-management/page.tsx @@ -1,6 +1,6 @@ "use client"; -import TagManagement from "@/components/tag_management"; +import TagManagement from "./_components"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; export default function TagManagementPage() { diff --git a/ui/litellm-dashboard/src/components/vector_store_management/CreateVectorStore.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/CreateVectorStore.test.tsx similarity index 97% rename from ui/litellm-dashboard/src/components/vector_store_management/CreateVectorStore.test.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/CreateVectorStore.test.tsx index 4069a7ec8ec..6c7a647e2d3 100644 --- a/ui/litellm-dashboard/src/components/vector_store_management/CreateVectorStore.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/CreateVectorStore.test.tsx @@ -1,15 +1,15 @@ import { render, screen, fireEvent, waitFor, act } from "@testing-library/react"; import { describe, it, expect, vi, beforeEach } from "vitest"; import CreateVectorStore from "./CreateVectorStore"; -import * as networking from "../networking"; +import * as networking from "@/components/networking"; // Mock the networking module -vi.mock("../networking", () => ({ +vi.mock("@/components/networking", () => ({ ragIngestCall: vi.fn(), })); // Mock NotificationsManager -vi.mock("../molecules/notifications_manager", () => ({ +vi.mock("@/components/molecules/notifications_manager", () => ({ default: { success: vi.fn(), fromBackend: vi.fn(), @@ -17,7 +17,7 @@ vi.mock("../molecules/notifications_manager", () => ({ })); // Mock vector_store_providers -vi.mock("../vector_store_providers", () => ({ +vi.mock("@/components/vector_store_providers", () => ({ VectorStoreProviders: { BEDROCK: "Amazon Bedrock", OPENAI: "OpenAI", diff --git a/ui/litellm-dashboard/src/components/vector_store_management/CreateVectorStore.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/CreateVectorStore.tsx similarity index 98% rename from ui/litellm-dashboard/src/components/vector_store_management/CreateVectorStore.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/CreateVectorStore.tsx index da88cda4e4d..b5f4b56986d 100644 --- a/ui/litellm-dashboard/src/components/vector_store_management/CreateVectorStore.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/CreateVectorStore.tsx @@ -4,8 +4,8 @@ import { Upload, Button, Select, Form, Alert, Tooltip, Input } from "antd"; import MessageManager from "@/components/molecules/message_manager"; import { InboxOutlined, InfoCircleOutlined } from "@ant-design/icons"; import type { UploadProps } from "antd"; -import { ragIngestCall } from "../networking"; -import { DocumentUpload, RAGIngestResponse } from "./types"; +import { ragIngestCall } from "@/components/networking"; +import { DocumentUpload, RAGIngestResponse } from "@/components/vector_store_management/types"; import DocumentsTable from "./DocumentsTable"; import { VectorStoreProviders, @@ -13,9 +13,9 @@ import { vectorStoreProviderMap, getProviderSpecificFields, VectorStoreFieldConfig, -} from "../vector_store_providers"; +} from "@/components/vector_store_providers"; import { resolveLogoSrc } from "@/lib/assetPaths"; -import NotificationsManager from "../molecules/notifications_manager"; +import NotificationsManager from "@/components/molecules/notifications_manager"; import S3VectorsConfig from "./S3VectorsConfig"; const { Dragger } = Upload; diff --git a/ui/litellm-dashboard/src/components/vector_store_management/DocumentsTable.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/DocumentsTable.test.tsx similarity index 97% rename from ui/litellm-dashboard/src/components/vector_store_management/DocumentsTable.test.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/DocumentsTable.test.tsx index 507ad0537d6..c2425c8d651 100644 --- a/ui/litellm-dashboard/src/components/vector_store_management/DocumentsTable.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/DocumentsTable.test.tsx @@ -1,7 +1,7 @@ import { render, screen, fireEvent, act } from "@testing-library/react"; import { describe, it, expect, vi } from "vitest"; import DocumentsTable from "./DocumentsTable"; -import { DocumentUpload } from "./types"; +import { DocumentUpload } from "@/components/vector_store_management/types"; // Mock antd message vi.mock("antd", async () => { diff --git a/ui/litellm-dashboard/src/components/vector_store_management/DocumentsTable.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/DocumentsTable.tsx similarity index 97% rename from ui/litellm-dashboard/src/components/vector_store_management/DocumentsTable.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/DocumentsTable.tsx index eaa864ab3dc..d4c45a6b751 100644 --- a/ui/litellm-dashboard/src/components/vector_store_management/DocumentsTable.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/DocumentsTable.tsx @@ -3,7 +3,7 @@ import { Table, Tooltip } from "antd"; import MessageManager from "@/components/molecules/message_manager"; import { EyeOutlined, CopyOutlined, DeleteOutlined } from "@ant-design/icons"; import { StatusBadge, type StatusTone } from "@/components/shared/table_cells"; -import { DocumentUpload } from "./types"; +import { DocumentUpload } from "@/components/vector_store_management/types"; interface DocumentsTableProps { documents: DocumentUpload[]; diff --git a/ui/litellm-dashboard/src/components/vector_store_management/S3VectorsConfig.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/S3VectorsConfig.test.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/vector_store_management/S3VectorsConfig.test.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/S3VectorsConfig.test.tsx diff --git a/ui/litellm-dashboard/src/components/vector_store_management/S3VectorsConfig.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/S3VectorsConfig.tsx similarity index 100% rename from ui/litellm-dashboard/src/components/vector_store_management/S3VectorsConfig.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/S3VectorsConfig.tsx diff --git a/ui/litellm-dashboard/src/components/vector_store_management/TestVectorStoreTab.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/TestVectorStoreTab.test.tsx similarity index 97% rename from ui/litellm-dashboard/src/components/vector_store_management/TestVectorStoreTab.test.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/TestVectorStoreTab.test.tsx index ad6ef02e87b..c1322dced60 100644 --- a/ui/litellm-dashboard/src/components/vector_store_management/TestVectorStoreTab.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/TestVectorStoreTab.test.tsx @@ -1,7 +1,7 @@ import { render, screen, fireEvent } from "@testing-library/react"; import { describe, it, expect, vi } from "vitest"; import TestVectorStoreTab from "./TestVectorStoreTab"; -import { VectorStore } from "./types"; +import { VectorStore } from "@/components/vector_store_management/types"; // Mock VectorStoreTester component vi.mock("./VectorStoreTester", () => ({ diff --git a/ui/litellm-dashboard/src/components/vector_store_management/TestVectorStoreTab.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/TestVectorStoreTab.tsx similarity index 96% rename from ui/litellm-dashboard/src/components/vector_store_management/TestVectorStoreTab.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/TestVectorStoreTab.tsx index e96f149196e..3156da0b413 100644 --- a/ui/litellm-dashboard/src/components/vector_store_management/TestVectorStoreTab.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/TestVectorStoreTab.tsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import { Card, Select, Typography } from "antd"; import { VectorStoreTester } from "./VectorStoreTester"; -import { VectorStore } from "./types"; +import { VectorStore } from "@/components/vector_store_management/types"; const { Text, Title } = Typography; diff --git a/ui/litellm-dashboard/src/components/vector_store_management/VectorStoreForm.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreForm.test.tsx similarity index 88% rename from ui/litellm-dashboard/src/components/vector_store_management/VectorStoreForm.test.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreForm.test.tsx index 97d18e33640..e371cbfba42 100644 --- a/ui/litellm-dashboard/src/components/vector_store_management/VectorStoreForm.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreForm.test.tsx @@ -1,9 +1,9 @@ import { render, screen } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; -import { CredentialItem } from "../networking"; +import { CredentialItem } from "@/components/networking"; import VectorStoreForm from "./VectorStoreForm"; -vi.mock("../networking"); +vi.mock("@/components/networking"); describe("VectorStoreForm", () => { it("should render the form when visible", () => { diff --git a/ui/litellm-dashboard/src/components/vector_store_management/VectorStoreForm.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreForm.tsx similarity index 98% rename from ui/litellm-dashboard/src/components/vector_store_management/VectorStoreForm.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreForm.tsx index 224b7e083a5..82417286738 100644 --- a/ui/litellm-dashboard/src/components/vector_store_management/VectorStoreForm.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreForm.tsx @@ -2,17 +2,17 @@ import React, { useState, useEffect } from "react"; import { TextInput, Button as TremorButton } from "@tremor/react"; import { Modal, Form, Select, Tooltip, Input, Alert } from "antd"; import { InfoCircleOutlined } from "@ant-design/icons"; -import { CredentialItem, vectorStoreCreateCall } from "../networking"; +import { CredentialItem, vectorStoreCreateCall } from "@/components/networking"; import { VectorStoreProviders, vectorStoreProviderLogoMap, vectorStoreProviderMap, getProviderSpecificFields, VectorStoreFieldConfig, -} from "../vector_store_providers"; +} from "@/components/vector_store_providers"; import { resolveLogoSrc } from "@/lib/assetPaths"; import { fetchAvailableModels, ModelGroup } from "@/components/llm_calls/fetch_models"; -import NotificationsManager from "../molecules/notifications_manager"; +import NotificationsManager from "@/components/molecules/notifications_manager"; interface VectorStoreFormProps { isVisible: boolean; diff --git a/ui/litellm-dashboard/src/components/vector_store_management/VectorStoreTable.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreTable.test.tsx similarity index 98% rename from ui/litellm-dashboard/src/components/vector_store_management/VectorStoreTable.test.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreTable.test.tsx index 54b05bc73b5..45ca40152fa 100644 --- a/ui/litellm-dashboard/src/components/vector_store_management/VectorStoreTable.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreTable.test.tsx @@ -2,17 +2,17 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { beforeEach, describe, expect, it, vi } from "vitest"; import VectorStoreTable from "./VectorStoreTable"; -import { VectorStore } from "./types"; +import { VectorStore } from "@/components/vector_store_management/types"; // Mock dependencies const mockGetProviderLogoAndName = vi.fn(); const mockTableIconActionButton = vi.fn(); -vi.mock("../provider_info_helpers", () => ({ +vi.mock("@/components/provider_info_helpers", () => ({ getProviderLogoAndName: (...args: any[]) => mockGetProviderLogoAndName(...args), })); -vi.mock("../common_components/IconActionButton/TableIconActionButtons/TableIconActionButton", () => ({ +vi.mock("@/components/common_components/IconActionButton/TableIconActionButtons/TableIconActionButton", () => ({ default: (props: any) => { mockTableIconActionButton(props); return ( diff --git a/ui/litellm-dashboard/src/components/vector_store_management/VectorStoreTable.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreTable.tsx similarity index 96% rename from ui/litellm-dashboard/src/components/vector_store_management/VectorStoreTable.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreTable.tsx index c2e47cebe69..074af873601 100644 --- a/ui/litellm-dashboard/src/components/vector_store_management/VectorStoreTable.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreTable.tsx @@ -11,9 +11,9 @@ import { Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow } fro import { Tooltip } from "antd"; import React from "react"; import { DateCell, IdCell } from "@/components/shared/table_cells"; -import TableIconActionButton from "../common_components/IconActionButton/TableIconActionButtons/TableIconActionButton"; -import { getProviderLogoAndName } from "../provider_info_helpers"; -import { VectorStore } from "./types"; +import TableIconActionButton from "@/components/common_components/IconActionButton/TableIconActionButtons/TableIconActionButton"; +import { getProviderLogoAndName } from "@/components/provider_info_helpers"; +import { VectorStore } from "@/components/vector_store_management/types"; interface VectorStoreTableProps { data: VectorStore[]; diff --git a/ui/litellm-dashboard/src/components/vector_store_management/VectorStoreTester.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreTester.tsx similarity index 98% rename from ui/litellm-dashboard/src/components/vector_store_management/VectorStoreTester.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreTester.tsx index a90f49ea5b3..fa4587b526c 100644 --- a/ui/litellm-dashboard/src/components/vector_store_management/VectorStoreTester.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreTester.tsx @@ -2,8 +2,8 @@ import React, { useState } from "react"; import { Button, Input, Card, Typography, Spin, Divider } from "antd"; import MessageManager from "@/components/molecules/message_manager"; import { SendOutlined, DatabaseOutlined, LoadingOutlined, DownOutlined, RightOutlined } from "@ant-design/icons"; -import { vectorStoreSearchCall } from "../networking"; -import NotificationsManager from "../molecules/notifications_manager"; +import { vectorStoreSearchCall } from "@/components/networking"; +import NotificationsManager from "@/components/molecules/notifications_manager"; const { TextArea } = Input; const { Text, Title } = Typography; diff --git a/ui/litellm-dashboard/src/components/vector_store_management/index.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/index.tsx similarity index 94% rename from ui/litellm-dashboard/src/components/vector_store_management/index.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/index.tsx index 354a79e4a2a..fd02effc972 100644 --- a/ui/litellm-dashboard/src/components/vector_store_management/index.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/index.tsx @@ -12,16 +12,21 @@ import { TabPanel, } from "@tremor/react"; import { RefreshIcon } from "@heroicons/react/outline"; -import { vectorStoreListCall, vectorStoreDeleteCall, credentialListCall, CredentialItem } from "../networking"; -import { VectorStore } from "./types"; +import { + vectorStoreListCall, + vectorStoreDeleteCall, + credentialListCall, + CredentialItem, +} from "@/components/networking"; +import { VectorStore } from "@/components/vector_store_management/types"; import VectorStoreTable from "./VectorStoreTable"; import VectorStoreForm from "./VectorStoreForm"; -import DeleteResourceModal from "../common_components/DeleteResourceModal"; +import DeleteResourceModal from "@/components/common_components/DeleteResourceModal"; import VectorStoreInfoView from "./vector_store_info"; import CreateVectorStore from "./CreateVectorStore"; import TestVectorStoreTab from "./TestVectorStoreTab"; import { isAdminRole } from "@/utils/roles"; -import NotificationsManager from "../molecules/notifications_manager"; +import NotificationsManager from "@/components/molecules/notifications_manager"; interface VectorStoreProps { accessToken: string | null; diff --git a/ui/litellm-dashboard/src/components/vector_store_management/vector_store_info.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/vector_store_info.tsx similarity index 97% rename from ui/litellm-dashboard/src/components/vector_store_management/vector_store_info.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/vector_store_info.tsx index 1929224d01d..7c27b347eb1 100644 --- a/ui/litellm-dashboard/src/components/vector_store_management/vector_store_info.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/vector_store_info.tsx @@ -3,12 +3,17 @@ import { Card, Text, Title, Button, Badge, TabGroup, TabList, Tab, TabPanels, Ta import { Form, Input, Select as Select2, Tooltip, Button as AntButton } from "antd"; import { InfoCircleOutlined } from "@ant-design/icons"; import { ArrowLeftIcon } from "@heroicons/react/outline"; -import { vectorStoreInfoCall, vectorStoreUpdateCall, credentialListCall, CredentialItem } from "../networking"; -import { VectorStore } from "./types"; -import { Providers, providerLogoMap, provider_map } from "../provider_info_helpers"; +import { + vectorStoreInfoCall, + vectorStoreUpdateCall, + credentialListCall, + CredentialItem, +} from "@/components/networking"; +import { VectorStore } from "@/components/vector_store_management/types"; +import { Providers, providerLogoMap, provider_map } from "@/components/provider_info_helpers"; import { resolveLogoSrc } from "@/lib/assetPaths"; import VectorStoreTester from "./VectorStoreTester"; -import NotificationsManager from "../molecules/notifications_manager"; +import NotificationsManager from "@/components/molecules/notifications_manager"; interface VectorStoreInfoViewProps { vectorStoreId: string; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/page.tsx index ba280c1c313..34759152d11 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/page.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/vector-stores/page.tsx @@ -1,6 +1,6 @@ "use client"; -import VectorStoreManagement from "@/components/vector_store_management"; +import VectorStoreManagement from "./_components"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; export default function VectorStores() { diff --git a/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx b/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx index 07ed1cb5c2e..5add4a2ed48 100644 --- a/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx +++ b/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx @@ -131,8 +131,8 @@ vi.mock("@/components/guardrails", () => ({ default: stub("guardrails") })); vi.mock("@/components/prompts", () => ({ default: stub("prompts") })); vi.mock("@/components/transform_request", () => ({ default: stub("transform-request") })); vi.mock("@/components/mcp_tools", () => ({ MCPServers: stub("mcp-servers") })); -vi.mock("@/components/tag_management", () => ({ default: stub("tag-management") })); -vi.mock("@/components/vector_store_management", () => ({ default: stub("vector-stores") })); +vi.mock("@/app/(dashboard)/tag-management/_components", () => ({ default: stub("tag-management") })); +vi.mock("@/app/(dashboard)/vector-stores/_components", () => ({ default: stub("vector-stores") })); vi.mock("@/components/ui_theme_settings", () => ({ default: stub("ui-theme-settings") })); vi.mock("@/components/organisms/create_key_button", () => ({ fetchUserModels: vi.fn() })); vi.mock("@/components/common_components/fetch_teams", () => ({ fetchTeams: vi.fn() }));