Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
GitLab Community Edition
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
Mike Wyatt
GitLab Community Edition
Commits
e3ee46a1
Commit
e3ee46a1
authored
9 years ago
by
Valery Sizov
Browse files
Options
Downloads
Patches
Plain Diff
Don't allow to edit award emoji comments
parent
bdc62d70
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG
+1
-0
1 addition, 0 deletions
CHANGELOG
app/models/note.rb
+1
-1
1 addition, 1 deletion
app/models/note.rb
spec/models/note_spec.rb
+17
-0
17 additions, 0 deletions
spec/models/note_spec.rb
with
19 additions
and
1 deletion
CHANGELOG
+
1
−
0
View file @
e3ee46a1
...
...
@@ -27,6 +27,7 @@ v 8.3.0 (unreleased)
- Improve wording on project visibility levels (Zeger-Jan van de Weg)
- Automatically select default clone protocol based on user preferences (Eirik Lygre)
- Make Network page as sub tab of Commits
- Prevent possible XSS attack with award-emoji
v 8.2.3
- Fix application settings cache not expiring after changes (Stan Hu)
...
...
This diff is collapsed.
Click to expand it.
app/models/note.rb
+
1
−
1
View file @
e3ee46a1
...
...
@@ -350,7 +350,7 @@ class Note < ActiveRecord::Base
end
def
editable?
!
system
?
!
system
?
&&
!
is_award
end
# Checks if note is an award added as a comment
...
...
This diff is collapsed.
Click to expand it.
spec/models/note_spec.rb
+
17
−
0
View file @
e3ee46a1
...
...
@@ -142,4 +142,21 @@ describe Note, models: true do
expect
(
Note
.
grouped_awards
.
first
.
last
).
to
match_array
(
Note
.
all
)
end
end
describe
"editable?"
do
it
"returns true"
do
note
=
build
(
:note
)
expect
(
note
.
editable?
).
to
be_truthy
end
it
"returns false"
do
note
=
build
(
:note
,
system:
true
)
expect
(
note
.
editable?
).
to
be_falsy
end
it
"returns false"
do
note
=
build
(
:note
,
is_award:
true
,
note:
"smiley"
)
expect
(
note
.
editable?
).
to
be_falsy
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment