fix: eslint warnings (#252)
This commit is contained in:
@@ -1,22 +1,23 @@
|
||||
'use client';
|
||||
import { useState, useEffect, useContext } from 'react';
|
||||
import { title, subtitle } from '@/components/primitives';
|
||||
import { Card, CardBody, Chip, Divider } from '@heroui/react';
|
||||
import { Folder, Clipboard, FlaskConical } from 'lucide-react';
|
||||
import { ProgressSeriesType } from '@/types/run';
|
||||
import { HomeMessages } from './page';
|
||||
import { TokenContext } from '@/utils/TokenProvider';
|
||||
import { aggregateBasicInfo, aggregateTestPriority, aggregateTestType, aggregateProgress } from './aggregate';
|
||||
import Config from '@/config/config';
|
||||
import { useTheme } from 'next-themes';
|
||||
import { aggregateBasicInfo, aggregateTestPriority, aggregateTestType, aggregateProgress } from './aggregate';
|
||||
import { HomeMessages } from './page';
|
||||
import TestTypesChart from './TestTypesDonutChart';
|
||||
import TestPriorityChart from './TestPriorityDonutChart';
|
||||
import TestProgressBarChart from './TestProgressColumnChart';
|
||||
import Config from '@/config/config';
|
||||
import { TokenContext } from '@/utils/TokenProvider';
|
||||
import { ProgressSeriesType } from '@/types/run';
|
||||
import { title, subtitle } from '@/components/primitives';
|
||||
import { TestRunCaseStatusMessages } from '@/types/status';
|
||||
import { TestTypeMessages } from '@/types/testType';
|
||||
import { PriorityMessages } from '@/types/priority';
|
||||
import { ProjectType } from '@/types/project';
|
||||
import { CasePriorityCountType, CaseTypeCountType } from '@/types/chart';
|
||||
import { logError } from '@/utils/errorHandler';
|
||||
|
||||
const apiServer = Config.apiServer;
|
||||
|
||||
@@ -38,8 +39,8 @@ async function fetchProject(jwt: string, projectId: number) {
|
||||
}
|
||||
const data = await response.json();
|
||||
return data;
|
||||
} catch (error: any) {
|
||||
console.error('Error fetching data:', error.message);
|
||||
} catch (error: unknown) {
|
||||
logError('Error fetching data:', error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +60,7 @@ export function ProjectHome({
|
||||
priorityMessages,
|
||||
}: Props) {
|
||||
const context = useContext(TokenContext);
|
||||
const { theme, setTheme } = useTheme();
|
||||
const { theme } = useTheme();
|
||||
const [project, setProject] = useState<ProjectType>({
|
||||
id: 0,
|
||||
name: '',
|
||||
@@ -88,13 +89,13 @@ export function ProjectHome({
|
||||
try {
|
||||
const data = await fetchProject(context.token.access_token, Number(projectId));
|
||||
setProject(data);
|
||||
} catch (error: any) {
|
||||
console.error('Error in effect:', error.message);
|
||||
} catch (error: unknown) {
|
||||
logError('Error in effect:', error);
|
||||
}
|
||||
}
|
||||
|
||||
fetchDataEffect();
|
||||
}, [context]);
|
||||
}, [context, projectId]);
|
||||
|
||||
useEffect(() => {
|
||||
async function aggregate() {
|
||||
@@ -118,7 +119,7 @@ export function ProjectHome({
|
||||
}
|
||||
|
||||
aggregate();
|
||||
}, [project]);
|
||||
}, [project, testRunCaseStatusMessages]);
|
||||
|
||||
return (
|
||||
<div className="container mx-auto max-w-5xl pt-6 px-6 flex-grow">
|
||||
|
||||
Reference in New Issue
Block a user