Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/template/issue_template.rb')
-rw-r--r--lib/gitlab/template/issue_template.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gitlab/template/issue_template.rb b/lib/gitlab/template/issue_template.rb
index 01b191733d4..3049f43b322 100644
--- a/lib/gitlab/template/issue_template.rb
+++ b/lib/gitlab/template/issue_template.rb
@@ -15,6 +15,16 @@ module Gitlab
def finder(project)
Gitlab::Template::Finders::RepoTemplateFinder.new(project, self.base_dir, self.extension, self.categories)
end
+
+ def template_names(project)
+ return {} unless project&.repository&.exists?
+
+ # here we rely on project.repository caching mechanism. Ideally we would want the template finder to have its
+ # own caching mechanism to avoid the back and forth call jumps between finder and model.
+ #
+ # follow-up issue: https://gitlab.com/gitlab-org/gitlab/-/issues/300279
+ project.repository.issue_template_names_by_category
+ end
end
end
end