Disable Code Suggestion for ipynb diffs
This commit is contained in:
parent
20b3faecff
commit
95519c8de5
|
@ -50,6 +50,7 @@ def inapplicable_reason(cached: true)
|
|||
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 _("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
|
||||
|
||||
|
|
|
@ -35190,6 +35190,9 @@ msgstr ""
|
|||
msgid "This field is required."
|
||||
msgstr ""
|
||||
|
||||
msgid "This file was modified for readability, and can't accept suggestions. Edit it directly."
|
||||
msgstr ""
|
||||
|
||||
msgid "This form is disabled in preview"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -154,6 +154,14 @@
|
|||
it { is_expected.to eq("This suggestion already matches its content.") }
|
||||
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
|
||||
it { is_expected.to be_nil }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue