show a message in the dropdown menu if a repo has no tags

a68e171c7aceb75fc617710d2fabc65ffdd571a4

Tucker McKnight <tmcknight@instructure.com> | Mon Aug 10 2026

show a message in the dropdown menu if a repo has no tags
js_templates/common/branchesListItems.ts:47
Before
46
47
48

49
50
51





52
53
    .map(branch => htmlForRef(branch, 'branch', currentRef, currentRefType, defaultBranch))
    .join('')

⁣
  const tagItemsHtml = refs.tags.sort((a, b) => sortFunction(a, b, sortBy))
    .map(tag => htmlForRef(tag, 'tag', currentRef, currentRefType, defaultBranch))
    .join('')
⁣
⁣
⁣
⁣
⁣
  
  return `<div class="branch">${branchItemsHtml}</div><div class="tag">${tagItemsHtml}</div>`
}
After
46
47
48
49
50
51
52
53
54
55
56
57
58
59
    .map(branch => htmlForRef(branch, 'branch', currentRef, currentRefType, defaultBranch))
    .join('')

  const tagItemsHtml = refs.tags.length > 0
                       ? refs.tags.sort((a, b) => sortFunction(a, b, sortBy))
                           .map(tag => htmlForRef(tag, 'tag', currentRef, currentRefType, defaultBranch))
                           .join('')
                       : `<div class='dropdown-item my-1'>
                            <span class="branch-dropdown-branch-name me-1">
                              This repository has no tags.
                            </span>
                          </div>`
  
  return `<div class="branch">${branchItemsHtml}</div><div class="tag">${tagItemsHtml}</div>`
}