diff options
Diffstat (limited to 'app/graphql/mutations/incident_management/timeline_event/promote_from_note.rb')
-rw-r--r-- | app/graphql/mutations/incident_management/timeline_event/promote_from_note.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/graphql/mutations/incident_management/timeline_event/promote_from_note.rb b/app/graphql/mutations/incident_management/timeline_event/promote_from_note.rb index 31ae29d896b..bb1da9278ff 100644 --- a/app/graphql/mutations/incident_management/timeline_event/promote_from_note.rb +++ b/app/graphql/mutations/incident_management/timeline_event/promote_from_note.rb @@ -6,6 +6,8 @@ module Mutations class PromoteFromNote < Base graphql_name 'TimelineEventPromoteFromNote' + include NotesHelper + argument :note_id, Types::GlobalIDType[::Note], required: true, description: 'Note ID from which the timeline event promoted.' @@ -20,7 +22,7 @@ module Mutations incident, current_user, promoted_from_note: note, - note: note.note, + note: build_note_string(note), occurred_at: note.created_at, editable: true ).execute @@ -38,6 +40,11 @@ module Mutations super end + def build_note_string(note) + commented = _('commented') + "@#{note.author.username} [#{commented}](#{noteable_note_url(note)}): '#{note.note}'" + end + def raise_noteable_not_incident! raise_resource_not_available_error! 'Note does not belong to an incident' end |