Fix issue when first predicted row is null. (#895)
This commit is contained in:
Родитель
3c2b4a450c
Коммит
5959cae3bd
|
@ -78,7 +78,7 @@ export default class RegionalTable extends React.Component<IRegionalTableProps,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
const columnHeaderRow = [];
|
const columnHeaderRow = [];
|
||||||
const colKeys = Object.keys(regionalTableToView?.valueObject?.[Object.keys(regionalTableToView?.valueObject)?.[0]]?.valueObject || {});
|
const colKeys = this.getColumnNames(regionalTableToView);
|
||||||
if (colKeys.length === 0) {
|
if (colKeys.length === 0) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
@ -166,6 +166,12 @@ export default class RegionalTable extends React.Component<IRegionalTableProps,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getColumnNames = (table) => {
|
||||||
|
const rows = Object.values(table?.valueObject || {});
|
||||||
|
const firstNonNullRow = rows.find(r => r != null) as any;
|
||||||
|
return Object.keys(firstNonNullRow?.valueObject || {});
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче