mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 19:05:59 +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 { LockFilled } from '@ant-design/icons';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import { generatePath } from 'react-router-dom';
|
|
||||||
|
|
||||||
import { Data } from '..';
|
import { Data } from '..';
|
||||||
import { TableLinkText } from './styles';
|
import { TableLinkText } from './styles';
|
||||||
@ -9,12 +8,14 @@ import { TableLinkText } from './styles';
|
|||||||
function Name(name: Data['name'], data: Data): JSX.Element {
|
function Name(name: Data['name'], data: Data): JSX.Element {
|
||||||
const { id: DashboardId, isLocked } = data;
|
const { id: DashboardId, isLocked } = data;
|
||||||
|
|
||||||
const onClickHandler = (): void => {
|
const getLink = (): string => `${ROUTES.ALL_DASHBOARD}/${DashboardId}`;
|
||||||
history.push(
|
|
||||||
generatePath(ROUTES.DASHBOARD, {
|
const onClickHandler = (event: React.MouseEvent<HTMLElement>): void => {
|
||||||
dashboardId: DashboardId,
|
if (event.metaKey || event.ctrlKey) {
|
||||||
}),
|
window.open(getLink(), '_blank');
|
||||||
);
|
} else {
|
||||||
|
history.push(getLink());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user