Rename handleClick => onClick

This commit is contained in:
Robert
2023-07-18 15:11:22 +01:00
parent 1f16294d7e
commit b6c60b26cd
6 changed files with 19 additions and 19 deletions

View File

@@ -24,7 +24,7 @@ export default function RawTableValue(props: Props): JSX.Element {
loc={rawValue.url}
label={rawValue.label}
databaseUri={props.databaseUri}
handleClick={props.onSelected}
onClick={props.onSelected}
/>
);
}

View File

@@ -130,7 +130,7 @@ export class AlertTable extends React.Component<
relatedLocations={result.relatedLocations}
sourceLocationPrefix={sourceLocationPrefix}
databaseUri={databaseUri}
handleClick={updateSelectionCallback(resultKey)}
onClick={updateSelectionCallback(resultKey)}
/>
);
@@ -144,7 +144,7 @@ export class AlertTable extends React.Component<
loc={result.locations[0]}
sourceLocationPrefix={sourceLocationPrefix}
databaseUri={databaseUri}
handleClick={updateSelectionCallback(resultKey)}
onClick={updateSelectionCallback(resultKey)}
/>
);
const locationCells = (
@@ -262,7 +262,7 @@ export class AlertTable extends React.Component<
loc={step.location}
sourceLocationPrefix={sourceLocationPrefix}
databaseUri={databaseUri}
handleClick={updateSelectionCallback(pathNodeKey)}
onClick={updateSelectionCallback(pathNodeKey)}
/>
) : (
"[no location]"
@@ -273,7 +273,7 @@ export class AlertTable extends React.Component<
loc={step.location}
sourceLocationPrefix={sourceLocationPrefix}
databaseUri={databaseUri}
handleClick={updateSelectionCallback(pathNodeKey)}
onClick={updateSelectionCallback(pathNodeKey)}
/>
) : (
""

View File

@@ -8,7 +8,7 @@ interface Props {
label: string;
databaseUri: string;
title?: string;
handleClick?: () => void;
onClick?: () => void;
}
/**
@@ -19,16 +19,16 @@ export function ClickableLocation({
label,
databaseUri,
title,
handleClick,
onClick: onClick,
}: Props): JSX.Element {
const jumpToLocationHandler = useCallback(
(e: React.MouseEvent) => {
e.preventDefault();
e.stopPropagation();
jumpToLocation(loc, databaseUri);
handleClick?.();
onClick?.();
},
[loc, databaseUri, handleClick],
[loc, databaseUri, onClick],
);
return (

View File

@@ -15,7 +15,7 @@ interface Props {
label?: string;
databaseUri?: string;
title?: string;
handleClick?: () => void;
onClick?: () => void;
}
/**
@@ -26,7 +26,7 @@ export function Location({
label,
databaseUri,
title,
handleClick,
onClick,
}: Props): JSX.Element {
const resolvableLoc = useMemo(() => tryGetResolvableLocation(loc), [loc]);
const displayLabel = useMemo(() => convertNonPrintableChars(label), [label]);
@@ -49,7 +49,7 @@ export function Location({
label={displayLabel}
databaseUri={databaseUri}
title={title}
handleClick={handleClick}
onClick={onClick}
/>
);
}

View File

@@ -11,7 +11,7 @@ interface Props {
loc?: Sarif.Location;
sourceLocationPrefix: string;
databaseUri: string;
handleClick: () => void;
onClick: () => void;
}
/**
@@ -25,7 +25,7 @@ export function SarifLocation({
loc,
sourceLocationPrefix,
databaseUri,
handleClick,
onClick,
}: Props) {
const parsedLoc = useMemo(
() => loc && parseSarifLocation(loc, sourceLocationPrefix),
@@ -42,7 +42,7 @@ export function SarifLocation({
label={text || `${basename(parsedLoc.userVisibleFile)}`}
databaseUri={databaseUri}
title={text ? undefined : `${parsedLoc.userVisibleFile}`}
handleClick={handleClick}
onClick={onClick}
/>
);
}
@@ -59,7 +59,7 @@ export function SarifLocation({
}
databaseUri={databaseUri}
title={text ? undefined : `${parsedLoc.userVisibleFile}`}
handleClick={handleClick}
onClick={onClick}
/>
);
}

View File

@@ -8,7 +8,7 @@ interface Props {
relatedLocations: Sarif.Location[];
sourceLocationPrefix: string;
databaseUri: string;
handleClick: () => void;
onClick: () => void;
}
/**
@@ -19,7 +19,7 @@ export function SarifMessageWithLocations({
relatedLocations,
sourceLocationPrefix,
databaseUri,
handleClick,
onClick,
}: Props) {
const relatedLocationsById: Map<number, Sarif.Location> = new Map();
for (const loc of relatedLocations) {
@@ -41,7 +41,7 @@ export function SarifMessageWithLocations({
loc={relatedLocationsById.get(part.dest)}
sourceLocationPrefix={sourceLocationPrefix}
databaseUri={databaseUri}
handleClick={handleClick}
onClick={onClick}
/>
);
}