Repository Banner Client Web Panel

I’m having trouble adding a repository banner client-web-panel to our plugin. I’ve got the following in my atlassian-plugin.xml:

    <!-- Pull Request Client Resources -->
    <client-resource key="pull-request-resources" name="Pull Request Client Resources">
        <description>
            Client resources (stylesheets, javascript, etc.) used by
            components of the plugin specific to the pull request pages.
        </description>
        <directory location="/css/pull/" />
        <directory location="/js/pull/" />
        <directory location="/soy/pull/" />
        <dependency>com.atlassian.auiplugin:ajs</dependency>
    </client-resource>

    <client-web-panel name="Pull Request Repository Banner"
        key="pull-request-repo-banner" location="bitbucket.web.repository.banner" weight="10">
        <description>
            Web panel component used to handle the display of the pull request banner.
        </description>
        <resource name="view" type="soy" location="${atlassian.plugin.key}:pull-request-resources/com.company.bitbucket.plugin.pull.bannerTest" />
        <client-context-provider>company.pull.getBannerContent</client-context-provider>
        <dependency>${atlassian.plugin.key}:pull-request-resources</dependency>
    </client-web-panel> 

The soy file is pretty bare-bones at the moment:

{namespace com.company.bitbucket.plugin.pull}


/**
 * @param content the text of the banner to display.
 */
{template .bannerTest}

<div>
Hello world, content: $content 
</div>

{/template}

javascript:

(function($) {

    // Set up our namespace
    window.company = window.company || {};
    company.pull = company.pull || {};

    /**
     * Context provider function
     */
    function getBannerContent(context) {
        console.log("getBannerContent called");
        return "Nothing";
    }

    /* Expose the client-context-provider function */
    company.pull.getBannerContent = getBannerContent;
    
}(AJS.$));

As far as I can tell with chrome’s console, the context provider isn’t even being called, and there’s no evidence that anything related to the plugin is happening in the log files when viewing a page in a repository. Is there something I’m missing?

bitbucket.web.repository.banner is a web-panel, not a client-web-panel.

1 Like

Drat. I just noticed that this morning while looking at the available panels again this morning. Sometimes taking a bit of a break helps too. :sweat_smile: Thanks for the response!

I only knew offhand because I added a banner in one of my instances just last night at that exact same location. No worries and good luck!