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
3900b2f3
Commit
3900b2f3
authored
Jun 29, 2017
by
Horacio Bertorello
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide archived project labels from group issue tracker
parent
a704f9e5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
app/finders/labels_finder.rb
app/finders/labels_finder.rb
+6
-1
changelogs/unreleased/hb-hide-archived-labels-from-group-issue-tracker.yml
...ased/hb-hide-archived-labels-from-group-issue-tracker.yml
+4
-0
spec/finders/labels_finder_spec.rb
spec/finders/labels_finder_spec.rb
+3
-3
No files found.
app/finders/labels_finder.rb
View file @
3900b2f3
...
...
@@ -83,7 +83,12 @@ class LabelsFinder < UnionFinder
def
projects
return
@projects
if
defined?
(
@projects
)
@projects
=
skip_authorization
?
Project
.
all
:
ProjectsFinder
.
new
(
current_user:
current_user
).
execute
@projects
=
if
skip_authorization
Project
.
all
else
ProjectsFinder
.
new
(
params:
{
non_archived:
true
},
current_user:
current_user
).
execute
end
@projects
=
@projects
.
in_namespace
(
params
[
:group_id
])
if
group?
@projects
=
@projects
.
where
(
id:
params
[
:project_ids
])
if
projects?
@projects
=
@projects
.
reorder
(
nil
)
...
...
changelogs/unreleased/hb-hide-archived-labels-from-group-issue-tracker.yml
0 → 100644
View file @
3900b2f3
---
title
:
Hide archived project labels from group issue tracker
merge_request
:
12547
author
:
Horacio Bertorello
spec/finders/labels_finder_spec.rb
View file @
3900b2f3
...
...
@@ -49,12 +49,12 @@ describe LabelsFinder do
end
context
'filtering by group_id'
do
it
'returns labels available for any project within the group'
do
it
'returns labels available for any
non-archived
project within the group'
do
group_1
.
add_developer
(
user
)
project_1
.
archive!
finder
=
described_class
.
new
(
user
,
group_id:
group_1
.
id
)
expect
(
finder
.
execute
).
to
eq
[
group_label_2
,
project_label_1
,
group_label_1
,
project_label_5
]
expect
(
finder
.
execute
).
to
eq
[
group_label_2
,
group_label_1
,
project_label_5
]
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