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
iv
gitlab-ce
Commits
0b86b46a
Commit
0b86b46a
authored
Feb 25, 2016
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't list issues from archived projects in Group view.
parent
6aa50165
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
3 deletions
+23
-3
app/controllers/concerns/issues_action.rb
app/controllers/concerns/issues_action.rb
+1
-1
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+1
-0
app/models/project.rb
app/models/project.rb
+1
-1
features/groups.feature
features/groups.feature
+6
-0
features/steps/groups.rb
features/steps/groups.rb
+14
-1
No files found.
app/controllers/concerns/issues_action.rb
View file @
0b86b46a
...
@@ -2,7 +2,7 @@ module IssuesAction
...
@@ -2,7 +2,7 @@ module IssuesAction
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
def
issues
def
issues
@issues
=
get_issues_collection
@issues
=
get_issues_collection
.
non_archived
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
ApplicationController
::
PER_PAGE
)
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
ApplicationController
::
PER_PAGE
)
@issues
=
@issues
.
preload
(
:author
,
:project
)
@issues
=
@issues
.
preload
(
:author
,
:project
)
...
...
app/models/concerns/issuable.rb
View file @
0b86b46a
...
@@ -38,6 +38,7 @@ module Issuable
...
@@ -38,6 +38,7 @@ module Issuable
scope
:join_project
,
->
{
joins
(
:project
)
}
scope
:join_project
,
->
{
joins
(
:project
)
}
scope
:references_project
,
->
{
references
(
:project
)
}
scope
:references_project
,
->
{
references
(
:project
)
}
scope
:non_archived
,
->
{
join_project
.
merge
(
Project
.
non_archived
)
}
delegate
:name
,
delegate
:name
,
:email
,
:email
,
...
...
app/models/project.rb
View file @
0b86b46a
...
@@ -278,7 +278,7 @@ class Project < ActiveRecord::Base
...
@@ -278,7 +278,7 @@ class Project < ActiveRecord::Base
end
end
def
search_by_title
(
query
)
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
end
def
find_with_namespace
(
id
)
def
find_with_namespace
(
id
)
...
...
features/groups.feature
View file @
0b86b46a
...
@@ -22,6 +22,12 @@ Feature: Groups
...
@@ -22,6 +22,12 @@ Feature: Groups
When
I visit group
"Owned"
issues page
When
I visit group
"Owned"
issues page
Then
I should see issues from group
"Owned"
assigned to me
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
Scenario
:
I
should see group
"Owned"
merge requests list
Given
project from group
"Owned"
has merge requests assigned to me
Given
project from group
"Owned"
has merge requests assigned to me
When
I visit group
"Owned"
merge requests page
When
I visit group
"Owned"
merge requests page
...
...
features/steps/groups.rb
View file @
0b86b46a
...
@@ -44,6 +44,12 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -44,6 +44,12 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
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 see merge requests from group "Owned" assigned to me'
do
step
'I should see merge requests from group "Owned" assigned to me'
do
assigned_to_me
(
:merge_requests
).
each
do
|
issue
|
assigned_to_me
(
:merge_requests
).
each
do
|
issue
|
expect
(
page
).
to
have_content
issue
.
title
[
0
..
80
]
expect
(
page
).
to
have_content
issue
.
title
[
0
..
80
]
...
@@ -113,7 +119,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -113,7 +119,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step
'Group "Owned" has archived project'
do
step
'Group "Owned" has archived project'
do
group
=
Group
.
find_by
(
name:
'Owned'
)
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
end
step
'I should see "archived" label'
do
step
'I should see "archived" label'
do
...
@@ -124,6 +130,13 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -124,6 +130,13 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
visit
group_path
(
-
1
)
visit
group_path
(
-
1
)
end
end
step
'the archived project have some issues'
do
create
:issue
,
project:
@archived_project
,
assignee:
current_user
,
author:
current_user
end
private
private
def
assigned_to_me
(
key
)
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