summaryrefslogtreecommitdiff
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb34
1 files changed, 22 insertions, 12 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index a2ef2f1207c..2e15b3f22c2 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -72,7 +72,7 @@ module ApplicationHelper
else
'Never'
end
- rescue
+ rescue StandardError
'Never'
end
@@ -382,15 +382,26 @@ module ApplicationHelper
def autocomplete_data_sources(object, noteable_type)
return {} unless object && noteable_type
- {
- members: members_project_autocomplete_sources_path(object, type: noteable_type, type_id: params[:id]),
- issues: issues_project_autocomplete_sources_path(object),
- mergeRequests: merge_requests_project_autocomplete_sources_path(object),
- labels: labels_project_autocomplete_sources_path(object, type: noteable_type, type_id: params[:id]),
- milestones: milestones_project_autocomplete_sources_path(object),
- commands: commands_project_autocomplete_sources_path(object, type: noteable_type, type_id: params[:id]),
- snippets: snippets_project_autocomplete_sources_path(object)
- }
+ if object.is_a?(Group)
+ {
+ members: members_group_autocomplete_sources_path(object, type: noteable_type, type_id: params[:id]),
+ issues: issues_group_autocomplete_sources_path(object),
+ mergeRequests: merge_requests_group_autocomplete_sources_path(object),
+ labels: labels_group_autocomplete_sources_path(object, type: noteable_type, type_id: params[:id]),
+ milestones: milestones_group_autocomplete_sources_path(object),
+ commands: commands_group_autocomplete_sources_path(object, type: noteable_type, type_id: params[:id])
+ }
+ else
+ {
+ members: members_project_autocomplete_sources_path(object, type: noteable_type, type_id: params[:id]),
+ issues: issues_project_autocomplete_sources_path(object),
+ mergeRequests: merge_requests_project_autocomplete_sources_path(object),
+ labels: labels_project_autocomplete_sources_path(object, type: noteable_type, type_id: params[:id]),
+ milestones: milestones_project_autocomplete_sources_path(object),
+ commands: commands_project_autocomplete_sources_path(object, type: noteable_type, type_id: params[:id]),
+ snippets: snippets_project_autocomplete_sources_path(object)
+ }
+ end
end
def asset_to_string(name)
@@ -409,5 +420,4 @@ module ApplicationHelper
end
end
-ApplicationHelper.prepend_if_ee('EE::ApplicationHelper')
-ApplicationHelper.prepend_if_jh('JH::ApplicationHelper')
+ApplicationHelper.prepend_mod