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
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
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
1 deletion
+33
-1
app/controllers/concerns/filter_projects.rb
app/controllers/concerns/filter_projects.rb
+5
-0
app/views/shared/projects/_dropdown.html.haml
app/views/shared/projects/_dropdown.html.haml
+9
-1
features/dashboard/dashboard.feature
features/dashboard/dashboard.feature
+5
-0
features/steps/shared/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
...
@@ -10,6 +10,11 @@ module FilterProjects
def
filter_projects
(
projects
)
def
filter_projects
(
projects
)
projects
=
projects
.
search
(
params
[
:filter_projects
])
if
params
[
:filter_projects
].
present?
projects
=
projects
.
search
(
params
[
:filter_projects
])
if
params
[
:filter_projects
].
present?
projects
=
projects
.
non_archived
if
params
[
:archived
].
blank?
projects
=
projects
.
non_archived
if
params
[
:archived
].
blank?
if
params
[
:personal
].
present?
and
current_user
projects
=
projects
.
personal
(
current_user
)
end
projects
projects
end
end
end
end
app/views/shared/projects/_dropdown.html.haml
View file @
ded5efad
-
@sort
||=
sort_value_recently_updated
-
@sort
||=
sort_value_recently_updated
-
personal
=
params
[
:personal
]
-
archived
=
params
[
:archived
]
-
archived
=
params
[
:archived
]
.dropdown.inline
.dropdown.inline
%button
.dropdown-toggle.btn
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
%button
.dropdown-toggle.btn
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
...
@@ -10,7 +11,7 @@
...
@@ -10,7 +11,7 @@
Sort by
Sort by
-
projects_sort_options_hash
.
each
do
|
value
,
title
|
-
projects_sort_options_hash
.
each
do
|
value
,
title
|
%li
%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
=
title
%li
.divider
%li
.divider
...
@@ -20,3 +21,10 @@
...
@@ -20,3 +21,10 @@
%li
%li
=
link_to
filter_projects_path
(
sort:
@sort
,
archived:
true
),
class:
(
"is-active"
if
params
[
:archived
].
present?
)
do
=
link_to
filter_projects_path
(
sort:
@sort
,
archived:
true
),
class:
(
"is-active"
if
params
[
:archived
].
present?
)
do
Show archived projects
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
...
@@ -79,3 +79,8 @@ Feature: Dashboard
And
I sort the list by
"Oldest updated"
And
I sort the list by
"Oldest updated"
And
I visit project
"Shop"
merge requests page
And
I visit project
"Shop"
merge requests page
Then
The list should be sorted by
"Oldest updated"
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
...
@@ -138,6 +138,20 @@ module SharedIssuable
end
end
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
step
'I should see "1 of 1" in the sidebar'
do
expect_sidebar_content
(
'1 of 1'
)
expect_sidebar_content
(
'1 of 1'
)
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