BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
7e710acc
Commit
7e710acc
authored
Mar 03, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue_4095' into 'master'
Don't show Issues/MRs from archived projects in Groups view Fixes #4095 See merge request !2980
parents
1fa7671f
7dd2e37a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
4 deletions
+45
-4
CHANGELOG
CHANGELOG
+1
-0
issues_action.rb
app/controllers/concerns/issues_action.rb
+1
-1
merge_requests_action.rb
app/controllers/concerns/merge_requests_action.rb
+1
-1
issuable.rb
app/models/concerns/issuable.rb
+1
-0
project.rb
app/models/project.rb
+1
-1
groups.feature
features/groups.feature
+12
-0
groups.rb
features/steps/groups.rb
+28
-1
No files found.
CHANGELOG
View file @
7e710acc
...
...
@@ -10,6 +10,7 @@ v 8.6.0 (unreleased)
- Return empty array instead of 404 when commit has no statuses in commit status API
- Update documentation to reflect Guest role not being enforced on internal projects
- Allow search for logged out users
- Don't show Issues/MRs from archived projects in Groups view
v 8.5.2
- Fix sidebar overlapping content when screen width was below 1200px
...
...
app/controllers/concerns/issues_action.rb
View file @
7e710acc
...
...
@@ -2,7 +2,7 @@ module IssuesAction
extend
ActiveSupport
::
Concern
def
issues
@issues
=
get_issues_collection
@issues
=
get_issues_collection
.
non_archived
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
ApplicationController
::
PER_PAGE
)
@issues
=
@issues
.
preload
(
:author
,
:project
)
...
...
app/controllers/concerns/merge_requests_action.rb
View file @
7e710acc
...
...
@@ -2,7 +2,7 @@ module MergeRequestsAction
extend
ActiveSupport
::
Concern
def
merge_requests
@merge_requests
=
get_merge_requests_collection
@merge_requests
=
get_merge_requests_collection
.
non_archived
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
ApplicationController
::
PER_PAGE
)
@merge_requests
=
@merge_requests
.
preload
(
:author
,
:target_project
)
...
...
app/models/concerns/issuable.rb
View file @
7e710acc
...
...
@@ -38,6 +38,7 @@ module Issuable
scope
:join_project
,
->
{
joins
(
:project
)
}
scope
:references_project
,
->
{
references
(
:project
)
}
scope
:non_archived
,
->
{
join_project
.
merge
(
Project
.
non_archived
)
}
delegate
:name
,
:email
,
...
...
app/models/project.rb
View file @
7e710acc
...
...
@@ -278,7 +278,7 @@ class Project < ActiveRecord::Base
end
def
search_by_title
(
query
)
where
(
'projects.archived = ?'
,
false
)
.
where
(
'LOWER(projects.name) LIKE :query'
,
query:
"%
#{
query
.
downcase
}
%"
)
non_archived
.
where
(
'LOWER(projects.name) LIKE :query'
,
query:
"%
#{
query
.
downcase
}
%"
)
end
def
find_with_namespace
(
id
)
...
...
features/groups.feature
View file @
7e710acc
...
...
@@ -22,11 +22,23 @@ Feature: Groups
When
I visit group
"Owned"
issues page
Then
I should see issues from group
"Owned"
assigned to me
Scenario
:
I
should not see issues from archived project in
"Owned"
group issues list
Given
Group
"Owned"
has archived project
And
the archived project have some issues
When
I visit group
"Owned"
issues page
Then
I should not see issues from the archived project
Scenario
:
I
should see group
"Owned"
merge requests list
Given
project from group
"Owned"
has merge requests assigned to me
When
I visit group
"Owned"
merge requests page
Then
I should see merge requests from group
"Owned"
assigned to me
Scenario
:
I
should not see merge requests from archived project in
"Owned"
group merge requests list
Given
Group
"Owned"
has archived project
And
the archived project have some merge_requests
When
I visit group
"Owned"
merge requests page
Then
I should not see merge requests from the archived project
Scenario
:
I
should see edit group
"Owned"
page
When
I visit group
"Owned"
settings page
And
I change group
"Owned"
name to
"new-name"
...
...
features/steps/groups.rb
View file @
7e710acc
...
...
@@ -44,6 +44,18 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
step
'I should not see issues from the archived project'
do
@archived_project
.
issues
.
each
do
|
issue
|
expect
(
page
).
not_to
have_content
issue
.
title
end
end
step
'I should not see merge requests from the archived project'
do
@archived_project
.
merge_requests
.
each
do
|
mr
|
expect
(
page
).
not_to
have_content
mr
.
title
end
end
step
'I should see merge requests from group "Owned" assigned to me'
do
assigned_to_me
(
:merge_requests
).
each
do
|
issue
|
expect
(
page
).
to
have_content
issue
.
title
[
0
..
80
]
...
...
@@ -113,7 +125,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step
'Group "Owned" has archived project'
do
group
=
Group
.
find_by
(
name:
'Owned'
)
create
(
:project
,
namespace:
group
,
archived:
true
,
path:
"archived-project"
)
@archived_project
=
create
(
:project
,
namespace:
group
,
archived:
true
,
path:
"archived-project"
)
end
step
'I should see "archived" label'
do
...
...
@@ -124,6 +136,21 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
visit
group_path
(
-
1
)
end
step
'the archived project have some issues'
do
create
:issue
,
project:
@archived_project
,
assignee:
current_user
,
author:
current_user
end
step
'the archived project have some merge requests'
do
create
:merge_request
,
source_project:
@archived_project
,
target_project:
@archived_project
,
assignee:
current_user
,
author:
current_user
end
private
def
assigned_to_me
(
key
)
...
...
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