Following guides online I have been attempting to create a page decorator for “bitbucket.repository.general” which is a bitbucket decorator defined here Plugin decorators
I have been working through the examples located in the bitbucket-client-side-extensions-template but don’t see any examples for how to do this with client side extensions. (Bitbucket)
Does anyone know of a solution for this?
I tried this (initially I hard coded the meta tags just to get something working)
import { PageExtension } from '@atlassian/clientside-extensions';
/**
* @clientside-extension
* @extension-point bitbucket.repository.nav
* @label page-extension.label
* @page-url /page-extension
* @page-title page-extension.title
* @page-decorator bitbucket.repository.general
*/
export default PageExtension.factory(container => {
container.innerHTML = (
<head>
<meta name="projectKey" content="PROJECT_1"/>
<meta name="repositorySlug" content="rep_1"/>
<meta name="activeTab" content="extensions__repository__some-header-extension__js"/>
</head>
);
});
However a new page opens up with a 500 error and in the server logs I see these soy exceptions.
[INFO] Caused by: com.google.template.soy.sharedpasses.render.RenderException: When evaluating "to_json($project)": While computing function "to_json($project)": null
[INFO] at bitbucket.internal.layout.project.project.project(project.soy:86)
...
[INFO] 2021-09-22 11:45:11,396 ERROR [http-nio-7990-exec-7] o.a.c.c.C.[.[.[/bitbucket].[plugins] Servlet.service() for servlet [plugins] in context with path [/bitbucket] threw exception
[INFO] com.google.template.soy.tofu.SoyTofuException: When evaluating "to_json($project)": While computing function "to_json($project)": null
Any help would be appreciated.