mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-20 10:06:04 +10:00
Use FilteringService for project issuus, mrs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
@@ -116,7 +116,10 @@ class Projects::IssuesController < Projects::ApplicationController
|
||||
end
|
||||
|
||||
def issues_filtered
|
||||
@issues = Issues::ListContext.new(project, current_user, params).execute
|
||||
params[:scope] = 'all' if params[:scope].blank?
|
||||
params[:state] = 'opened' if params[:state].blank?
|
||||
params[:project_id] = @project.id
|
||||
@issues = FilteringService.new.execute(Issue, current_user, params)
|
||||
end
|
||||
|
||||
# Since iids are implemented only in 6.1
|
||||
|
||||
@@ -17,9 +17,15 @@ class Projects::MergeRequestsController < Projects::ApplicationController
|
||||
before_filter :authorize_modify_merge_request!, only: [:close, :edit, :update, :sort]
|
||||
|
||||
def index
|
||||
sort_param = params[:sort] || 'newest'
|
||||
@sort = sort_param.humanize unless sort_param.empty?
|
||||
@merge_requests = MergeRequestsLoadContext.new(project, current_user, params).execute
|
||||
params[:sort] ||= 'newest'
|
||||
params[:scope] = 'all' if params[:scope].blank?
|
||||
params[:state] = 'opened' if params[:state].blank?
|
||||
params[:project_id] = @project.id
|
||||
|
||||
@merge_requests = FilteringService.new.execute(MergeRequest, current_user, params)
|
||||
@merge_requests = @merge_requests.page(params[:page]).per(20)
|
||||
|
||||
@sort = params[:sort].humanize
|
||||
assignee_id, milestone_id = params[:assignee_id], params[:milestone_id]
|
||||
@assignee = @project.team.find(assignee_id) if assignee_id.present? && !assignee_id.to_i.zero?
|
||||
@milestone = @project.milestones.find(milestone_id) if milestone_id.present? && !milestone_id.to_i.zero?
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
- if current_user
|
||||
%fieldset
|
||||
%ul.nav.nav-pills.nav-stacked
|
||||
%li{class: ("active" if params[:scope].blank?)}
|
||||
= link_to project_filter_path(scope: nil) do
|
||||
%li{class: ("active" if params[:scope] == 'all')}
|
||||
= link_to project_filter_path(scope: 'all') do
|
||||
Everyone's
|
||||
%li{class: ("active" if params[:scope] == 'assigned-to-me')}
|
||||
= link_to project_filter_path(scope: 'assigned-to-me') do
|
||||
@@ -16,8 +16,8 @@
|
||||
%fieldset
|
||||
%legend State
|
||||
%ul.nav.nav-pills
|
||||
%li{class: ("active" if params[:state].blank?)}
|
||||
= link_to project_filter_path(state: nil) do
|
||||
%li{class: ("active" if params[:state] == 'opened')}
|
||||
= link_to project_filter_path(state: 'opened') do
|
||||
Open
|
||||
%li{class: ("active" if params[:state] == 'closed')}
|
||||
= link_to project_filter_path(state: 'closed') do
|
||||
|
||||
Reference in New Issue
Block a user