Navigation: Add help menu to top search bar (#55062)

* add help menu to top search bar

* fixes

* handle preventDefault in node graph specifically

* use icon prop of MenuItem

* undo changes to ContextMenuPlugin/DataLinksContextMenu

* remove unused component

* revert storybook changes

* Tweaks

* remove unused style

* stop propagation on the header so version can be highlighted

* make sure useContextMenu has the exact same logic as before

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
This commit is contained in:
Leo
2022-09-17 18:17:00 +02:00
committed by GitHub
parent 17b2fb04e8
commit 1a0cbdeabe
7 changed files with 73 additions and 62 deletions

View File

@@ -109,7 +109,17 @@ function mapMenuItem<T extends NodeDatum | EdgeDatum>(item: T) {
url={link.url}
label={link.label}
ariaLabel={link.ariaLabel}
onClick={link.onClick ? () => link.onClick?.(item) : undefined}
onClick={
link.onClick
? (event) => {
if (!(event?.ctrlKey || event?.metaKey || event?.shiftKey)) {
event?.preventDefault();
event?.stopPropagation();
link.onClick?.(item);
}
}
: undefined
}
target={'_self'}
/>
);