diff options
Diffstat (limited to 'app/helpers/issuables_description_templates_helper.rb')
-rw-r--r-- | app/helpers/issuables_description_templates_helper.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/helpers/issuables_description_templates_helper.rb b/app/helpers/issuables_description_templates_helper.rb index 6cafde65c5c..a5b9a6eee80 100644 --- a/app/helpers/issuables_description_templates_helper.rb +++ b/app/helpers/issuables_description_templates_helper.rb @@ -32,13 +32,14 @@ module IssuablesDescriptionTemplatesHelper @template_types[project.id][issuable_type] ||= TemplateFinder.all_template_names(project, issuable_type.pluralize) end - def issuable_templates_names(issuable) + # Overriden on EE::IssuablesDescriptionTemplatesHelper to include inherited templates names + def issuable_templates_names(issuable, include_inherited_templates = false) all_templates = issuable_templates(ref_project, issuable.to_ability_name) all_templates.values.flatten.map { |tpl| tpl[:name] if tpl[:project_id] == ref_project.id }.compact.uniq end def selected_template(issuable) - params[:issuable_template] if issuable_templates_names(issuable).any? { |tmpl_name| tmpl_name == params[:issuable_template] } + params[:issuable_template] if issuable_templates_names(issuable, true).any? { |tmpl_name| tmpl_name == params[:issuable_template] } end def template_names_path(parent, issuable) @@ -47,3 +48,5 @@ module IssuablesDescriptionTemplatesHelper project_template_names_path(parent, template_type: issuable.to_ability_name) end end + +IssuablesDescriptionTemplatesHelper.prepend_mod |