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 'app/finders/template_finder.rb')
-rw-r--r--app/finders/template_finder.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/finders/template_finder.rb b/app/finders/template_finder.rb
index dac7c526474..36f8d144908 100644
--- a/app/finders/template_finder.rb
+++ b/app/finders/template_finder.rb
@@ -21,6 +21,18 @@ class TemplateFinder
new(type, project, params)
end
end
+
+ def all_template_names(project, type)
+ return {} if !VENDORED_TEMPLATES.key?(type.to_s) && type.to_s != 'licenses'
+
+ build(type, project).template_names
+ end
+
+ # This is issues and merge requests description templates only.
+ # This will be removed once we introduce group level inherited templates
+ def all_template_names_array(project, type)
+ all_template_names(project, type).values.flatten.uniq
+ end
end
attr_reader :type, :project, :params
@@ -43,6 +55,10 @@ class TemplateFinder
vendored_templates.all(project)
end
end
+
+ def template_names
+ vendored_templates.template_names(project)
+ end
end
TemplateFinder.prepend_if_ee('::EE::TemplateFinder')