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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
0d23755c
Commit
0d23755c
authored
Mar 29, 2022
by
John Hope
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move set_issuables_index back into the controller callback cycle
parent
a7d28aca
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
app/controllers/concerns/issuable_collections.rb
app/controllers/concerns/issuable_collections.rb
+1
-1
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+11
-4
spec/controllers/projects/issues_controller_spec.rb
spec/controllers/projects/issues_controller_spec.rb
+2
-2
No files found.
app/controllers/concerns/issuable_collections.rb
View file @
0d23755c
...
@@ -28,7 +28,7 @@ module IssuableCollections
...
@@ -28,7 +28,7 @@ module IssuableCollections
unless
pagination_disabled?
unless
pagination_disabled?
set_pagination
set_pagination
return
if
html_request?
&&
redirect_out_of_range
(
@issuables
,
@total_pages
)
return
if
redirect_out_of_range
(
@issuables
,
@total_pages
)
end
end
if
params
[
:label_name
].
present?
&&
@project
if
params
[
:label_name
].
present?
&&
@project
...
...
app/controllers/projects/issues_controller.rb
View file @
0d23755c
...
@@ -10,7 +10,7 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -10,7 +10,7 @@ class Projects::IssuesController < Projects::ApplicationController
include
RecordUserLastActivity
include
RecordUserLastActivity
ISSUES_EXCEPT_ACTIONS
=
%i[index calendar new create bulk_update import_csv export_csv service_desk]
.
freeze
ISSUES_EXCEPT_ACTIONS
=
%i[index calendar new create bulk_update import_csv export_csv service_desk]
.
freeze
SET_ISSUABLES_INDEX_ONLY_ACTIONS
=
%i[calendar service_desk]
.
freeze
SET_ISSUABLES_INDEX_ONLY_ACTIONS
=
%i[
index
calendar service_desk]
.
freeze
prepend_before_action
(
only:
[
:index
])
{
authenticate_sessionless_user!
(
:rss
)
}
prepend_before_action
(
only:
[
:index
])
{
authenticate_sessionless_user!
(
:rss
)
}
prepend_before_action
(
only:
[
:calendar
])
{
authenticate_sessionless_user!
(
:ics
)
}
prepend_before_action
(
only:
[
:calendar
])
{
authenticate_sessionless_user!
(
:ics
)
}
...
@@ -22,7 +22,9 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -22,7 +22,9 @@ class Projects::IssuesController < Projects::ApplicationController
before_action
:issue
,
unless:
->
(
c
)
{
ISSUES_EXCEPT_ACTIONS
.
include?
(
c
.
action_name
.
to_sym
)
}
before_action
:issue
,
unless:
->
(
c
)
{
ISSUES_EXCEPT_ACTIONS
.
include?
(
c
.
action_name
.
to_sym
)
}
after_action
:log_issue_show
,
unless:
->
(
c
)
{
ISSUES_EXCEPT_ACTIONS
.
include?
(
c
.
action_name
.
to_sym
)
}
after_action
:log_issue_show
,
unless:
->
(
c
)
{
ISSUES_EXCEPT_ACTIONS
.
include?
(
c
.
action_name
.
to_sym
)
}
before_action
:set_issuables_index
,
if:
->
(
c
)
{
SET_ISSUABLES_INDEX_ONLY_ACTIONS
.
include?
(
c
.
action_name
.
to_sym
)
}
before_action
:set_issuables_index
,
if:
->
(
c
)
{
SET_ISSUABLES_INDEX_ONLY_ACTIONS
.
include?
(
c
.
action_name
.
to_sym
)
&&
!
vue_issues_list?
}
# Allow write(create) issue
# Allow write(create) issue
before_action
:authorize_create_issue!
,
only:
[
:new
,
:create
]
before_action
:authorize_create_issue!
,
only:
[
:new
,
:create
]
...
@@ -71,10 +73,9 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -71,10 +73,9 @@ class Projects::IssuesController < Projects::ApplicationController
attr_accessor
:vulnerability_id
attr_accessor
:vulnerability_id
def
index
def
index
if
html_request?
&&
Feature
.
enabled?
(
:vue_issues_list
,
project
&
.
group
,
default_enabled: :yaml
)
if
vue_issues_list?
set_sort_order
set_sort_order
else
else
set_issuables_index
@issues
=
@issuables
@issues
=
@issuables
end
end
...
@@ -248,6 +249,12 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -248,6 +249,12 @@ class Projects::IssuesController < Projects::ApplicationController
protected
protected
def
vue_issues_list?
action_name
.
to_sym
==
:index
&&
html_request?
&&
Feature
.
enabled?
(
:vue_issues_list
,
project
&
.
group
,
default_enabled: :yaml
)
end
def
sorting_field
def
sorting_field
Issue
::
SORTING_PREFERENCE_FIELD
Issue
::
SORTING_PREFERENCE_FIELD
end
end
...
...
spec/controllers/projects/issues_controller_spec.rb
View file @
0d23755c
...
@@ -151,8 +151,8 @@ RSpec.describe Projects::IssuesController do
...
@@ -151,8 +151,8 @@ RSpec.describe Projects::IssuesController do
it
'does not redirect on out of bounds when non-html'
do
it
'does not redirect on out of bounds when non-html'
do
get
:index
,
params:
params
.
merge
(
page:
last_page
+
1
),
format:
'atom'
get
:index
,
params:
params
.
merge
(
page:
last_page
+
1
),
format:
'atom'
expect
(
response
).
to
have_gitlab_http_status
(
:
ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:
redirect
)
expect
(
assigns
(
:issues
).
size
).
to
eq
(
0
)
expect
(
response
).
to
redirect_to
(
action:
'index'
,
format:
'atom'
,
page:
last_page
,
state:
'opened'
)
end
end
it
'does not use pagination if disabled'
do
it
'does not use pagination if disabled'
do
...
...
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