fix: eslint warnings (#252)
This commit is contained in:
@@ -55,6 +55,7 @@ import { useFormGuard } from '@/utils/formGuard';
|
||||
import { PriorityMessages } from '@/types/priority';
|
||||
import { RunStatusMessages, TestRunCaseStatusMessages } from '@/types/status';
|
||||
import { TestTypeMessages } from '@/types/testType';
|
||||
import { logError } from '@/utils/errorHandler';
|
||||
|
||||
const defaultTestRun = {
|
||||
id: 0,
|
||||
@@ -132,12 +133,13 @@ export default function RunEditor({
|
||||
setFolders(foldersData);
|
||||
setSelectedFolder(foldersData[0]);
|
||||
initTestCases();
|
||||
} catch (error: any) {
|
||||
console.error('Error in effect:', error.message);
|
||||
} catch (error: unknown) {
|
||||
logError('Error fetching run data', error);
|
||||
}
|
||||
}
|
||||
|
||||
fetchDataEffect();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [tokenContext]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -146,8 +148,8 @@ export default function RunEditor({
|
||||
try {
|
||||
const filteredData = testCases.filter((testCase) => testCase.folderId === selectedFolder.id);
|
||||
setFilteredTestCases(filteredData);
|
||||
} catch (error: any) {
|
||||
console.error('Error fetching cases data:', error.message);
|
||||
} catch (error: unknown) {
|
||||
logError('Error filtering test cases', error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import React from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
import dynamic from 'next/dynamic';
|
||||
import { testRunCaseStatus } from '@/config/selection';
|
||||
@@ -34,7 +33,7 @@ export default function RunProgressDounut({ statusCounts, testRunCaseStatusMessa
|
||||
const colors = testRunCaseStatus.map((entry) => entry.chartColor);
|
||||
const legend = {
|
||||
labels: {
|
||||
colors: testRunCaseStatus.map((entry) => {
|
||||
colors: testRunCaseStatus.map(() => {
|
||||
if (theme === 'light') {
|
||||
return 'black';
|
||||
} else {
|
||||
@@ -52,7 +51,7 @@ export default function RunProgressDounut({ statusCounts, testRunCaseStatusMessa
|
||||
};
|
||||
|
||||
updateChartDate();
|
||||
}, [statusCounts, theme]);
|
||||
}, [statusCounts, testRunCaseStatusMessages, theme]);
|
||||
|
||||
return <Chart options={chartData.options} series={chartData.series} type="donut" width={'100%'} height={'100%'} />;
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@ import TestCasePriority from '@/components/TestCasePriority';
|
||||
import { TokenContext } from '@/utils/TokenProvider';
|
||||
import { fetchCase } from '@/utils/caseControl';
|
||||
import { TestTypeMessages } from '@/types/testType';
|
||||
import { logError } from '@/utils/errorHandler';
|
||||
|
||||
type Props = {
|
||||
isOpen: boolean;
|
||||
caseId: number;
|
||||
onCancel: () => void;
|
||||
onChangeStatus: (changeCaseId: number, status: number) => {};
|
||||
messages: RunMessages;
|
||||
testTypeMessages: TestTypeMessages;
|
||||
priorityMessages: PriorityMessages;
|
||||
@@ -37,7 +37,6 @@ export default function TestCaseDetailDialog({
|
||||
isOpen,
|
||||
caseId,
|
||||
onCancel,
|
||||
onChangeStatus,
|
||||
messages,
|
||||
testTypeMessages,
|
||||
priorityMessages,
|
||||
@@ -66,8 +65,8 @@ export default function TestCaseDetailDialog({
|
||||
}
|
||||
|
||||
setTestCase(data);
|
||||
} catch (error: any) {
|
||||
console.error('Error in effect:', error.message);
|
||||
} catch (error: unknown) {
|
||||
logError('Error fetching case data', error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@ import {
|
||||
CircleX,
|
||||
CircleSlash2,
|
||||
} from 'lucide-react';
|
||||
import TestCaseDetailDialog from './TestCaseDetailDialog';
|
||||
import { testRunCaseStatus } from '@/config/selection';
|
||||
import { CaseType } from '@/types/case';
|
||||
import { RunMessages } from '@/types/run';
|
||||
import TestCaseDetailDialog from './TestCaseDetailDialog';
|
||||
import { PriorityMessages } from '@/types/priority';
|
||||
import TestCasePriority from '@/components/TestCasePriority';
|
||||
import { TestTypeMessages } from '@/types/testType';
|
||||
@@ -40,9 +40,9 @@ type Props = {
|
||||
isDisabled: boolean;
|
||||
selectedKeys: Selection;
|
||||
onSelectionChange: React.Dispatch<React.SetStateAction<Selection>>;
|
||||
onChangeStatus: (changeCaseId: number, status: number) => {};
|
||||
onIncludeCase: (includeCaseId: number) => {};
|
||||
onExcludeCase: (excludeCaseId: number) => {};
|
||||
onChangeStatus: (changeCaseId: number, status: number) => void;
|
||||
onIncludeCase: (includeCaseId: number) => void;
|
||||
onExcludeCase: (excludeCaseId: number) => void;
|
||||
messages: RunMessages;
|
||||
testRunCaseStatusMessages: TestRunCaseStatusMessages;
|
||||
priorityMessages: PriorityMessages;
|
||||
@@ -296,7 +296,6 @@ export default function TestCaseSelector({
|
||||
isOpen={isTestCaseDetailDialogOpen}
|
||||
caseId={showingTestCaseId}
|
||||
onCancel={hideTestCaseDetailDialog}
|
||||
onChangeStatus={(showingCaseId, newStatus) => onChangeStatus(showingCaseId, newStatus)}
|
||||
messages={messages}
|
||||
priorityMessages={priorityMessages}
|
||||
testTypeMessages={testTypeMessages}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import RunEditor from './RunEditor';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import RunEditor from './RunEditor';
|
||||
import { RunMessages } from '@/types/run';
|
||||
import { PriorityMessages } from '@/types/priority';
|
||||
import { RunStatusMessages, TestRunCaseStatusMessages } from '@/types/status';
|
||||
|
||||
Reference in New Issue
Block a user