summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard_controller.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2018-02-19 14:30:57 -0600
committerRobert Speicher <rspeicher@gmail.com>2018-02-19 14:30:57 -0600
commitd023a99562fa34c926bd1ab17175773aac05dd40 (patch)
treee76b461d9d8e4e59516447722d69aa4ba806ee0a /app/controllers/dashboard_controller.rb
parent8cfa5ccf5342f98aaf6b0a292d337d3211d5e7ff (diff)
downloadgitlab-ce-rs-default-dashboard-assignee.tar.gz
Set a default assignee_id on dashboard actions when none is providedrs-default-dashboard-assignee
Prior, the dashboard would attempt to load _all_ issues or merge requests across the entire instance. On one the size of GitLab.com, for example, this would always result in a timeout.
Diffstat (limited to 'app/controllers/dashboard_controller.rb')
-rw-r--r--app/controllers/dashboard_controller.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index 280ed93faf8..7249938937a 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -5,6 +5,7 @@ class DashboardController < Dashboard::ApplicationController
before_action :event_filter, only: :activity
before_action :projects, only: [:issues, :merge_requests]
before_action :set_show_full_reference, only: [:issues, :merge_requests]
+ before_action :set_default_params, only: [:issues, :merge_requests]
respond_to :html
@@ -39,4 +40,13 @@ class DashboardController < Dashboard::ApplicationController
def set_show_full_reference
@show_full_reference = true
end
+
+ private
+
+ def set_default_params
+ return unless current_user
+ return if params[:assignee_id].present?
+
+ params[:assignee_id] = current_user.id
+ end
end