summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard_controller.rb
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-04-11 00:55:02 +0100
committerNick Thomas <nick@gitlab.com>2018-04-11 00:55:02 +0100
commit3f73bdd837f9803b75eca484a0a0615db6c58c80 (patch)
tree0bd2c99d9198bfa22e7a29f375131f940033da7b /app/controllers/dashboard_controller.rb
parentb594ab949d1a2ceb9d949ff2641679fbdf273452 (diff)
parent37a5632483b67ddcfa4c535cc911319b25f01fb5 (diff)
downloadgitlab-ce-xterm-npm.tar.gz
Merge branch 'master' into xterm-npmxterm-npm
Diffstat (limited to 'app/controllers/dashboard_controller.rb')
-rw-r--r--app/controllers/dashboard_controller.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index 280ed93faf8..68d328fa797 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -2,9 +2,17 @@ class DashboardController < Dashboard::ApplicationController
include IssuesAction
include MergeRequestsAction
+ FILTER_PARAMS = [
+ :author_id,
+ :assignee_id,
+ :milestone_title,
+ :label_name
+ ].freeze
+
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 :check_filters_presence!, only: [:issues, :merge_requests]
respond_to :html
@@ -39,4 +47,15 @@ class DashboardController < Dashboard::ApplicationController
def set_show_full_reference
@show_full_reference = true
end
+
+ def check_filters_presence!
+ @no_filters_set = FILTER_PARAMS.none? { |k| params.key?(k) }
+
+ return unless @no_filters_set
+
+ respond_to do |format|
+ format.html
+ format.atom { head :bad_request }
+ end
+ end
end