Move update comment to attachment field

so that it is not hidden when issue description is long.
This commit is contained in:
Iku Iwasa
2020-11-23 10:02:01 +09:00
parent 24095bf9db
commit e5d5a94119
2 changed files with 5 additions and 10 deletions

View File

@@ -159,16 +159,6 @@ class Messenger
def attachment_text_from_journal(journal)
obj = journal.details.detect { |j| j.prop_key == 'description' && j.property == 'attr' }
text = obj.value if obj.present?
if journal.notes.present?
if text.present?
text << "\n\n*#{l :label_comment}*\n"
text << journal.notes
else
text = journal.notes
end
end
text.present? ? markup_format(text) : nil
end

View File

@@ -88,6 +88,11 @@ module RedmineMessenger
end
fields = current_journal.details.map { |d| Messenger.detail_to_field(d, project) }
if current_journal.notes.present?
fields << { title: I18n.t(:label_comment),
value: Messenger.markup_format(current_journal.notes),
short: false }
end
fields << { title: I18n.t(:field_is_private), short: true } if current_journal.private_notes?
fields.compact!
attachment[:fields] = fields if fields.any?