新增:更改来源解析url
This commit is contained in:
		
							parent
							
								
									151e028d34
								
							
						
					
					
						commit
						256f29b7f4
					
				| 
						 | 
					@ -83,6 +83,17 @@ class Journal < ApplicationRecord
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def operate_by_content
 | 
				
			||||||
 | 
					    return '' if self.operate_by == "Issue"
 | 
				
			||||||
 | 
					    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>"
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  rescue 
 | 
				
			||||||
 | 
					    return ''
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def pm_operate_category
 | 
					  def pm_operate_category
 | 
				
			||||||
    detail = self.journal_details.take 
 | 
					    detail = self.journal_details.take 
 | 
				
			||||||
    if %w(requirement task bug).include?(detail.property) && detail.prop_key.to_s == "1"
 | 
					    if %w(requirement task bug).include?(detail.property) && detail.prop_key.to_s == "1"
 | 
				
			||||||
| 
						 | 
					@ -93,7 +104,7 @@ class Journal < ApplicationRecord
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def pm_operate_content
 | 
					  def pm_operate_content
 | 
				
			||||||
    content = ""
 | 
					    content = "#{operate_by_content}"
 | 
				
			||||||
    detail = self.journal_details.take 
 | 
					    detail = self.journal_details.take 
 | 
				
			||||||
    case detail.property
 | 
					    case detail.property
 | 
				
			||||||
    when 'requirement'
 | 
					    when 'requirement'
 | 
				
			||||||
| 
						 | 
					@ -501,7 +512,7 @@ class Journal < ApplicationRecord
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def operate_content 
 | 
					  def operate_content 
 | 
				
			||||||
    content = ""
 | 
					    content = "#{operate_by_content}"
 | 
				
			||||||
    detail = self.journal_details.take
 | 
					    detail = self.journal_details.take
 | 
				
			||||||
    case detail.property
 | 
					    case detail.property
 | 
				
			||||||
    when 'issue'
 | 
					    when 'issue'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue