mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
Fix linting WIP
This commit is contained in:
parent
4c40469951
commit
37c423eb00
6 changed files with 7 additions and 25 deletions
|
|
@ -15,7 +15,6 @@ const {
|
|||
deleteAgent,
|
||||
getListAgentsByAccess,
|
||||
countPromotedAgents,
|
||||
updateAgentProjects,
|
||||
revertAgentVersion,
|
||||
} = require('~/models/Agent');
|
||||
const {
|
||||
|
|
@ -30,7 +29,6 @@ const { refreshS3Url } = require('~/server/services/Files/S3/crud');
|
|||
const { filterFile } = require('~/server/services/Files/process');
|
||||
const { updateAction, getActions } = require('~/models/Action');
|
||||
const { getCachedTools } = require('~/server/services/Config');
|
||||
const { revertAgentVersion } = require('~/models/Agent');
|
||||
const { deleteFileByFilter } = require('~/models/File');
|
||||
const { getCategoriesWithCounts } = require('~/models');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,9 @@
|
|||
import React, { useCallback, useContext } from 'react';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import {
|
||||
QueryKeys,
|
||||
Constants,
|
||||
EModelEndpoint,
|
||||
PermissionTypes,
|
||||
Permissions,
|
||||
} from 'librechat-data-provider';
|
||||
import type { TMessage, TStartupConfig } from 'librechat-data-provider';
|
||||
import { QueryKeys, Constants, PermissionTypes, Permissions } from 'librechat-data-provider';
|
||||
import type { TMessage } from 'librechat-data-provider';
|
||||
import { NewChatIcon, MobileSidebar, Sidebar } from '~/components/svg';
|
||||
import { getDefaultModelSpec, getModelSpecPreset } from '~/utils';
|
||||
import { TooltipAnchor, Button } from '~/components/ui';
|
||||
import { useLocalize, useNewConvo, useHasAccess } from '~/hooks';
|
||||
import { AuthContext } from '~/hooks/AuthContext';
|
||||
|
|
@ -37,7 +29,6 @@ export default function NewChat({
|
|||
const navigate = useNavigate();
|
||||
const localize = useLocalize();
|
||||
const { conversation } = store.useCreateConversationAtom(index);
|
||||
const endpointsConfig = useRecoilValue(store.endpointsConfig);
|
||||
const authContext = useContext(AuthContext);
|
||||
const hasAccessToAgents = useHasAccess({
|
||||
permissionType: PermissionTypes.AGENTS,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import { useToast } from '~/hooks';
|
|||
import { Dialog, DialogContent, Button } from '~/components/ui';
|
||||
import { DotsIcon } from '~/components/svg';
|
||||
import { renderAgentAvatar } from '~/utils/agents';
|
||||
import { Query, useQueryClient } from '@tanstack/react-query';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
|
||||
interface AgentDetailProps {
|
||||
agent: AgentWithSupport; // The agent data to display
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { useAgentCategories } from '~/hooks/Agents';
|
|||
import useLocalize from '~/hooks/useLocalize';
|
||||
import { Button } from '~/components/ui';
|
||||
import { Spinner } from '~/components/svg';
|
||||
import { SmartLoader, useHasData } from './SmartLoader';
|
||||
import { useHasData } from './SmartLoader';
|
||||
import ErrorDisplay from './ErrorDisplay';
|
||||
import AgentCard from './AgentCard';
|
||||
import { cn } from '~/utils';
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ export default function AgentPanel({
|
|||
}
|
||||
|
||||
return canEdit;
|
||||
}, [agentQuery.data?.id, user?.id, user?.role, canEdit]);
|
||||
}, [agentQuery.data?.id, user?.role, canEdit]);
|
||||
|
||||
return (
|
||||
<FormProvider {...methods}>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
|
||||
import { render, screen, fireEvent } from '@testing-library/react';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import CategoryTabs from '../CategoryTabs';
|
||||
import AgentGrid from '../AgentGrid';
|
||||
|
|
@ -46,12 +46,7 @@ jest.mock(
|
|||
return translations[key] || key;
|
||||
}),
|
||||
);
|
||||
|
||||
jest.mock('~/hooks/Agents', () => ({
|
||||
useDynamicAgentQuery: jest.fn(),
|
||||
}));
|
||||
|
||||
const { useDynamicAgentQuery } = require('~/hooks/Agents');
|
||||
const useDynamicAgentQuery = jest.fn();
|
||||
|
||||
// Create wrapper with QueryClient
|
||||
const createWrapper = () => {
|
||||
|
|
@ -418,5 +413,3 @@ describe('Accessibility Improvements', () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
export default {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue