11import * as React from "react" ;
22import * as Sarif from "sarif" ;
33import * as Keys from "./result-keys" ;
4- import { chevronDown , chevronRight , info , listUnordered } from "./octicons" ;
4+ import { info , listUnordered } from "./octicons" ;
55import {
66 className ,
77 ResultTableProps ,
@@ -22,6 +22,7 @@ import { AlertTableHeader } from "./AlertTableHeader";
2222import { SarifMessageWithLocations } from "./locations/SarifMessageWithLocations" ;
2323import { SarifLocation } from "./locations/SarifLocation" ;
2424import { EmptyQueryResultsMessage } from "./EmptyQueryResultsMessage" ;
25+ import { AlertTableDropdownIndicatorCell } from "./AlertTableDropdownIndicatorCell" ;
2526
2627type AlertTableProps = ResultTableProps & {
2728 resultSet : InterpretedResultSet < SarifInterpretationData > ;
@@ -137,7 +138,6 @@ export class AlertTable extends React.Component<
137138 const currentResultExpanded = this . state . expanded . has (
138139 Keys . keyToString ( resultKey ) ,
139140 ) ;
140- const indicator = currentResultExpanded ? chevronDown : chevronRight ;
141141 const location = result . locations !== undefined &&
142142 result . locations . length > 0 && (
143143 < SarifLocation
@@ -184,16 +184,10 @@ export class AlertTable extends React.Component<
184184 { ...selectableZebraStripe ( resultRowIsSelected , resultIndex ) }
185185 key = { resultIndex }
186186 >
187- { /*
188- eslint-disable-next-line
189- jsx-a11y/no-noninteractive-element-interactions
190- */ }
191- < td
192- className = "vscode-codeql__icon-cell vscode-codeql__dropdown-cell"
193- onMouseDown = { toggler ( indices ) }
194- >
195- { indicator }
196- </ td >
187+ < AlertTableDropdownIndicatorCell
188+ expanded = { currentResultExpanded }
189+ onClick = { toggler ( indices ) }
190+ />
197191 < td className = "vscode-codeql__icon-cell" > { listUnordered } </ td >
198192 < td colSpan = { 2 } > { msg } </ td >
199193 { locationCells }
@@ -206,9 +200,6 @@ export class AlertTable extends React.Component<
206200 Keys . keyToString ( pathKey ) ,
207201 ) ;
208202 if ( currentResultExpanded ) {
209- const indicator = currentPathExpanded
210- ? chevronDown
211- : chevronRight ;
212203 const isPathSpecificallySelected = Keys . equalsNotUndefined (
213204 pathKey ,
214205 selectedItem ,
@@ -225,16 +216,10 @@ export class AlertTable extends React.Component<
225216 < td className = "vscode-codeql__icon-cell" >
226217 < span className = "vscode-codeql__vertical-rule" > </ span >
227218 </ td >
228- { /*
229- eslint-disable-next-line
230- jsx-a11y/no-noninteractive-element-interactions
231- */ }
232- < td
233- className = "vscode-codeql__icon-cell vscode-codeql__dropdown-cell"
234- onMouseDown = { toggler ( [ pathKey ] ) }
235- >
236- { indicator }
237- </ td >
219+ < AlertTableDropdownIndicatorCell
220+ expanded = { currentPathExpanded }
221+ onClick = { toggler ( [ pathKey ] ) }
222+ />
238223 < td className = "vscode-codeql__text-center" colSpan = { 3 } >
239224 Path
240225 </ td >
0 commit comments