Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
95519c8d
Commit
95519c8d
authored
Nov 10, 2021
by
Eduardo Bonet
Committed by
Vasilii Iakliushin
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable Code Suggestion for ipynb diffs
parent
20b3faec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
app/models/suggestion.rb
app/models/suggestion.rb
+1
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/models/suggestion_spec.rb
spec/models/suggestion_spec.rb
+8
-0
No files found.
app/models/suggestion.rb
View file @
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
...
...
locale/gitlab.pot
View file @
95519c8d
...
@@ -35190,6 +35190,9 @@ msgstr ""
...
@@ -35190,6 +35190,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 ""
...
...
spec/models/suggestion_spec.rb
View file @
95519c8d
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment