diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-12-23 19:49:39 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-12-23 19:49:39 +0300 |
commit | 47634e392fab457dd0634225961944804bc04efe (patch) | |
tree | 8d70528e0a9a1d18264e9937c10054d5507462a0 /app/controllers/dashboard_controller.rb | |
parent | 32eb5de510a7e32d9bb886595aa47d95dc00490f (diff) |
Refactor issues and merge requests lists
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/dashboard_controller.rb')
-rw-r--r-- | app/controllers/dashboard_controller.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 5aff526d1b5..bfd1361f2df 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -3,8 +3,6 @@ class DashboardController < ApplicationController before_filter :load_projects, except: [:projects] before_filter :event_filter, only: :show - before_filter :default_filter, only: [:issues, :merge_requests] - def show # Fetch only 30 projects. @@ -55,13 +53,17 @@ class DashboardController < ApplicationController end def merge_requests + set_filters_defaults @merge_requests = MergeRequestsFinder.new.execute(current_user, params) + set_filter_values(@merge_requests) @merge_requests = @merge_requests.page(params[:page]).per(20) @merge_requests = @merge_requests.preload(:author, :target_project) end def issues + set_filters_defaults @issues = IssuesFinder.new.execute(current_user, params) + set_filter_values(@issues) @issues = @issues.page(params[:page]).per(20) @issues = @issues.preload(:author, :project) @@ -76,10 +78,4 @@ class DashboardController < ApplicationController def load_projects @projects = current_user.authorized_projects.sorted_by_activity.non_archived end - - def default_filter - params[:scope] = 'assigned-to-me' if params[:scope].blank? - params[:state] = 'opened' if params[:state].blank? - params[:authorized_only] = true - end end |