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 {
|
||||
const columnHeaderRow = [];
|
||||
const colKeys = Object.keys(regionalTableToView?.valueObject?.[Object.keys(regionalTableToView?.valueObject)?.[0]]?.valueObject || {});
|
||||
const colKeys = this.getColumnNames(regionalTableToView);
|
||||
if (colKeys.length === 0) {
|
||||
return (
|
||||
<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() {
|
||||
return (
|
||||
<>
|
||||
|
|
Загрузка…
Ссылка в новой задаче