Commit 16245896 authored by Bruno d'Auria's avatar Bruno d'Auria
Browse files

fix(resource-status/Graph): Fix invalid date with null lower limit (#9087)

parent 7c3374c9
import { map, pipe, reduce, filter, pathOr, addIndex } from 'ramda';
import { map, pipe, reduce, filter, addIndex, isNil, path } from 'ramda';
import { Metric, TimeValue, GraphData, Line } from './models';
......@@ -37,8 +37,15 @@ const toTimeTickValue = (
};
const getTimeSeries = (graphData: GraphData): Array<TimeValue> => {
const isGreaterThanLowerLimit = (value): boolean =>
value >= pathOr(value - 1, ['global', 'lower-limit'], graphData);
const isGreaterThanLowerLimit = (value): boolean => {
const lowerLimit = path<number>(['global', 'lower-limit'], graphData);
if (isNil(lowerLimit)) {
return true;
}
return value >= lowerLimit;
};
const rejectLowerThanLimit = ({ time, ...metrics }: TimeValue): TimeValue => {
return {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment