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 @@ -21,9 +21,8 @@ import { sendTelemetry } from "../common/telemetry";
2121import { AlertTableHeader } from "./AlertTableHeader" ;
2222import { SarifMessageWithLocations } from "./locations/SarifMessageWithLocations" ;
2323import { SarifLocation } from "./locations/SarifLocation" ;
24- import { EmptyQueryResultsMessage } from "./EmptyQueryResultsMessage" ;
25- import TextButton from "../common/TextButton" ;
2624import { AlertTableDropdownIndicatorCell } from "./AlertTableDropdownIndicatorCell" ;
25+ import { AlertTableNoResults } from "./AlertTableNoResults" ;
2726
2827type AlertTableProps = ResultTableProps & {
2928 resultSet : InterpretedResultSet < SarifInterpretationData > ;
@@ -70,22 +69,6 @@ export class AlertTable extends React.Component<
7069 e . preventDefault ( ) ;
7170 }
7271
73- renderNoResults ( ) : JSX . Element {
74- if ( this . props . nonemptyRawResults ) {
75- return (
76- < span >
77- No Alerts. See{ " " }
78- < TextButton onClick = { this . props . showRawResults } >
79- raw results
80- </ TextButton >
81- .
82- </ span >
83- ) ;
84- } else {
85- return < EmptyQueryResultsMessage /> ;
86- }
87- }
88-
8972 render ( ) : JSX . Element {
9073 const { databaseUri, resultSet } = this . props ;
9174
@@ -112,7 +95,7 @@ export class AlertTable extends React.Component<
11295 } ;
11396
11497 if ( ! resultSet . interpretation . data . runs ?. [ 0 ] ?. results ?. length ) {
115- return this . renderNoResults ( ) ;
98+ return < AlertTableNoResults { ... this . props } /> ;
11699 }
117100
118101 resultSet . interpretation . data . runs [ 0 ] . results . forEach (
Original file line number Diff line number Diff line change 1+ import * as React from "react" ;
2+ import { EmptyQueryResultsMessage } from "./EmptyQueryResultsMessage" ;
3+ import TextButton from "../common/TextButton" ;
4+
5+ interface Props {
6+ nonemptyRawResults : boolean ;
7+ showRawResults : ( ) => void ;
8+ }
9+
10+ export function AlertTableNoResults ( props : Props ) : JSX . Element {
11+ if ( props . nonemptyRawResults ) {
12+ return (
13+ < span >
14+ No Alerts. See{ " " }
15+ < TextButton onClick = { props . showRawResults } > raw results</ TextButton > .
16+ </ span >
17+ ) ;
18+ } else {
19+ return < EmptyQueryResultsMessage /> ;
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments