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
Jérome Perrin
gitlab-ce
Commits
d4e91b22
Commit
d4e91b22
authored
Sep 22, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert part of "Merge branch 'update_issues_mr_counter' into 'master'
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
dfc2fe77
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
18 additions
and
72 deletions
+18
-72
app/controllers/concerns/issuable_collections.rb
app/controllers/concerns/issuable_collections.rb
+0
-12
app/controllers/concerns/issues_action.rb
app/controllers/concerns/issues_action.rb
+0
-2
app/controllers/concerns/merge_requests_action.rb
app/controllers/concerns/merge_requests_action.rb
+0
-2
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+0
-2
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+0
-2
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+13
-4
app/views/shared/issuable/_nav.html.haml
app/views/shared/issuable/_nav.html.haml
+5
-7
spec/features/dashboard_issues_spec.rb
spec/features/dashboard_issues_spec.rb
+0
-9
spec/features/issues/filter_issues_spec.rb
spec/features/issues/filter_issues_spec.rb
+0
-32
No files found.
app/controllers/concerns/issuable_collections.rb
View file @
d4e91b22
...
@@ -13,18 +13,10 @@ module IssuableCollections
...
@@ -13,18 +13,10 @@ module IssuableCollections
issues_finder
.
execute
issues_finder
.
execute
end
end
def
all_issues_collection
IssuesFinder
.
new
(
current_user
,
filter_params_all
).
execute
end
def
merge_requests_collection
def
merge_requests_collection
merge_requests_finder
.
execute
merge_requests_finder
.
execute
end
end
def
all_merge_requests_collection
MergeRequestsFinder
.
new
(
current_user
,
filter_params_all
).
execute
end
def
issues_finder
def
issues_finder
@issues_finder
||=
issuable_finder_for
(
IssuesFinder
)
@issues_finder
||=
issuable_finder_for
(
IssuesFinder
)
end
end
...
@@ -62,10 +54,6 @@ module IssuableCollections
...
@@ -62,10 +54,6 @@ module IssuableCollections
@filter_params
@filter_params
end
end
def
filter_params_all
@filter_params_all
||=
filter_params
.
merge
(
state:
'all'
,
sort:
nil
)
end
def
set_default_scope
def
set_default_scope
params
[
:scope
]
=
'all'
if
params
[
:scope
].
blank?
params
[
:scope
]
=
'all'
if
params
[
:scope
].
blank?
end
end
...
...
app/controllers/concerns/issues_action.rb
View file @
d4e91b22
...
@@ -10,8 +10,6 @@ module IssuesAction
...
@@ -10,8 +10,6 @@ module IssuesAction
.
preload
(
:author
,
:project
)
.
preload
(
:author
,
:project
)
.
page
(
params
[
:page
])
.
page
(
params
[
:page
])
@all_issues
=
all_issues_collection
.
non_archived
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
format
.
atom
{
render
layout:
false
}
format
.
atom
{
render
layout:
false
}
...
...
app/controllers/concerns/merge_requests_action.rb
View file @
d4e91b22
...
@@ -9,7 +9,5 @@ module MergeRequestsAction
...
@@ -9,7 +9,5 @@ module MergeRequestsAction
.
non_archived
.
non_archived
.
preload
(
:author
,
:target_project
)
.
preload
(
:author
,
:target_project
)
.
page
(
params
[
:page
])
.
page
(
params
[
:page
])
@all_merge_requests
=
all_merge_requests_collection
.
non_archived
end
end
end
end
app/controllers/projects/issues_controller.rb
View file @
d4e91b22
...
@@ -28,8 +28,6 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -28,8 +28,6 @@ class Projects::IssuesController < Projects::ApplicationController
@labels
=
@project
.
labels
.
where
(
title:
params
[
:label_name
])
@labels
=
@project
.
labels
.
where
(
title:
params
[
:label_name
])
@all_issues
=
all_issues_collection
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
format
.
atom
{
render
layout:
false
}
format
.
atom
{
render
layout:
false
}
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
d4e91b22
...
@@ -37,8 +37,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -37,8 +37,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@labels
=
@project
.
labels
.
where
(
title:
params
[
:label_name
])
@labels
=
@project
.
labels
.
where
(
title:
params
[
:label_name
])
@all_merge_requests
=
all_merge_requests_collection
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
format
.
json
do
format
.
json
do
...
...
app/helpers/application_helper.rb
View file @
d4e91b22
...
@@ -280,14 +280,23 @@ module ApplicationHelper
...
@@ -280,14 +280,23 @@ module ApplicationHelper
end
end
end
end
def
state_filters_text_for
(
state
,
records
)
def
state_filters_text_for
(
entity
,
project
)
titles
=
{
titles
=
{
opened:
"Open"
opened:
"Open"
}
}
state_title
=
titles
[
state
]
||
state
.
to_s
.
humanize
entity_title
=
titles
[
entity
]
||
entity
.
to_s
.
humanize
count
=
records
.
public_send
(
state
).
size
html
=
content_tag
:span
,
state_title
count
=
if
project
.
nil?
nil
elsif
current_controller?
(
:issues
)
project
.
issues
.
visible_to_user
(
current_user
).
send
(
entity
).
count
elsif
current_controller?
(
:merge_requests
)
project
.
merge_requests
.
send
(
entity
).
count
end
html
=
content_tag
:span
,
entity_title
if
count
.
present?
if
count
.
present?
html
+=
" "
html
+=
" "
...
...
app/views/shared/issuable/_nav.html.haml
View file @
d4e91b22
%ul
.nav-links.issues-state-filters
%ul
.nav-links.issues-state-filters
-
if
defined?
(
type
)
&&
type
==
:merge_requests
-
if
defined?
(
type
)
&&
type
==
:merge_requests
-
page_context_word
=
'merge requests'
-
page_context_word
=
'merge requests'
-
records
=
@all_merge_requests
-
else
-
else
-
page_context_word
=
'issues'
-
page_context_word
=
'issues'
-
records
=
@all_issues
%li
{
class:
(
"active"
if
params
[
:state
]
==
'opened'
)}
%li
{
class:
(
"active"
if
params
[
:state
]
==
'opened'
)}
=
link_to
page_filter_path
(
state:
'opened'
,
label:
true
),
title:
"Filter by
#{
page_context_word
}
that are currently opened."
do
=
link_to
page_filter_path
(
state:
'opened'
,
label:
true
),
title:
"Filter by
#{
page_context_word
}
that are currently opened."
do
#{
state_filters_text_for
(
:opened
,
records
)
}
#{
state_filters_text_for
(
:opened
,
@project
)
}
-
if
defined?
(
type
)
&&
type
==
:merge_requests
-
if
defined?
(
type
)
&&
type
==
:merge_requests
%li
{
class:
(
"active"
if
params
[
:state
]
==
'merged'
)}
%li
{
class:
(
"active"
if
params
[
:state
]
==
'merged'
)}
=
link_to
page_filter_path
(
state:
'merged'
,
label:
true
),
title:
'Filter by merge requests that are currently merged.'
do
=
link_to
page_filter_path
(
state:
'merged'
,
label:
true
),
title:
'Filter by merge requests that are currently merged.'
do
#{
state_filters_text_for
(
:merged
,
records
)
}
#{
state_filters_text_for
(
:merged
,
@project
)
}
%li
{
class:
(
"active"
if
params
[
:state
]
==
'closed'
)}
%li
{
class:
(
"active"
if
params
[
:state
]
==
'closed'
)}
=
link_to
page_filter_path
(
state:
'closed'
,
label:
true
),
title:
'Filter by merge requests that are currently closed and unmerged.'
do
=
link_to
page_filter_path
(
state:
'closed'
,
label:
true
),
title:
'Filter by merge requests that are currently closed and unmerged.'
do
#{
state_filters_text_for
(
:closed
,
records
)
}
#{
state_filters_text_for
(
:closed
,
@project
)
}
-
else
-
else
%li
{
class:
(
"active"
if
params
[
:state
]
==
'closed'
)}
%li
{
class:
(
"active"
if
params
[
:state
]
==
'closed'
)}
=
link_to
page_filter_path
(
state:
'closed'
,
label:
true
),
title:
'Filter by issues that are currently closed.'
do
=
link_to
page_filter_path
(
state:
'closed'
,
label:
true
),
title:
'Filter by issues that are currently closed.'
do
#{
state_filters_text_for
(
:closed
,
records
)
}
#{
state_filters_text_for
(
:closed
,
@project
)
}
%li
{
class:
(
"active"
if
params
[
:state
]
==
'all'
)}
%li
{
class:
(
"active"
if
params
[
:state
]
==
'all'
)}
=
link_to
page_filter_path
(
state:
'all'
,
label:
true
),
title:
"Show all
#{
page_context_word
}
."
do
=
link_to
page_filter_path
(
state:
'all'
,
label:
true
),
title:
"Show all
#{
page_context_word
}
."
do
#{
state_filters_text_for
(
:all
,
records
)
}
#{
state_filters_text_for
(
:all
,
@project
)
}
spec/features/dashboard_issues_spec.rb
View file @
d4e91b22
...
@@ -21,9 +21,6 @@ describe "Dashboard Issues filtering", feature: true, js: true do
...
@@ -21,9 +21,6 @@ describe "Dashboard Issues filtering", feature: true, js: true do
click_link
'No Milestone'
click_link
'No Milestone'
page
.
within
'.issues-state-filters'
do
expect
(
page
).
to
have_selector
(
'.active .badge'
,
text:
'1'
)
end
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
end
end
...
@@ -32,9 +29,6 @@ describe "Dashboard Issues filtering", feature: true, js: true do
...
@@ -32,9 +29,6 @@ describe "Dashboard Issues filtering", feature: true, js: true do
click_link
'Any Milestone'
click_link
'Any Milestone'
page
.
within
'.issues-state-filters'
do
expect
(
page
).
to
have_selector
(
'.active .badge'
,
text:
'2'
)
end
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
2
)
end
end
...
@@ -45,9 +39,6 @@ describe "Dashboard Issues filtering", feature: true, js: true do
...
@@ -45,9 +39,6 @@ describe "Dashboard Issues filtering", feature: true, js: true do
click_link
milestone
.
title
click_link
milestone
.
title
end
end
page
.
within
'.issues-state-filters'
do
expect
(
page
).
to
have_selector
(
'.active .badge'
,
text:
'1'
)
end
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
end
end
end
end
...
...
spec/features/issues/filter_issues_spec.rb
View file @
d4e91b22
...
@@ -230,10 +230,6 @@ describe 'Filter issues', feature: true do
...
@@ -230,10 +230,6 @@ describe 'Filter issues', feature: true do
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
2
)
end
end
page
.
within
'.issues-state-filters'
do
expect
(
page
).
to
have_selector
(
'.active .badge'
,
text:
'2'
)
end
click_button
'Label'
click_button
'Label'
page
.
within
'.labels-filter'
do
page
.
within
'.labels-filter'
do
click_link
'bug'
click_link
'bug'
...
@@ -243,10 +239,6 @@ describe 'Filter issues', feature: true do
...
@@ -243,10 +239,6 @@ describe 'Filter issues', feature: true do
page
.
within
'.issues-list'
do
page
.
within
'.issues-list'
do
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
end
end
page
.
within
'.issues-state-filters'
do
expect
(
page
).
to
have_selector
(
'.active .badge'
,
text:
'1'
)
end
end
end
it
'filters by text and milestone'
do
it
'filters by text and milestone'
do
...
@@ -256,10 +248,6 @@ describe 'Filter issues', feature: true do
...
@@ -256,10 +248,6 @@ describe 'Filter issues', feature: true do
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
2
)
end
end
page
.
within
'.issues-state-filters'
do
expect
(
page
).
to
have_selector
(
'.active .badge'
,
text:
'2'
)
end
click_button
'Milestone'
click_button
'Milestone'
page
.
within
'.milestone-filter'
do
page
.
within
'.milestone-filter'
do
click_link
'8'
click_link
'8'
...
@@ -268,10 +256,6 @@ describe 'Filter issues', feature: true do
...
@@ -268,10 +256,6 @@ describe 'Filter issues', feature: true do
page
.
within
'.issues-list'
do
page
.
within
'.issues-list'
do
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
end
end
page
.
within
'.issues-state-filters'
do
expect
(
page
).
to
have_selector
(
'.active .badge'
,
text:
'1'
)
end
end
end
it
'filters by text and assignee'
do
it
'filters by text and assignee'
do
...
@@ -281,10 +265,6 @@ describe 'Filter issues', feature: true do
...
@@ -281,10 +265,6 @@ describe 'Filter issues', feature: true do
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
2
)
end
end
page
.
within
'.issues-state-filters'
do
expect
(
page
).
to
have_selector
(
'.active .badge'
,
text:
'2'
)
end
click_button
'Assignee'
click_button
'Assignee'
page
.
within
'.dropdown-menu-assignee'
do
page
.
within
'.dropdown-menu-assignee'
do
click_link
user
.
name
click_link
user
.
name
...
@@ -293,10 +273,6 @@ describe 'Filter issues', feature: true do
...
@@ -293,10 +273,6 @@ describe 'Filter issues', feature: true do
page
.
within
'.issues-list'
do
page
.
within
'.issues-list'
do
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
end
end
page
.
within
'.issues-state-filters'
do
expect
(
page
).
to
have_selector
(
'.active .badge'
,
text:
'1'
)
end
end
end
it
'filters by text and author'
do
it
'filters by text and author'
do
...
@@ -306,10 +282,6 @@ describe 'Filter issues', feature: true do
...
@@ -306,10 +282,6 @@ describe 'Filter issues', feature: true do
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
2
)
end
end
page
.
within
'.issues-state-filters'
do
expect
(
page
).
to
have_selector
(
'.active .badge'
,
text:
'2'
)
end
click_button
'Author'
click_button
'Author'
page
.
within
'.dropdown-menu-author'
do
page
.
within
'.dropdown-menu-author'
do
click_link
user
.
name
click_link
user
.
name
...
@@ -318,10 +290,6 @@ describe 'Filter issues', feature: true do
...
@@ -318,10 +290,6 @@ describe 'Filter issues', feature: true do
page
.
within
'.issues-list'
do
page
.
within
'.issues-list'
do
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
end
end
page
.
within
'.issues-state-filters'
do
expect
(
page
).
to
have_selector
(
'.active .badge'
,
text:
'1'
)
end
end
end
end
end
end
end
...
...
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