Commit 0ed79110 authored by Vasilii Iakliushin's avatar Vasilii Iakliushin

Merge branch '345075-bug-code-suggestion-for-ipynb-mr-breaks-the-file' into 'master'

Disable Code Suggestion for ipynb diffs

See merge request gitlab-org/gitlab!73948
parents 04fe0a4d 95519c8d
...@@ -50,6 +50,7 @@ class Suggestion < ApplicationRecord ...@@ -50,6 +50,7 @@ class Suggestion < ApplicationRecord
next _("Can't apply as the source branch was deleted.") unless noteable.source_branch_exists? next _("Can't apply as the source branch was deleted.") unless noteable.source_branch_exists?
next outdated_reason if outdated?(cached: cached) || !note.active? next outdated_reason if outdated?(cached: cached) || !note.active?
next _("This suggestion already matches its content.") unless different_content? next _("This suggestion already matches its content.") unless different_content?
next _("This file was modified for readability, and can't accept suggestions. Edit it directly.") if file_path.end_with? "ipynb"
end end
end end
......
...@@ -35196,6 +35196,9 @@ msgstr "" ...@@ -35196,6 +35196,9 @@ msgstr ""
msgid "This field is required." msgid "This field is required."
msgstr "" msgstr ""
msgid "This file was modified for readability, and can't accept suggestions. Edit it directly."
msgstr ""
msgid "This form is disabled in preview" msgid "This form is disabled in preview"
msgstr "" msgstr ""
......
...@@ -154,6 +154,14 @@ RSpec.describe Suggestion do ...@@ -154,6 +154,14 @@ RSpec.describe Suggestion do
it { is_expected.to eq("This suggestion already matches its content.") } it { is_expected.to eq("This suggestion already matches its content.") }
end end
context 'when file is .ipynb' do
before do
allow(suggestion).to receive(:file_path).and_return("example.ipynb")
end
it { is_expected.to eq(_("This file was modified for readability, and can't accept suggestions. Edit it directly.")) }
end
context 'when applicable' do context 'when applicable' do
it { is_expected.to be_nil } it { is_expected.to be_nil }
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