修复:journal来源解析
This commit is contained in:
parent
256f29b7f4
commit
12c020f315
|
@ -88,7 +88,7 @@ class Journal < ApplicationRecord
|
|||
if self.operate_by.starts_with?("Project#")
|
||||
project_id, commit_sha = self.operate_by.scan(/#(\d+).*?@(\w+)/)[0]
|
||||
project =Project.find_by_id(project_id)
|
||||
return "通过<a =\"#{Rails.application.config_for(:configuration)['platform_url']}/#{project&.owner&.login}/#{project&.identifier}/commits/#{commit_sha}\">#{project&.owner&.real_name}/#{project&.name}</a>"
|
||||
return "通过<a =\"#{Rails.application.config_for(:configuration)['platform_url']}/#{project&.owner&.login}/#{project&.identifier}/commits/#{commit_sha}\">#{project&.owner&.real_name}/#{project&.name} 提交 #{commit_sha[0...10]}</a>"
|
||||
end
|
||||
rescue
|
||||
return ''
|
||||
|
@ -165,7 +165,7 @@ class Journal < ApplicationRecord
|
|||
end
|
||||
return content
|
||||
else
|
||||
return "创建了需求"
|
||||
content += "创建了需求"
|
||||
end
|
||||
when 'task'
|
||||
case detail.prop_key
|
||||
|
@ -225,7 +225,7 @@ class Journal < ApplicationRecord
|
|||
end
|
||||
return content
|
||||
else
|
||||
return "创建了任务"
|
||||
content += "创建了任务"
|
||||
end
|
||||
when 'bug'
|
||||
case detail.prop_key
|
||||
|
@ -285,14 +285,14 @@ class Journal < ApplicationRecord
|
|||
end
|
||||
return content
|
||||
else
|
||||
return "创建了缺陷"
|
||||
content += "创建了缺陷"
|
||||
end
|
||||
when 'attr'
|
||||
case detail.prop_key
|
||||
when 'subject'
|
||||
return "修改了<b>标题</b>"
|
||||
content += "修改了<b>标题</b>"
|
||||
when 'description'
|
||||
return "修改了<b>正文</b>"
|
||||
content += "修改了<b>正文</b>"
|
||||
when 'priority_id'
|
||||
old_value = IssuePriority.find_by_id(detail.old_value)&.name
|
||||
new_value = IssuePriority.find_by_id(detail.value)&.name
|
||||
|
@ -502,13 +502,15 @@ class Journal < ApplicationRecord
|
|||
issue = self.issue
|
||||
case issue.pm_issue_type
|
||||
when 1
|
||||
return "创建了需求"
|
||||
content += "创建了需求"
|
||||
when 2
|
||||
return "创建了任务"
|
||||
content += "创建了任务"
|
||||
when 3
|
||||
return "创建了缺陷"
|
||||
content += "创建了缺陷"
|
||||
end
|
||||
end
|
||||
|
||||
return content
|
||||
end
|
||||
|
||||
def operate_content
|
||||
|
@ -516,7 +518,7 @@ class Journal < ApplicationRecord
|
|||
detail = self.journal_details.take
|
||||
case detail.property
|
||||
when 'issue'
|
||||
return "创建了<b>疑修</b>"
|
||||
content += "创建了<b>疑修</b>"
|
||||
when 'attachment'
|
||||
old_value = Attachment.where("BINARY id in (?) or uuid in (?)", detail.old_value.to_s.split(","), detail.old_value.to_s.split(",")).pluck(:filename).join("、")
|
||||
new_value = Attachment.where("BINARY id in (?) or uuid in (?)", detail.value.to_s.split(","), detail.value.to_s.split(",")).pluck(:filename).join("、")
|
||||
|
@ -545,12 +547,12 @@ class Journal < ApplicationRecord
|
|||
content += "将负责人由<b>#{old_value}</b>更改为<b>#{new_value}</b>"
|
||||
end
|
||||
when 'attr'
|
||||
content = "将"
|
||||
content += "将"
|
||||
case detail.prop_key
|
||||
when 'subject'
|
||||
return "修改了<b>标题</b>"
|
||||
content += "修改了<b>标题</b>"
|
||||
when 'description'
|
||||
return "修改了<b>描述</b>"
|
||||
content += "修改了<b>描述</b>"
|
||||
when 'status_id'
|
||||
old_value = IssueStatus.find_by_id(detail.old_value)&.name
|
||||
new_value = IssueStatus.find_by_id(detail.value)&.name
|
||||
|
|
Loading…
Reference in New Issue