Fix another problem with notes

This commit is contained in:
Alexander Meindl
2019-12-31 13:43:06 +01:00
parent 3a9101eda9
commit 2563b8007c
2 changed files with 11 additions and 3 deletions

View File

@@ -37,7 +37,6 @@ class Messenger
username = Messenger.textfield_for_project(options[:project], :messenger_username)
params[:username] = username if username.present?
params[:attachments] = [options[:attachment]] if options[:attachment]&.any?
icon = Messenger.textfield_for_project(options[:project], :messenger_icon)
if icon.present?
if icon.start_with? ':'

View File

@@ -63,8 +63,17 @@ module RedmineMessenger
set_language_if_valid Setting.default_language
attachment = {}
if saved_change_to_description? && Messenger.setting_for_project(project, :updated_include_description)
attachment[:text] = Messenger.markup_format(description)
if Messenger.setting_for_project(project, :updated_include_description)
attachment[:text] = Messenger.markup_format(description) if saved_change_to_description?
if current_journal.notes.present?
if attachment[:text].present?
attachment[:text] << content_tag('p', l(:label_comment))
attachment[:text] << Messenger.markup_format(current_journal.notes)
else
attachment[:text] = Messenger.markup_format(current_journal.notes)
end
end
end
fields = current_journal.details.map { |d| Messenger.detail_to_field d }