Skip to content

Commit f1e96f7

Browse files
Use more standard name for callback
1 parent f8e6cce commit f1e96f7

6 files changed

Lines changed: 19 additions & 23 deletions

File tree

extensions/ql-vscode/src/view/results/RawTableValue.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function RawTableValue(props: Props): JSX.Element {
2424
loc={rawValue.url}
2525
label={rawValue.label}
2626
databaseUri={props.databaseUri}
27-
jumpToLocationCallback={props.onSelected}
27+
handleClick={props.onSelected}
2828
/>
2929
);
3030
}

extensions/ql-vscode/src/view/results/alert-table.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export class AlertTable extends React.Component<
130130
relatedLocations={result.relatedLocations}
131131
sourceLocationPrefix={sourceLocationPrefix}
132132
databaseUri={databaseUri}
133-
jumpToLocationCallback={updateSelectionCallback(resultKey)}
133+
handleClick={updateSelectionCallback(resultKey)}
134134
/>
135135
);
136136

@@ -144,7 +144,7 @@ export class AlertTable extends React.Component<
144144
loc={result.locations[0]}
145145
sourceLocationPrefix={sourceLocationPrefix}
146146
databaseUri={databaseUri}
147-
jumpToLocationCallback={updateSelectionCallback(resultKey)}
147+
handleClick={updateSelectionCallback(resultKey)}
148148
/>
149149
);
150150
const locationCells = (
@@ -262,9 +262,7 @@ export class AlertTable extends React.Component<
262262
loc={step.location}
263263
sourceLocationPrefix={sourceLocationPrefix}
264264
databaseUri={databaseUri}
265-
jumpToLocationCallback={updateSelectionCallback(
266-
pathNodeKey,
267-
)}
265+
handleClick={updateSelectionCallback(pathNodeKey)}
268266
/>
269267
) : (
270268
"[no location]"
@@ -275,9 +273,7 @@ export class AlertTable extends React.Component<
275273
loc={step.location}
276274
sourceLocationPrefix={sourceLocationPrefix}
277275
databaseUri={databaseUri}
278-
jumpToLocationCallback={updateSelectionCallback(
279-
pathNodeKey,
280-
)}
276+
handleClick={updateSelectionCallback(pathNodeKey)}
281277
/>
282278
) : (
283279
""

extensions/ql-vscode/src/view/results/locations/ClickableLocation.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface Props {
88
label: string;
99
databaseUri: string;
1010
title?: string;
11-
jumpToLocationCallback?: () => void;
11+
handleClick?: () => void;
1212
}
1313

1414
/**
@@ -19,16 +19,16 @@ export function ClickableLocation({
1919
label,
2020
databaseUri,
2121
title,
22-
jumpToLocationCallback,
22+
handleClick,
2323
}: Props): JSX.Element {
2424
const jumpToLocationHandler = useCallback(
2525
(e: React.MouseEvent) => {
2626
e.preventDefault();
2727
e.stopPropagation();
2828
jumpToLocation(loc, databaseUri);
29-
jumpToLocationCallback?.();
29+
handleClick?.();
3030
},
31-
[loc, databaseUri, jumpToLocationCallback],
31+
[loc, databaseUri, handleClick],
3232
);
3333

3434
return (

extensions/ql-vscode/src/view/results/locations/Location.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface Props {
1515
label?: string;
1616
databaseUri?: string;
1717
title?: string;
18-
jumpToLocationCallback?: () => void;
18+
handleClick?: () => void;
1919
}
2020

2121
/**
@@ -26,7 +26,7 @@ export function Location({
2626
label,
2727
databaseUri,
2828
title,
29-
jumpToLocationCallback,
29+
handleClick,
3030
}: Props): JSX.Element {
3131
const resolvableLoc = useMemo(() => tryGetResolvableLocation(loc), [loc]);
3232
const displayLabel = useMemo(() => convertNonPrintableChars(label!), [label]);
@@ -43,7 +43,7 @@ export function Location({
4343
label={displayLabel}
4444
databaseUri={databaseUri}
4545
title={title}
46-
jumpToLocationCallback={jumpToLocationCallback}
46+
handleClick={handleClick}
4747
/>
4848
);
4949
}

extensions/ql-vscode/src/view/results/locations/SarifLocation.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface Props {
1111
loc?: Sarif.Location;
1212
sourceLocationPrefix: string;
1313
databaseUri: string;
14-
jumpToLocationCallback: () => void;
14+
handleClick: () => void;
1515
}
1616

1717
/**
@@ -25,7 +25,7 @@ export function SarifLocation({
2525
loc,
2626
sourceLocationPrefix,
2727
databaseUri,
28-
jumpToLocationCallback,
28+
handleClick,
2929
}: Props) {
3030
const parsedLoc = useMemo(
3131
() => loc && parseSarifLocation(loc, sourceLocationPrefix),
@@ -40,7 +40,7 @@ export function SarifLocation({
4040
label={text || `${basename(parsedLoc.userVisibleFile)}`}
4141
databaseUri={databaseUri}
4242
title={text ? undefined : `${parsedLoc.userVisibleFile}`}
43-
jumpToLocationCallback={jumpToLocationCallback}
43+
handleClick={handleClick}
4444
/>
4545
);
4646
} else if (isLineColumnLoc(parsedLoc)) {
@@ -55,7 +55,7 @@ export function SarifLocation({
5555
}
5656
databaseUri={databaseUri}
5757
title={text ? undefined : `${parsedLoc.userVisibleFile}`}
58-
jumpToLocationCallback={jumpToLocationCallback}
58+
handleClick={handleClick}
5959
/>
6060
);
6161
} else {

extensions/ql-vscode/src/view/results/locations/SarifMessageWithLocations.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface Props {
88
relatedLocations: Sarif.Location[];
99
sourceLocationPrefix: string;
1010
databaseUri: string;
11-
jumpToLocationCallback: () => void;
11+
handleClick: () => void;
1212
}
1313

1414
/**
@@ -19,7 +19,7 @@ export function SarifMessageWithLocations({
1919
relatedLocations,
2020
sourceLocationPrefix,
2121
databaseUri,
22-
jumpToLocationCallback,
22+
handleClick,
2323
}: Props) {
2424
const relatedLocationsById: Map<number, Sarif.Location> = new Map();
2525
for (const loc of relatedLocations) {
@@ -41,7 +41,7 @@ export function SarifMessageWithLocations({
4141
loc={relatedLocationsById.get(part.dest)}
4242
sourceLocationPrefix={sourceLocationPrefix}
4343
databaseUri={databaseUri}
44-
jumpToLocationCallback={jumpToLocationCallback}
44+
handleClick={handleClick}
4545
/>
4646
);
4747
}

0 commit comments

Comments
 (0)