mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-17 23:47:12 +00:00
fix: use override method on alerts and overview
This commit is contained in:
parent
1f2db8bf4b
commit
eaaf244ab1
@ -21,20 +21,12 @@ function AlertChannels({ allChannels }: AlertChannelsProps): JSX.Element {
|
||||
const [action] = useComponentPermission(['new_alert_action'], user.role);
|
||||
|
||||
const onClickEditHandler = useCallback((id: string, e: React.MouseEvent) => {
|
||||
if (e.metaKey || e.ctrlKey) {
|
||||
window.open(
|
||||
generatePath(ROUTES.CHANNELS_EDIT, {
|
||||
channelId: id,
|
||||
}),
|
||||
'_blank',
|
||||
);
|
||||
} else {
|
||||
history.push(
|
||||
generatePath(ROUTES.CHANNELS_EDIT, {
|
||||
channelId: id,
|
||||
}),
|
||||
);
|
||||
}
|
||||
history.push(
|
||||
generatePath(ROUTES.CHANNELS_EDIT, {
|
||||
channelId: id,
|
||||
}),
|
||||
e,
|
||||
);
|
||||
}, []);
|
||||
|
||||
const columns: ColumnsType<Channels> = [
|
||||
|
||||
@ -38,11 +38,7 @@ export function AlertsEmptyState(): JSX.Element {
|
||||
|
||||
const onClickNewAlertHandler = useCallback((e: React.MouseEvent) => {
|
||||
setLoading(false);
|
||||
if (e.metaKey || e.ctrlKey) {
|
||||
window.open(ROUTES.ALERTS_NEW, '_blank');
|
||||
} else {
|
||||
history.push(ROUTES.ALERTS_NEW);
|
||||
}
|
||||
history.push(ROUTES.ALERTS_NEW, e);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
@ -235,7 +235,7 @@ function Application(): JSX.Element {
|
||||
timestamp: number,
|
||||
apmToTraceQuery: Query,
|
||||
isViewLogsClicked?: boolean,
|
||||
openInNewTab?: boolean,
|
||||
e?: React.MouseEvent,
|
||||
): (() => void) => (): void => {
|
||||
// eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
const endTime = secondsToMilliseconds(timestamp);
|
||||
@ -261,11 +261,7 @@ function Application(): JSX.Element {
|
||||
queryString,
|
||||
);
|
||||
|
||||
if (openInNewTab) {
|
||||
window.open(newPath, '_blank');
|
||||
} else {
|
||||
history.push(newPath);
|
||||
}
|
||||
history.push(newPath, e);
|
||||
},
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[stepInterval],
|
||||
@ -385,20 +381,10 @@ function Application(): JSX.Element {
|
||||
<GraphControlsPanel
|
||||
id="Error_button"
|
||||
onViewLogsClick={(e: React.MouseEvent): void =>
|
||||
onErrorTrackHandler(
|
||||
selectedTimeStamp,
|
||||
logErrorQuery,
|
||||
undefined,
|
||||
e.metaKey || e.ctrlKey,
|
||||
)()
|
||||
onErrorTrackHandler(selectedTimeStamp, logErrorQuery, undefined, e)()
|
||||
}
|
||||
onViewTracesClick={(e: React.MouseEvent): void =>
|
||||
onErrorTrackHandler(
|
||||
selectedTimeStamp,
|
||||
errorTrackQuery,
|
||||
undefined,
|
||||
e.metaKey || e.ctrlKey,
|
||||
)()
|
||||
onErrorTrackHandler(selectedTimeStamp, errorTrackQuery, undefined, e)()
|
||||
}
|
||||
/>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user