0

I am trying to write my first plugin for Bitbucket. I followed the tutorial to add a custom column to the branches list. It works great. After, I wanted to add a custom column to the repositories list with e.g. description or number of branches. However, when I check for web sections with:

http://localhost:7990/bitbucket/projects/PROJECT_1?web.sections

I do not see any on the repositories list page. Is it possible to add there some column?

Adam

Adam
  • 884
  • 7
  • 29
  • can you share the code that will allow to reproduce the issue? – Yuri G. Apr 02 '18 at 19:20
  • I do not understand what you mean - the question is what kind of web section (location) should I use to add custom column to the repositories list of a project. Maybe there is a different way to solve it but I followed custom column for branches list and I thought it should be the same for repositories list. – Adam Apr 02 '18 at 20:15

1 Answers1

0

it isn't supported by the Atlassian's layout The project overview template contains a code

{if not $isEmptyProject}
  {call bitbucket.internal.feature.repository.repositoryTable}
     {param id: 'repositories-table' /}
     {param repositoryPage: $repositoryPage /}
     {param showPublicStatus: true /}
  {/call}
{/if}

and the table row definition in the bitbucket.internal.feature.repository.repositoryTable template is

{template .repositoryRow private="true"}
<tr>
    <td>
        {if $showProject}
            <span class="project-name">
                {call bitbucket.internal.feature.project.avatar}
                    {param size: 'small' /}
                    {param project: $repository.project /}
                {/call}
                <a href="{nav_project($repository.project.key)}" title="{$repository.project.name}" data-project-id="{$repository.project.id}">{$repository.project.name}</a>
            </span>
        {/if}
        <span class="repository-name">
            {if not $showProject}
                {call aui.icons.icon}
                    {param size: 'small' /}
                    {param useIconFont: true /}
                    {param iconFontSet: 'devtools' /}
                    {param icon: $repository.origin ? 'repository-forked' : 'repository' /}
                    {param accessibilityText: $repository.origin ? getText('bitbucket.web.repository.repository.forked') : getText('bitbucket.web.repository.repository')/}
                    {{param extraAttributes: $repository.origin ? ['title': getText('bitbucket.web.repository.is.a.fork.of', $repository.origin.project.name, $repository.origin.name)] : null/}}
                {/call}
            {/if}
            <a href="{nav_repo_browse($repository.project.key, $repository.slug)}" data-repository-id="{$repository.id}">{$repository.name}</a>
        </span>
        {if $showPublicStatus}
            {call bitbucket.internal.feature.repository.publicLozenge}
                {param repository: $repository /}
            {/call}
        {/if}
    </td>
</tr>

The only way is to replace somehow the .repositoryRow template, but I don't see a proper way to do it without hacking

Yuri G.
  • 4,323
  • 1
  • 17
  • 32
  • So what is the preferred way to customize the repositories view? Or if I want to add an additional column then I have to create a new view? – Adam Apr 03 '18 at 05:37
  • looks like you need to create a new view – Yuri G. Apr 03 '18 at 06:05
  • Is it possible to override whole Repositories View? Then I can create my own content. Otherwise, I will have to duplicate it. – Adam Apr 03 '18 at 06:14
  • I didn't try, but AFAIK it is impossible, since you can't use the same template id twice – Yuri G. Apr 03 '18 at 06:31