Namespace
          {namespace bitbucket.component.branchSelector}
        
bitbucket.component.branchSelector.field

Renders a full AUI form field with label, hidden input, and BranchSelector. The hidden input is automatically populated when users interact with the paired BranchSelector.

Non repository-hook users of this field will need to add a plugin dependency to com.atlassian.stash.stash-web-api:branch-selector-field to ensure required components are loaded.

  • id The id of the input. Will default to $name. At least one of $id and $name is required.
  • name (Optional) The name of the input. Will default to $id. At least one of $id and $name is required.
  • labelText The text to use as the label for this field
  • isRequired (Optional) Whether this field is required
  • descriptionText (Optional) Description string for the field
  • errorTexts (Optional) A list of strings for any errors that need to be displayed.
  • showTags (Optional) Whether to allow the user to select tags, as well as branches. False by default
  • initialValue (Optional) a branch name (full ref - including refs/heads/ prefix) that is initially selected (or null)
          {template .field}
    {call widget.aui.form.field}
        {param id: $id ? $id : $name /}
        {param labelContent}{$labelText}{/param}
        {param required : $isRequired /}
        {param input}
            {call .input}
                {param id: $id /}
                {param name: $name /}
                {param initialValue: $initialValue /}
                {param showTags: $showTags /}
            {/call}
        {/param}
        {param errors: $errorTexts /}
        {param description: $descriptionText /}
    {/call}
{/template}
        
bitbucket.component.branchSelector.input

Renders a hidden input and BranchSelector. The input will be automatically populated when users interact with the paired BranchSelector.

  • id The id of the input. Will default to $name. At least one of $id and $name is required.
  • name (Optional) The name of the input. Will default to $id. At least one of $id and $name is required.
  • initialValue (Optional) a branch name (full ref - including refs/heads/ prefix) that is initially selected (or null)
  • showTags (Optional) Whether to allow the user to select tags, as well as branches. False by default
          {template .input}
    <div class="branch-selector-input">
        {call stash.feature.repository.revisionReferenceSelectorTriggerWithField}
            {param id: ($id ? $id : $name) + '-trigger' /}
            {param fieldId: $id ? $id : $name /}
            {param fieldName: $name ? $name : $id /}
            {param extraClasses: 'branch-selector-field' /}
        {/call}
        <a class="remove-link{if not $initialValue} hidden{/if}" href="#">
            {getText('stash.web.branch.selector.remove.branch')}
        </a>
        <script>eve('stash.widget.branchselector.inputAdded', null, '{$id ? $id : $name|escapeJs}', {lb}
            "showTags" : {not not $showTags}{if $initialValue},
            "revisionId": '{$initialValue}'{/if}
        {rb});</script>
    </div>
{/template}