refactor: test run case status messages duplication
This commit is contained in:
@@ -2,16 +2,17 @@ import React from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
import dynamic from 'next/dynamic';
|
||||
import { testRunCaseStatus } from '@/config/selection';
|
||||
import { RunStatusCountType, RunMessages } from '@/types/run';
|
||||
import { RunStatusCountType } from '@/types/run';
|
||||
import { TestStatusMessages } from '@/types/testStatus';
|
||||
const Chart = dynamic(() => import('react-apexcharts'), { ssr: false });
|
||||
|
||||
type Props = {
|
||||
statusCounts: RunStatusCountType[];
|
||||
messages: RunMessages;
|
||||
statusMessages: TestStatusMessages;
|
||||
theme: string | undefined;
|
||||
};
|
||||
|
||||
export default function RunProgressDounut({ statusCounts, messages, theme }: Props) {
|
||||
export default function RunProgressDounut({ statusCounts, statusMessages, theme }: Props) {
|
||||
const [chartData, setChartData] = useState({
|
||||
series: [],
|
||||
options: {
|
||||
@@ -28,7 +29,7 @@ export default function RunProgressDounut({ statusCounts, messages, theme }: Pro
|
||||
return found ? found.count : 0;
|
||||
});
|
||||
|
||||
const labels = testRunCaseStatus.map((entry) => messages[entry.uid]);
|
||||
const labels = testRunCaseStatus.map((entry) => statusMessages[entry.uid]);
|
||||
const colors = testRunCaseStatus.map((entry) => entry.chartColor);
|
||||
const legend = {
|
||||
labels: {
|
||||
|
||||
Reference in New Issue
Block a user