From c27fa5c6ebd18b20d52dca62b1c4adcf22e31008 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 25 Feb 2022 17:47:24 +0000 Subject: Add latest changes from gitlab-org/security/gitlab@14-6-stable-ee --- app/models/note.rb | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/note.rb b/app/models/note.rb index a143c21c0f9..9b95476cb15 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -46,7 +46,7 @@ class Note < ApplicationRecord attr_accessor :user_visible_reference_count # Attribute used to store the attributes that have been changed by quick actions. - attr_accessor :commands_changes + attr_writer :commands_changes # Attribute used to determine whether keep_around_commits will be skipped for diff notes. attr_accessor :skip_keep_around_commits @@ -612,6 +612,41 @@ class Note < ApplicationRecord change_position.line_range["end"] || change_position.line_range["start"] end + def commands_changes + @commands_changes&.slice( + :due_date, + :label_ids, + :remove_label_ids, + :add_label_ids, + :canonical_issue_id, + :clone_with_notes, + :confidential, + :create_merge_request, + :add_contacts, + :remove_contacts, + :assignee_ids, + :milestone_id, + :time_estimate, + :spend_time, + :discussion_locked, + :merge, + :rebase, + :wip_event, + :target_branch, + :reviewer_ids, + :health_status, + :promote_to_epic, + :weight, + :emoji_award, + :todo_event, + :subscription_event, + :state_event, + :title, + :tag_message, + :tag_name + ) + end + private def system_note_viewable_by?(user) -- cgit v1.2.3