mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 03:15:53 +08:00
feat(dashboard): enable cmd+click for dashboard name in list (#3947)
This commit is contained in:
parent
dc7a55e871
commit
d8a8430a5b
@ -1,7 +1,6 @@
|
||||
import { LockFilled } from '@ant-design/icons';
|
||||
import ROUTES from 'constants/routes';
|
||||
import history from 'lib/history';
|
||||
import { generatePath } from 'react-router-dom';
|
||||
|
||||
import { Data } from '..';
|
||||
import { TableLinkText } from './styles';
|
||||
@ -9,12 +8,14 @@ import { TableLinkText } from './styles';
|
||||
function Name(name: Data['name'], data: Data): JSX.Element {
|
||||
const { id: DashboardId, isLocked } = data;
|
||||
|
||||
const onClickHandler = (): void => {
|
||||
history.push(
|
||||
generatePath(ROUTES.DASHBOARD, {
|
||||
dashboardId: DashboardId,
|
||||
}),
|
||||
);
|
||||
const getLink = (): string => `${ROUTES.ALL_DASHBOARD}/${DashboardId}`;
|
||||
|
||||
const onClickHandler = (event: React.MouseEvent<HTMLElement>): void => {
|
||||
if (event.metaKey || event.ctrlKey) {
|
||||
window.open(getLink(), '_blank');
|
||||
} else {
|
||||
history.push(getLink());
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
Loading…
x
Reference in New Issue
Block a user