fix MyEntries when metric tests is none

This commit is contained in:
Mateusz 2022-12-15 10:11:32 +01:00
parent b8d1434040
commit c5d45ac7c4
2 changed files with 17 additions and 11 deletions

View File

@ -23,14 +23,16 @@ const getMyEntries = (challengeName, setDataOriginalState, setDataStateForSearch
};
}
for (let test of tests) {
if (!Object.hasOwn(item.evaluations, `${test.metric}.${test.name}`)) {
item = {
...item,
evaluations: {
...item.evaluations,
[`${test.metric}.${test.name}`]: '-1'
}
};
if (item.evaluations) {
if (!Object.hasOwn(item.evaluations, `${test.metric}.${test.name}`)) {
item = {
...item,
evaluations: {
...item.evaluations,
[`${test.metric}.${test.name}`]: '-1'
}
};
}
}
}
item = {

View File

@ -121,10 +121,14 @@ const Table = (props) => {
else {
let newElem = [];
for (let metric of props.possibleMetrics) {
if (elem[props.iterableColumnElement.name][metric] === '-1')
if (Object.hasOwn(elem, props.iterableColumnElement.name)) {
if (elem[props.iterableColumnElement.name][metric] === '-1')
newElem.push('N/A');
else
newElem.push(elem[props.iterableColumnElement.name][metric]);
} else {
newElem.push('N/A');
else
newElem.push(elem[props.iterableColumnElement.name][metric]);
}
}
elem = newElem;
}