Module: Gitlab::SlashCommands::Presenters::NoteBase

Included in:
IssueComment
Defined in:
lib/gitlab/slash_commands/presenters/note_base.rb

Constant Summary collapse

GREEN =
'#38ae67'

Instance Method Summary collapse

Instance Method Details

#authorObject


21
22
23
# File 'lib/gitlab/slash_commands/presenters/note_base.rb', line 21

def author
  resource.author
end

#color(_) ⇒ Object


9
10
11
# File 'lib/gitlab/slash_commands/presenters/note_base.rb', line 9

def color(_)
  GREEN
end

#fieldsObject


25
26
27
28
29
30
31
32
# File 'lib/gitlab/slash_commands/presenters/note_base.rb', line 25

def fields
  [
    {
      title: 'Comment',
      value: resource.note
    }
  ]
end

#issueObject


13
14
15
# File 'lib/gitlab/slash_commands/presenters/note_base.rb', line 13

def issue
  resource.noteable
end

#projectObject


17
18
19
# File 'lib/gitlab/slash_commands/presenters/note_base.rb', line 17

def project
  issue.project
end