File tree Expand file tree Collapse file tree
extensions/ql-vscode/src/view/results Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import { SarifMessageWithLocations } from "./locations/SarifMessageWithLocations
2323import { SarifLocation } from "./locations/SarifLocation" ;
2424import { AlertTableDropdownIndicatorCell } from "./AlertTableDropdownIndicatorCell" ;
2525import { AlertTableNoResults } from "./AlertTableNoResults" ;
26+ import { AlertTableTruncatedMessage } from "./AlertTableTruncatedMessage" ;
2627
2728type AlertTableProps = ResultTableProps & {
2829 resultSet : InterpretedResultSet < SarifInterpretationData > ;
@@ -295,21 +296,15 @@ export class AlertTable extends React.Component<
295296 } ,
296297 ) ;
297298
298- if ( numTruncatedResults > 0 ) {
299- rows . push (
300- < tr key = "truncatd-message" >
301- < td colSpan = { 5 } style = { { textAlign : "center" , fontStyle : "italic" } } >
302- Too many results to show at once. { numTruncatedResults } result(s)
303- omitted.
304- </ td >
305- </ tr > ,
306- ) ;
307- }
308-
309299 return (
310300 < table className = { className } >
311301 < AlertTableHeader sortState = { resultSet . interpretation . data . sortState } />
312- < tbody > { rows } </ tbody >
302+ < tbody >
303+ { rows }
304+ < AlertTableTruncatedMessage
305+ numTruncatedResults = { numTruncatedResults }
306+ />
307+ </ tbody >
313308 </ table >
314309 ) ;
315310 }
Original file line number Diff line number Diff line change 1+ import * as React from "react" ;
2+
3+ interface Props {
4+ numTruncatedResults : number ;
5+ }
6+
7+ export function AlertTableTruncatedMessage ( props : Props ) : JSX . Element | null {
8+ if ( props . numTruncatedResults === 0 ) {
9+ return null ;
10+ }
11+ return (
12+ < tr key = "truncatd-message" >
13+ < td colSpan = { 5 } style = { { textAlign : "center" , fontStyle : "italic" } } >
14+ Too many results to show at once. { props . numTruncatedResults } result(s)
15+ omitted.
16+ </ td >
17+ </ tr >
18+ ) ;
19+ }
You can’t perform that action at this time.
0 commit comments