Skip to content
Snippets Groups Projects
Commit 29e606de authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Add ExternalIssue base model to make issue referencing more robust for external issue trackers.

parent 2dfd2198
No related branches found
No related tags found
1 merge request!8686add "Uplaod" and "Replace" functionality
Loading
Loading
@@ -67,9 +67,10 @@ module Mentionable
return [] if text.blank?
ext = Gitlab::ReferenceExtractor.new
ext.analyze(text, p)
(ext.issues_for +
ext.merge_requests_for +
ext.commits_for).uniq - [local_reference]
(ext.issues_for(p) +
ext.merge_requests_for(p) +
ext.commits_for(p)).uniq - [local_reference]
end
 
# Create a cross-reference Note for each GFM reference to another Mentionable found in +mentionable_text+.
Loading
Loading
class ExternalIssue
def initialize(issue_identifier, project)
@issue_identifier, @project = issue_identifier, project
end
def to_s
@issue_identifier.to_s
end
def id
@issue_identifier.to_s
end
def iid
@issue_identifier.to_s
end
def ==(other)
other.is_a?(self.class) && (to_s == other.to_s)
end
def project
@project
end
end
Loading
Loading
@@ -71,7 +71,7 @@ module Gitlab
if entry_project.nil?
false
else
project.nil? || project.id == entry_project.id
project.nil? || entry_project.default_issues_tracker?
end
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment