mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
PluginExtensions: Fixed issue in typings for the onClick link callback (#65978)
* Fixed bug with event being forced. * Made onClick undefinable in the config as well. * Fixed some more type issues.
This commit is contained in:
@@ -108,14 +108,14 @@ function getLinkExtensionOverrides(pluginId: string, config: PluginExtensionLink
|
||||
function getLinkExtensionOnClick(
|
||||
config: PluginExtensionLinkConfig,
|
||||
context?: object
|
||||
): ((event: React.MouseEvent) => void) | undefined {
|
||||
): ((event?: React.MouseEvent) => void) | undefined {
|
||||
const { onClick } = config;
|
||||
|
||||
if (!onClick) {
|
||||
return;
|
||||
}
|
||||
|
||||
return function onClickExtensionLink(event: React.MouseEvent) {
|
||||
return function onClickExtensionLink(event?: React.MouseEvent) {
|
||||
try {
|
||||
const result = onClick(event, getEventHelpers(context));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user