How to add panel menu options with React

Previously we were able to add our own panel options by binding a panel actions function:

this.events.on('init-panel-actions', this.onInitPanelActions.bind(this))

Does anyone know how to do this with the new React template?

The only relevant thing I can find is the PanelEvents.initPanelActions constant from @grafana/data.

Unfortunately, event handling support is limited for React plugins. But we’re working on improving it. If you want to follow the work on adding this, subscribe to this pull request.

1 Like

I am trying to hide certain panel Menu options, but not base on user access level(Viewer or Editor).

How can I do that?

I tried to modify the getPanelMenu.ts file located at
/usr/share/grafana/public/app/features/dashboard/utils/

But changes done here, are not working, even after server reboot.

If there are any pointers, it would be really helpful.