Minor UI updates to make numbers and dates a bit more human friendly
Signed-off-by: Jeremy Guarini <jguarini@paloaltonetworks.com>
This commit is contained in:
@@ -69,6 +69,11 @@ const getTrendIcon = (trend: number, classes: ClassNameMap) => {
|
||||
}
|
||||
};
|
||||
|
||||
// convert timestamp to human friendly form
|
||||
function formatDateToHuman(timeStamp: string | number) {
|
||||
return new Date(timeStamp).toUTCString();
|
||||
}
|
||||
|
||||
export const CoverageHistoryChart = () => {
|
||||
const { entity } = useEntity();
|
||||
const codeCoverageApi = useApi(codeCoverageApiRef);
|
||||
@@ -149,10 +154,10 @@ export const CoverageHistoryChart = () => {
|
||||
margin={{ right: 48, top: 32 }}
|
||||
>
|
||||
<CartesianGrid strokeDasharray="3 3" />
|
||||
<XAxis dataKey="timestamp" />
|
||||
<XAxis dataKey="timestamp" tickFormatter={formatDateToHuman} />
|
||||
<YAxis dataKey="line.percentage" />
|
||||
<YAxis dataKey="branch.percentage" />
|
||||
<Tooltip />
|
||||
<Tooltip labelFormatter={formatDateToHuman} />
|
||||
<Legend />
|
||||
<Line
|
||||
type="monotone"
|
||||
|
||||
@@ -232,7 +232,7 @@ export const FileExplorer = () => {
|
||||
title: 'Coverage',
|
||||
type: 'numeric',
|
||||
field: 'coverage',
|
||||
render: (row: CoverageTableRow) => `${row.coverage}%`,
|
||||
render: (row: CoverageTableRow) => `${row.coverage.toFixed(2)}%`,
|
||||
},
|
||||
{
|
||||
title: 'Missing lines',
|
||||
|
||||
Reference in New Issue
Block a user