Hello,
We have a custom Web Panel at location “bitbucket.web.repository.browse.filebrowser.before”
This web panel displays correctly when the page is loaded, and uses the context branch (our com.atlassian.plugin.web.ContextProvider implementation uses the atRevisionRef param for rendering).
It works the first time the page is loaded, but it does not refresh when another branch is selected, since bitbucket only refreshes a partial of the view with AJAX.
I think It should probably refresh this panel as well, since the atRevisionRef is different.
First of all, thanks for getting back to this ticket and apologies that no one tried to help you.
As you pointed out, the current web panel doesn’t refresh the value of plugin context when a new branch is selected. The reason for that is, the plugin point is rendered on server-side, and we don’t want to refresh the whole page.
What I think you could try to do is to get the current branch reference using the JS API in the browser:
This code will return an entity object that contains information about currently selected repository, branch, and git reference metadata including e.g. git commit hash.
Could you please show me a full example of how to do it correctly, specially what needs to be included in atlassian-plugin.xml file. A minimal reproducible example of a plugin would be awesome.
Hi @eduardo.ramos.ibanez sorry for keeping you waiting but I was on holidays last weeks.
I managed to create a basic example for you. You can keep using web panels if you want. The code is a bit hacky since we need to listen to the browser URL changes and there is no optimal solution for that. You can take a look at the demo here:
Hi @jan, the DO_NOT_USE events don’t have the same type of support as any other plugin APIs in the product. Bitbucket team can change and/or remove those events at any point in time.
If you wish to request the official support for some of the events, you can create a feature request ticket on this page: https://jira.atlassian.com/browse/BSERV