Commit cdf81f88 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch '32930-matching-branch-code-owner-approval' into 'master'

Add matching branch info to branch column

Closes #32930

See merge request gitlab-org/gitlab!18352
parents c35745fd f09acbab
......@@ -16,9 +16,7 @@
%thead
%tr
%th
= s_("ProtectedBranch|Protected branch (%{protected_branches_count})") % { protected_branches_count: @protected_branches_count }
%th
= s_("ProtectedBranch|Last commit")
= s_("ProtectedBranch|Branch")
%th
= s_("ProtectedBranch|Allowed to merge")
%th
......
......@@ -5,17 +5,14 @@
%span.ref-name= protected_branch.name
- if @project.root_ref?(protected_branch.name)
%span.badge.badge-info.prepend-left-5 default
%td
%span.badge.badge-info.d-inline default
%div
- if protected_branch.wildcard?
- matching_branches = protected_branch.matching(repository.branches)
= link_to pluralize(matching_branches.count, "matching branch"), namespace_project_protected_branch_path(@project.namespace, @project, protected_branch)
- else
- if commit = protected_branch.commit
= link_to(commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit-sha')
= time_ago_with_tooltip(commit.committed_date)
- else
(branch was deleted from repository)
- elsif !protected_branch.commit
%span.text-muted Branch was deleted.
= yield
......
---
title: Add matching branch info to branch column
merge_request: 18352
author:
type: added
......@@ -13088,10 +13088,10 @@ msgstr ""
msgid "ProtectedBranch|Allowed to push:"
msgstr ""
msgid "ProtectedBranch|Code owner approval"
msgid "ProtectedBranch|Branch"
msgstr ""
msgid "ProtectedBranch|Last commit"
msgid "ProtectedBranch|Code owner approval"
msgstr ""
msgid "ProtectedBranch|Protect"
......
......@@ -92,7 +92,10 @@ describe 'Protected Branches', :js do
set_protected_branch_name('some-branch')
click_on "Protect"
within(".protected-branches-list") { expect(page).to have_content(commit.id[0..7]) }
within(".protected-branches-list") do
expect(page).not_to have_content("matching")
expect(page).not_to have_content("was deleted")
end
end
it "displays an error message if the named branch does not exist" do
......@@ -101,7 +104,7 @@ describe 'Protected Branches', :js do
set_protected_branch_name('some-branch')
click_on "Protect"
within(".protected-branches-list") { expect(page).to have_content('branch was deleted') }
within(".protected-branches-list") { expect(page).to have_content('Branch was deleted') }
end
end
......@@ -127,7 +130,6 @@ describe 'Protected Branches', :js do
click_on "Protect"
within(".protected-branches-list") do
expect(page).to have_content("Protected branch (2)")
expect(page).to have_content("2 matching branches")
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment