DashboardGadget : how to distinguish between a simple access view and a refresh action triggered by user?

By following the documentation https://developer.atlassian.com/platform/forge/ui-kit-components/jira/dashboard-gadget/ , I don’t see how this can be done.
When entering the View component It seems there is no way to make the distinction ?

Hi @MathieuRIO,

There is no way to distinguish between those two scenarios. What may help you though, is the new feature we are currently working on. In short, if you are using Custom UI (or Connect), there will be a way to implement your own refresh logic so the gadget is not force reloaded by Jira, instead the responsibility to reload it is delegated to you. UI kit won’t be supported. I can’t provide any dates, just keep an eye on the changelog.

Thanks,
Vitalii

Hi @vpetrychuk , i’m not sure i understand, even in UI Kit, i can already provide a refresh parameter in the Edit submit function to store it, and then use it in the View to know if i need to refresh or not by comparing my last execution to current time. But how can i know if the user wants to force a refresh by clicking on Refresh button ?

@MathieuRIO,

It is not possible at the moment. However, we are working on the feature that would allow gadgets to implement their own refresh logic in case user clicks the refresh button. So instead of reloading the gadget as we do right now, gadgets would receive an event that user requested the update and they could handle that request on their own in any way they prefer.

Thanks,
Vitalii

2 Likes

ok, thank you for the info