@@ -66,54 +66,6 @@ export class AlertTable extends React.Component<
6666 e . preventDefault ( ) ;
6767 }
6868
69- render ( ) : JSX . Element {
70- const { databaseUri, resultSet } = this . props ;
71-
72- const { numTruncatedResults, sourceLocationPrefix } =
73- resultSet . interpretation ;
74-
75- const updateSelectionCallback = (
76- resultKey : Keys . PathNode | Keys . Result | undefined ,
77- ) => {
78- this . setState ( ( previousState ) => ( {
79- ...previousState ,
80- selectedItem : resultKey ,
81- } ) ) ;
82- sendTelemetry ( "local-results-alert-table-path-selected" ) ;
83- } ;
84-
85- if ( ! resultSet . interpretation . data . runs ?. [ 0 ] ?. results ?. length ) {
86- return < AlertTableNoResults { ...this . props } /> ;
87- }
88-
89- return (
90- < table className = { className } >
91- < AlertTableHeader sortState = { resultSet . interpretation . data . sortState } />
92- < tbody >
93- { resultSet . interpretation . data . runs [ 0 ] . results . map (
94- ( result , resultIndex ) => (
95- < AlertTableResultRow
96- key = { resultIndex }
97- result = { result }
98- resultIndex = { resultIndex }
99- expanded = { this . state . expanded }
100- selectedItem = { this . state . selectedItem }
101- databaseUri = { databaseUri }
102- sourceLocationPrefix = { sourceLocationPrefix }
103- updateSelectionCallback = { updateSelectionCallback }
104- toggleExpanded = { this . toggle . bind ( this ) }
105- scroller = { this . scroller }
106- />
107- ) ,
108- ) }
109- < AlertTableTruncatedMessage
110- numTruncatedResults = { numTruncatedResults }
111- />
112- </ tbody >
113- </ table >
114- ) ;
115- }
116-
11769 private getNewSelection (
11870 key : Keys . ResultKey | undefined ,
11971 direction : NavigationDirection ,
@@ -232,4 +184,52 @@ export class AlertTable extends React.Component<
232184 componentWillUnmount ( ) {
233185 onNavigation . removeListener ( this . handleNavigationEvent ) ;
234186 }
187+
188+ render ( ) : JSX . Element {
189+ const { databaseUri, resultSet } = this . props ;
190+
191+ const { numTruncatedResults, sourceLocationPrefix } =
192+ resultSet . interpretation ;
193+
194+ const updateSelectionCallback = (
195+ resultKey : Keys . PathNode | Keys . Result | undefined ,
196+ ) => {
197+ this . setState ( ( previousState ) => ( {
198+ ...previousState ,
199+ selectedItem : resultKey ,
200+ } ) ) ;
201+ sendTelemetry ( "local-results-alert-table-path-selected" ) ;
202+ } ;
203+
204+ if ( ! resultSet . interpretation . data . runs ?. [ 0 ] ?. results ?. length ) {
205+ return < AlertTableNoResults { ...this . props } /> ;
206+ }
207+
208+ return (
209+ < table className = { className } >
210+ < AlertTableHeader sortState = { resultSet . interpretation . data . sortState } />
211+ < tbody >
212+ { resultSet . interpretation . data . runs [ 0 ] . results . map (
213+ ( result , resultIndex ) => (
214+ < AlertTableResultRow
215+ key = { resultIndex }
216+ result = { result }
217+ resultIndex = { resultIndex }
218+ expanded = { this . state . expanded }
219+ selectedItem = { this . state . selectedItem }
220+ databaseUri = { databaseUri }
221+ sourceLocationPrefix = { sourceLocationPrefix }
222+ updateSelectionCallback = { updateSelectionCallback }
223+ toggleExpanded = { this . toggle . bind ( this ) }
224+ scroller = { this . scroller }
225+ />
226+ ) ,
227+ ) }
228+ < AlertTableTruncatedMessage
229+ numTruncatedResults = { numTruncatedResults }
230+ />
231+ </ tbody >
232+ </ table >
233+ ) ;
234+ }
235235}
0 commit comments