Fix broken templated "Too many changes to show" text

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23230
broke the external string in 11.6. This fixes that and
adds a spec.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56138
This commit is contained in:
Stan Hu 2019-01-09 15:11:16 -08:00
parent 4a6c7661ed
commit 488d7d1f3d
4 changed files with 22 additions and 2 deletions

View File

@ -9,4 +9,4 @@
= link_to _("Plain diff"), merge_request_path(@merge_request, format: :diff), class: "btn btn-sm"
= link_to _("Email patch"), merge_request_path(@merge_request, format: :patch), class: "btn btn-sm"
%p
= _("To preserve performance only <strong>%{display_size} of ${real_size}</strong> files are displayed.").html_safe % { display_size: diff_files.size, real_size: diff_files.real_size }
= _("To preserve performance only <strong>%{display_size} of %{real_size}</strong> files are displayed.").html_safe % { display_size: diff_files.size, real_size: diff_files.real_size }

View File

@ -0,0 +1,5 @@
---
title: Fix broken templated "Too many changes to show" text
merge_request: 24282
author:
type: fixed

View File

@ -7200,7 +7200,7 @@ msgstr ""
msgid "To move or copy an entire GitLab project from another GitLab installation to this one, navigate to the original project's settings page, generate an export file, and upload it here."
msgstr ""
msgid "To preserve performance only <strong>%{display_size} of ${real_size}</strong> files are displayed."
msgid "To preserve performance only <strong>%{display_size} of %{real_size}</strong> files are displayed."
msgstr ""
msgid "To start serving your jobs you can add Runners to your group"

View File

@ -87,6 +87,21 @@ describe "Compare", :js do
expect(find(".js-compare-from-dropdown .dropdown-content")).to have_selector("li", count: 3)
end
context 'when commit has overflow', :js do
it 'displays warning' do
visit project_compare_index_path(project, from: "feature", to: "master")
allow(Commit).to receive(:max_diff_options).and_return(max_files: 3)
allow_any_instance_of(DiffHelper).to receive(:render_overflow_warning?).and_return(true)
click_button('Compare')
page.within('.alert') do
expect(page).to have_text("Too many changes to show. To preserve performance only 3 of 3+ files are displayed.")
end
end
end
end
describe "tags" do