Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2019-01-10 05:36:20 +0300
committerRobert Speicher <rspeicher@gmail.com>2019-01-10 05:36:20 +0300
commit819de8e8084e1b0cc102664abb8bbc836ff99ede (patch)
tree5faaeb11ce0d9210b9b35af7ecc09ada5d5f7a94
parent337866ef9f79e292bb6173fe26a7f45e83d99ab5 (diff)
parent488d7d1f3da605c0a7afcbb9212b10665be89819 (diff)
Merge branch 'sh-fix-real-size-warnings' into 'master'
Fix broken templated "Too many changes to show" text Closes #56138 See merge request gitlab-org/gitlab-ce!24282
-rw-r--r--app/views/projects/diffs/_warning.html.haml2
-rw-r--r--changelogs/unreleased/sh-fix-real-size-warnings.yml5
-rw-r--r--locale/gitlab.pot2
-rw-r--r--spec/features/projects/compare_spec.rb15
4 files changed, 22 insertions, 2 deletions
diff --git a/app/views/projects/diffs/_warning.html.haml b/app/views/projects/diffs/_warning.html.haml
index 2eef599cf84..2cc3d921abc 100644
--- a/app/views/projects/diffs/_warning.html.haml
+++ b/app/views/projects/diffs/_warning.html.haml
@@ -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 }
diff --git a/changelogs/unreleased/sh-fix-real-size-warnings.yml b/changelogs/unreleased/sh-fix-real-size-warnings.yml
new file mode 100644
index 00000000000..5062ffd677c
--- /dev/null
+++ b/changelogs/unreleased/sh-fix-real-size-warnings.yml
@@ -0,0 +1,5 @@
+---
+title: Fix broken templated "Too many changes to show" text
+merge_request: 24282
+author:
+type: fixed
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index dd600c02496..aad8f969122 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -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"
diff --git a/spec/features/projects/compare_spec.rb b/spec/features/projects/compare_spec.rb
index 69600884909..5f7cf68987e 100644
--- a/spec/features/projects/compare_spec.rb
+++ b/spec/features/projects/compare_spec.rb
@@ -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