Commit f09acbab authored by Samantha Ming's avatar Samantha Ming Committed by Paul Slaughter

Add matching branch info to branch column

- Remove last commit column
- Move matching branch and detail to branch column
- Make badge inline
parent c35745fd
...@@ -16,9 +16,7 @@ ...@@ -16,9 +16,7 @@
%thead %thead
%tr %tr
%th %th
= s_("ProtectedBranch|Protected branch (%{protected_branches_count})") % { protected_branches_count: @protected_branches_count } = s_("ProtectedBranch|Branch")
%th
= s_("ProtectedBranch|Last commit")
%th %th
= s_("ProtectedBranch|Allowed to merge") = s_("ProtectedBranch|Allowed to merge")
%th %th
......
...@@ -5,17 +5,14 @@ ...@@ -5,17 +5,14 @@
%span.ref-name= protected_branch.name %span.ref-name= protected_branch.name
- if @project.root_ref?(protected_branch.name) - if @project.root_ref?(protected_branch.name)
%span.badge.badge-info.prepend-left-5 default %span.badge.badge-info.d-inline default
%td
%div
- if protected_branch.wildcard? - if protected_branch.wildcard?
- matching_branches = protected_branch.matching(repository.branches) - 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) = link_to pluralize(matching_branches.count, "matching branch"), namespace_project_protected_branch_path(@project.namespace, @project, protected_branch)
- else - elsif !protected_branch.commit
- if commit = protected_branch.commit %span.text-muted Branch was deleted.
= 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)
= yield = yield
......
---
title: Add matching branch info to branch column
merge_request: 18352
author:
type: added
...@@ -13088,10 +13088,10 @@ msgstr "" ...@@ -13088,10 +13088,10 @@ msgstr ""
msgid "ProtectedBranch|Allowed to push:" msgid "ProtectedBranch|Allowed to push:"
msgstr "" msgstr ""
msgid "ProtectedBranch|Code owner approval" msgid "ProtectedBranch|Branch"
msgstr "" msgstr ""
msgid "ProtectedBranch|Last commit" msgid "ProtectedBranch|Code owner approval"
msgstr "" msgstr ""
msgid "ProtectedBranch|Protect" msgid "ProtectedBranch|Protect"
......
...@@ -92,7 +92,10 @@ describe 'Protected Branches', :js do ...@@ -92,7 +92,10 @@ describe 'Protected Branches', :js do
set_protected_branch_name('some-branch') set_protected_branch_name('some-branch')
click_on "Protect" 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 end
it "displays an error message if the named branch does not exist" do it "displays an error message if the named branch does not exist" do
...@@ -101,7 +104,7 @@ describe 'Protected Branches', :js do ...@@ -101,7 +104,7 @@ describe 'Protected Branches', :js do
set_protected_branch_name('some-branch') set_protected_branch_name('some-branch')
click_on "Protect" 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
end end
...@@ -127,7 +130,6 @@ describe 'Protected Branches', :js do ...@@ -127,7 +130,6 @@ describe 'Protected Branches', :js do
click_on "Protect" click_on "Protect"
within(".protected-branches-list") do within(".protected-branches-list") do
expect(page).to have_content("Protected branch (2)")
expect(page).to have_content("2 matching branches") expect(page).to have_content("2 matching branches")
end end
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