Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
5f6545f3
Commit
5f6545f3
authored
Sep 05, 2017
by
Sean McGivern
Committed by
Bryce Johnson
Sep 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move issues index variable setting to a method
This makes it easier to reuse in EE.
parent
c5536a37
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
app/controllers/concerns/issuable_collections.rb
app/controllers/concerns/issuable_collections.rb
+16
-0
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-14
No files found.
app/controllers/concerns/issuable_collections.rb
View file @
5f6545f3
...
@@ -10,6 +10,22 @@ module IssuableCollections
...
@@ -10,6 +10,22 @@ module IssuableCollections
private
private
def
set_issues_index
@collection_type
=
"Issue"
@issues
=
issues_collection
@issues
=
@issues
.
page
(
params
[
:page
])
@issuable_meta_data
=
issuable_meta_data
(
@issues
,
@collection_type
)
@total_pages
=
issues_page_count
(
@issues
)
return
if
redirect_out_of_range
(
@issues
,
@total_pages
)
if
params
[
:label_name
].
present?
@labels
=
LabelsFinder
.
new
(
current_user
,
project_id:
@project
.
id
,
title:
params
[
:label_name
]).
execute
end
@users
=
[]
end
def
issues_collection
def
issues_collection
issues_finder
.
execute
.
preload
(
:project
,
:author
,
:assignees
,
:labels
,
:milestone
,
project: :namespace
)
issues_finder
.
execute
.
preload
(
:project
,
:author
,
:assignees
,
:labels
,
:milestone
,
project: :namespace
)
end
end
...
...
app/controllers/projects/issues_controller.rb
View file @
5f6545f3
...
@@ -10,6 +10,7 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -10,6 +10,7 @@ class Projects::IssuesController < Projects::ApplicationController
before_action
:check_issues_available!
before_action
:check_issues_available!
before_action
:issue
,
except:
[
:index
,
:new
,
:create
,
:bulk_update
]
before_action
:issue
,
except:
[
:index
,
:new
,
:create
,
:bulk_update
]
before_action
:set_issues_index
,
only:
[
:index
]
# Allow write(create) issue
# Allow write(create) issue
before_action
:authorize_create_issue!
,
only:
[
:new
,
:create
]
before_action
:authorize_create_issue!
,
only:
[
:new
,
:create
]
...
@@ -23,20 +24,6 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -23,20 +24,6 @@ class Projects::IssuesController < Projects::ApplicationController
respond_to
:html
respond_to
:html
def
index
def
index
@collection_type
=
"Issue"
@issues
=
issues_collection
@issues
=
@issues
.
page
(
params
[
:page
])
@issuable_meta_data
=
issuable_meta_data
(
@issues
,
@collection_type
)
@total_pages
=
issues_page_count
(
@issues
)
return
if
redirect_out_of_range
(
@issues
,
@total_pages
)
if
params
[
:label_name
].
present?
@labels
=
LabelsFinder
.
new
(
current_user
,
project_id:
@project
.
id
,
title:
params
[
:label_name
]).
execute
end
@users
=
[]
if
params
[
:assignee_id
].
present?
if
params
[
:assignee_id
].
present?
assignee
=
User
.
find_by_id
(
params
[
:assignee_id
])
assignee
=
User
.
find_by_id
(
params
[
:assignee_id
])
@users
.
push
(
assignee
)
if
assignee
@users
.
push
(
assignee
)
if
assignee
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment