mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
refactor(ui): colocate search-tools into route-level _components (#31658)
This commit is contained in:
parent
494d04c2a2
commit
ddba2e2b15
17 changed files with 29 additions and 28 deletions
|
|
@ -505,7 +505,7 @@
|
|||
"count": 1
|
||||
}
|
||||
},
|
||||
"src/components/SearchTools/CreateSearchTools.tsx": {
|
||||
"src/app/(dashboard)/search-tools/_components/CreateSearchTools.tsx": {
|
||||
"no-restricted-imports": {
|
||||
"count": 1
|
||||
},
|
||||
|
|
@ -513,17 +513,17 @@
|
|||
"count": 1
|
||||
}
|
||||
},
|
||||
"src/components/SearchTools/SearchToolTester.tsx": {
|
||||
"src/app/(dashboard)/search-tools/_components/SearchToolTester.tsx": {
|
||||
"no-restricted-imports": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"src/components/SearchTools/SearchToolView.tsx": {
|
||||
"src/app/(dashboard)/search-tools/_components/SearchToolView.tsx": {
|
||||
"no-restricted-imports": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"src/components/SearchTools/SearchTools.tsx": {
|
||||
"src/app/(dashboard)/search-tools/_components/SearchTools.tsx": {
|
||||
"no-restricted-imports": {
|
||||
"count": 1
|
||||
},
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import { Button, TextInput } from "@tremor/react";
|
|||
import { Form, Input, Modal, Select, Tooltip, Typography } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { resolveLogoSrc } from "@/lib/assetPaths";
|
||||
import NotificationsManager from "../molecules/notifications_manager";
|
||||
import { createSearchTool, fetchAvailableSearchProviders } from "../networking";
|
||||
import NotificationsManager from "@/components/molecules/notifications_manager";
|
||||
import { createSearchTool, fetchAvailableSearchProviders } from "@/components/networking";
|
||||
import SearchConnectionTest from "./SearchConnectionTest";
|
||||
import { AvailableSearchProvider, SearchTool } from "./types";
|
||||
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import { InfoCircleOutlined, WarningOutlined } from "@ant-design/icons";
|
||||
import { Button, Divider, Typography } from "antd";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import NotificationsManager from "../molecules/notifications_manager";
|
||||
import { testSearchToolConnection } from "../networking";
|
||||
import NotificationsManager from "@/components/molecules/notifications_manager";
|
||||
import { testSearchToolConnection } from "@/components/networking";
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { Tag } from "antd";
|
||||
import { ColumnsType } from "antd/es/table";
|
||||
import TableIconActionButton from "../common_components/IconActionButton/TableIconActionButtons/TableIconActionButton";
|
||||
import TableIconActionButton from "@/components/common_components/IconActionButton/TableIconActionButtons/TableIconActionButton";
|
||||
import { SearchTool } from "./types";
|
||||
|
||||
export const searchToolColumns = (
|
||||
|
|
@ -2,10 +2,10 @@ import { render, screen, waitFor } from "@testing-library/react";
|
|||
import userEvent from "@testing-library/user-event";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { SearchToolTester } from "./SearchToolTester";
|
||||
import * as networking from "../networking";
|
||||
import NotificationsManager from "../molecules/notifications_manager";
|
||||
import * as networking from "@/components/networking";
|
||||
import NotificationsManager from "@/components/molecules/notifications_manager";
|
||||
|
||||
vi.mock("../networking", () => ({
|
||||
vi.mock("@/components/networking", () => ({
|
||||
searchToolQueryCall: vi.fn(),
|
||||
}));
|
||||
|
||||
|
|
@ -2,8 +2,8 @@ import React, { useState } from "react";
|
|||
import { Button, Input, Typography, Spin } from "antd";
|
||||
import MessageManager from "@/components/molecules/message_manager";
|
||||
import { SearchOutlined, LoadingOutlined } from "@ant-design/icons";
|
||||
import { searchToolQueryCall } from "../networking";
|
||||
import NotificationsManager from "../molecules/notifications_manager";
|
||||
import { searchToolQueryCall } from "@/components/networking";
|
||||
import NotificationsManager from "@/components/molecules/notifications_manager";
|
||||
import { Card, Title as TremorTitle } from "@tremor/react";
|
||||
|
||||
const { Text } = Typography;
|
||||
|
|
@ -3,11 +3,11 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|||
import { render, screen, waitFor } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import * as networking from "../networking";
|
||||
import * as networking from "@/components/networking";
|
||||
import SearchTools from "./SearchTools";
|
||||
import { AvailableSearchProvider, SearchTool } from "./types";
|
||||
|
||||
vi.mock("../networking", () => ({
|
||||
vi.mock("@/components/networking", () => ({
|
||||
fetchSearchTools: vi.fn(),
|
||||
updateSearchTool: vi.fn(),
|
||||
deleteSearchTool: vi.fn(),
|
||||
|
|
@ -46,7 +46,7 @@ vi.mock("./CreateSearchTools", () => {
|
|||
return { default: CreateSearchTools };
|
||||
});
|
||||
|
||||
vi.mock("../common_components/DeleteResourceModal", () => {
|
||||
vi.mock("@/components/common_components/DeleteResourceModal", () => {
|
||||
const DeleteResourceModal = ({
|
||||
isOpen,
|
||||
onOk,
|
||||
|
|
@ -4,9 +4,14 @@ import { useQuery } from "@tanstack/react-query";
|
|||
import { Button, Text, Title } from "@tremor/react";
|
||||
import { Form, Input, Modal, Select, Spin, Table } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import DeleteResourceModal from "../common_components/DeleteResourceModal";
|
||||
import NotificationsManager from "../molecules/notifications_manager";
|
||||
import { deleteSearchTool, fetchAvailableSearchProviders, fetchSearchTools, updateSearchTool } from "../networking";
|
||||
import DeleteResourceModal from "@/components/common_components/DeleteResourceModal";
|
||||
import NotificationsManager from "@/components/molecules/notifications_manager";
|
||||
import {
|
||||
deleteSearchTool,
|
||||
fetchAvailableSearchProviders,
|
||||
fetchSearchTools,
|
||||
updateSearchTool,
|
||||
} from "@/components/networking";
|
||||
import CreateSearchTool from "./CreateSearchTools";
|
||||
import { searchToolColumns } from "./SearchToolColumn";
|
||||
import { SearchToolView } from "./SearchToolView";
|
||||
|
|
@ -0,0 +1 @@
|
|||
export { default as SearchTools } from "./SearchTools";
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
"use client";
|
||||
|
||||
import { SearchTools } from "@/components/SearchTools";
|
||||
import { SearchTools } from "./_components";
|
||||
import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
|
||||
|
||||
export default function SearchToolsPage() {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ import NotificationsManager from "./molecules/notifications_manager";
|
|||
import { Organization, fetchMCPAccessGroups, getGuardrailsList, getPoliciesList, teamDeleteCall } from "./networking";
|
||||
import NumericalInput from "./shared/numerical_input";
|
||||
import VectorStoreSelector from "./vector_store_management/VectorStoreSelector";
|
||||
import SearchToolSelector from "./SearchTools/SearchToolSelector";
|
||||
import SearchToolSelector from "./search_tools/SearchToolSelector";
|
||||
|
||||
interface TeamProps {
|
||||
accessToken: string | null;
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
export { default as SearchTools } from "./SearchTools";
|
||||
export { SearchToolView } from "./SearchToolView";
|
||||
export { default as SearchConnectionTest } from "./SearchConnectionTest";
|
||||
export { SearchToolTester } from "./SearchToolTester";
|
||||
export * from "./types";
|
||||
|
|
@ -49,7 +49,7 @@ import { fetchMCPAccessGroups } from "../networking";
|
|||
import ObjectPermissionsView from "../object_permissions_view";
|
||||
import NumericalInput from "../shared/numerical_input";
|
||||
import VectorStoreSelector from "../vector_store_management/VectorStoreSelector";
|
||||
import SearchToolSelector from "../SearchTools/SearchToolSelector";
|
||||
import SearchToolSelector from "../search_tools/SearchToolSelector";
|
||||
import EditLoggingSettings from "./EditLoggingSettings";
|
||||
import RouterSettingsAccordion, { RouterSettingsAccordionRef } from "../common_components/RouterSettingsAccordion";
|
||||
import MemberModal from "./EditMembership";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue