diff options
Diffstat (limited to 'app/models/note.rb')
-rw-r--r-- | app/models/note.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index daac489757b..e444111119b 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -22,6 +22,7 @@ class Note < ApplicationRecord include ThrottledTouch include FromUnion include Sortable + include EachBatch ISSUE_TASK_SYSTEM_NOTE_PATTERN = /\A.*marked\sthe\stask.+as\s(completed|incomplete).*\z/.freeze @@ -693,7 +694,7 @@ class Note < ApplicationRecord # Method necesary while we transition into the new format for task system notes # TODO: https://gitlab.com/gitlab-org/gitlab/-/issues/369923 def note - return super unless system? && for_issue? && super.match?(ISSUE_TASK_SYSTEM_NOTE_PATTERN) + return super unless system? && for_issue? && super&.match?(ISSUE_TASK_SYSTEM_NOTE_PATTERN) super.sub!('task', 'checklist item') end @@ -701,11 +702,15 @@ class Note < ApplicationRecord # Method necesary while we transition into the new format for task system notes # TODO: https://gitlab.com/gitlab-org/gitlab/-/issues/369923 def note_html - return super unless system? && for_issue? && super.match?(ISSUE_TASK_SYSTEM_NOTE_PATTERN) + return super unless system? && for_issue? && super&.match?(ISSUE_TASK_SYSTEM_NOTE_PATTERN) super.sub!('task', 'checklist item') end + def issuable_ability_name + confidential? ? :read_internal_note : :read_note + end + private def system_note_viewable_by?(user) |