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
ded5efad
Commit
ded5efad
authored
Apr 15, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow filtering by Owned projects
parent
17b60d68
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
1 deletion
+33
-1
filter_projects.rb
app/controllers/concerns/filter_projects.rb
+5
-0
_dropdown.html.haml
app/views/shared/projects/_dropdown.html.haml
+9
-1
dashboard.feature
features/dashboard/dashboard.feature
+5
-0
issuable.rb
features/steps/shared/issuable.rb
+14
-0
No files found.
app/controllers/concerns/filter_projects.rb
View file @
ded5efad
...
...
@@ -10,6 +10,11 @@ module FilterProjects
def
filter_projects
(
projects
)
projects
=
projects
.
search
(
params
[
:filter_projects
])
if
params
[
:filter_projects
].
present?
projects
=
projects
.
non_archived
if
params
[
:archived
].
blank?
if
params
[
:personal
].
present?
and
current_user
projects
=
projects
.
personal
(
current_user
)
end
projects
end
end
app/views/shared/projects/_dropdown.html.haml
View file @
ded5efad
-
@sort
||=
sort_value_recently_updated
-
personal
=
params
[
:personal
]
-
archived
=
params
[
:archived
]
.dropdown.inline
%button
.dropdown-toggle.btn
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
...
...
@@ -10,7 +11,7 @@
Sort by
-
projects_sort_options_hash
.
each
do
|
value
,
title
|
%li
=
link_to
filter_projects_path
(
sort:
value
,
archived:
archived
),
class:
(
"is-active"
if
@sort
==
value
)
do
=
link_to
filter_projects_path
(
sort:
value
,
archived:
archived
,
personal:
personal
),
class:
(
"is-active"
if
@sort
==
value
)
do
=
title
%li
.divider
...
...
@@ -20,3 +21,10 @@
%li
=
link_to
filter_projects_path
(
sort:
@sort
,
archived:
true
),
class:
(
"is-active"
if
params
[
:archived
].
present?
)
do
Show archived projects
%li
.divider
%li
=
link_to
filter_projects_path
(
sort:
@sort
,
personal:
nil
),
class:
(
"is-active"
unless
personal
)
do
Owned by anyone
%li
=
link_to
filter_projects_path
(
sort:
@sort
,
personal:
true
),
class:
(
"is-active"
if
personal
)
do
Owned by me
features/dashboard/dashboard.feature
View file @
ded5efad
...
...
@@ -79,3 +79,8 @@ Feature: Dashboard
And
I sort the list by
"Oldest updated"
And
I visit project
"Shop"
merge requests page
Then
The list should be sorted by
"Oldest updated"
@javascript
@focus
Scenario
:
Sort owned Projects
Then
I filter the list by
"Owned by me"
Then
The list should be filtered by
"Owned by me"
features/steps/shared/issuable.rb
View file @
ded5efad
...
...
@@ -138,6 +138,20 @@ module SharedIssuable
end
end
step
'I filter the list by "Owned by me"'
do
find
(
'button.dropdown-toggle.btn'
).
click
page
.
within
(
'ul.dropdown-menu.dropdown-menu-align-right'
)
do
click_link
"Owned by me"
end
end
step
'The list should be filtered by "Owned by me"'
do
page
.
within
(
'ul.dropdown-menu.dropdown-menu-align-right'
)
do
expect
(
page
).
to
have_selector
(
'a'
,
text:
'Owned by me'
)
end
end
step
'I should see "1 of 1" in the sidebar'
do
expect_sidebar_content
(
'1 of 1'
)
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