Remove rows array and render AlertTableResultRow inline
This commit is contained in:
@@ -94,29 +94,26 @@ export class AlertTable extends React.Component<
|
|||||||
return <AlertTableNoResults {...this.props} />;
|
return <AlertTableNoResults {...this.props} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const rows: JSX.Element[] =
|
|
||||||
resultSet.interpretation.data.runs[0].results.map(
|
|
||||||
(result, resultIndex) => (
|
|
||||||
<AlertTableResultRow
|
|
||||||
key={resultIndex}
|
|
||||||
result={result}
|
|
||||||
resultIndex={resultIndex}
|
|
||||||
expanded={this.state.expanded}
|
|
||||||
selectedItem={this.state.selectedItem}
|
|
||||||
databaseUri={databaseUri}
|
|
||||||
sourceLocationPrefix={sourceLocationPrefix}
|
|
||||||
updateSelectionCallback={updateSelectionCallback}
|
|
||||||
toggler={toggler}
|
|
||||||
scroller={this.scroller}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<table className={className}>
|
<table className={className}>
|
||||||
<AlertTableHeader sortState={resultSet.interpretation.data.sortState} />
|
<AlertTableHeader sortState={resultSet.interpretation.data.sortState} />
|
||||||
<tbody>
|
<tbody>
|
||||||
{rows}
|
{resultSet.interpretation.data.runs[0].results.map(
|
||||||
|
(result, resultIndex) => (
|
||||||
|
<AlertTableResultRow
|
||||||
|
key={resultIndex}
|
||||||
|
result={result}
|
||||||
|
resultIndex={resultIndex}
|
||||||
|
expanded={this.state.expanded}
|
||||||
|
selectedItem={this.state.selectedItem}
|
||||||
|
databaseUri={databaseUri}
|
||||||
|
sourceLocationPrefix={sourceLocationPrefix}
|
||||||
|
updateSelectionCallback={updateSelectionCallback}
|
||||||
|
toggler={toggler}
|
||||||
|
scroller={this.scroller}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
)}
|
||||||
<AlertTableTruncatedMessage
|
<AlertTableTruncatedMessage
|
||||||
numTruncatedResults={numTruncatedResults}
|
numTruncatedResults={numTruncatedResults}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user