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
8d7e0f0b
Commit
8d7e0f0b
authored
Mar 09, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed failing tests
parent
a9ea06ed
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
72 additions
and
44 deletions
+72
-44
app/assets/javascripts/milestone_select.js.coffee
app/assets/javascripts/milestone_select.js.coffee
+2
-2
app/assets/stylesheets/framework/filters.scss
app/assets/stylesheets/framework/filters.scss
+1
-0
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+29
-27
features/steps/dashboard/issues.rb
features/steps/dashboard/issues.rb
+13
-4
features/steps/dashboard/merge_requests.rb
features/steps/dashboard/merge_requests.rb
+13
-4
features/steps/project/issues/filter_labels.rb
features/steps/project/issues/filter_labels.rb
+4
-1
features/steps/project/issues/issues.rb
features/steps/project/issues/issues.rb
+6
-5
spec/features/issues/filter_by_milestone_spec.rb
spec/features/issues/filter_by_milestone_spec.rb
+4
-1
No files found.
app/assets/javascripts/milestone_select.js.coffee
View file @
8d7e0f0b
...
@@ -25,12 +25,12 @@ class @MilestoneSelect
...
@@ -25,12 +25,12 @@ class @MilestoneSelect
if
showNo
if
showNo
data
.
unshift
(
data
.
unshift
(
id
:
"0"
id
:
"0"
title
:
'No
m
ilestone'
title
:
'No
M
ilestone'
)
)
if
showAny
if
showAny
data
.
unshift
(
data
.
unshift
(
title
:
'Any
m
ilestone'
title
:
'Any
M
ilestone'
)
)
if
data
.
length
>
2
if
data
.
length
>
2
...
...
app/assets/stylesheets/framework/filters.scss
View file @
8d7e0f0b
.filter-item
{
.filter-item
{
margin-right
:
6px
;
margin-right
:
6px
;
vertical-align
:
top
;
}
}
@media
(
min-width
:
800px
)
{
@media
(
min-width
:
800px
)
{
...
...
app/views/shared/issuable/_filter.html.haml
View file @
8d7e0f0b
...
@@ -9,20 +9,21 @@
...
@@ -9,20 +9,21 @@
.filter-item.inline
.filter-item.inline
-
if
params
[
:author_id
]
-
if
params
[
:author_id
]
=
hidden_field_tag
(
:author_id
,
params
[
:author_id
])
=
hidden_field_tag
(
:author_id
,
params
[
:author_id
])
=
dropdown_tag
(
"Author"
,
options:
{
toggle_class:
"js-user-search js-filter-submit
"
,
title:
"Filter by author"
,
filter:
true
,
dropdown_class:
"dropdown-menu-user dropdown-menu-selectable
"
,
=
dropdown_tag
(
"Author"
,
options:
{
toggle_class:
"js-user-search js-filter-submit
js-author-search"
,
title:
"Filter by author"
,
filter:
true
,
dropdown_class:
"dropdown-menu-user dropdown-menu-selectable dropdown-menu-author
"
,
placeholder:
"Search authors"
,
data:
{
any_user:
"Any Author"
,
first_user:
true
,
current_user:
true
,
project_id:
@project
.
id
,
selected:
params
[
:author_id
],
field_name:
"author_id"
}
})
placeholder:
"Search authors"
,
data:
{
any_user:
"Any Author"
,
first_user:
(
current_user
.
username
if
current_user
),
current_user:
true
,
project_id:
(
@project
.
id
if
@project
)
,
selected:
params
[
:author_id
],
field_name:
"author_id"
}
})
.filter-item.inline
.filter-item.inline
-
if
params
[
:assignee_id
]
-
if
params
[
:assignee_id
]
=
hidden_field_tag
(
:assignee_id
,
params
[
:assignee_id
])
=
hidden_field_tag
(
:assignee_id
,
params
[
:assignee_id
])
=
dropdown_tag
(
"Assignee"
,
options:
{
toggle_class:
"js-user-search js-filter-submit"
,
title:
"Filter by assignee"
,
filter:
true
,
dropdown_class:
"dropdown-menu-user dropdown-menu-selectable"
,
=
dropdown_tag
(
"Assignee"
,
options:
{
toggle_class:
"js-user-search js-filter-submit"
,
title:
"Filter by assignee"
,
filter:
true
,
dropdown_class:
"dropdown-menu-user dropdown-menu-selectable"
,
placeholder:
"Search assignee"
,
data:
{
any_user:
"Any Author"
,
first_user:
true
,
null_user:
true
,
current_user:
true
,
project_id:
@project
.
id
,
selected:
params
[
:assignee_id
],
field_name:
"assignee_id"
}
})
placeholder:
"Search assignee"
,
data:
{
any_user:
"Any Author"
,
first_user:
(
current_user
.
username
if
current_user
),
null_user:
true
,
current_user:
true
,
project_id:
(
@project
.
id
if
@project
)
,
selected:
params
[
:assignee_id
],
field_name:
"assignee_id"
}
})
.filter-item.inline.milestone-filter
.filter-item.inline.milestone-filter
-
if
params
[
:milestone_title
]
-
if
params
[
:milestone_title
]
=
hidden_field_tag
(
:milestone_title
,
params
[
:milestone_title
])
=
hidden_field_tag
(
:milestone_title
,
params
[
:milestone_title
])
=
dropdown_tag
(
"Milestone"
,
options:
{
title:
"Filter by milestone"
,
toggle_class:
'js-milestone-select js-filter-submit'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
=
dropdown_tag
(
"Milestone"
,
options:
{
title:
"Filter by milestone"
,
toggle_class:
'js-milestone-select js-filter-submit'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
placeholder:
"Search milestones"
,
footer_content:
true
,
data:
{
show_no:
true
,
show_any:
true
,
field_name:
"milestone_title"
,
selected:
params
[
:milestone_title
],
project_id:
@project
.
id
,
milestones:
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:js
)
}
})
do
placeholder:
"Search milestones"
,
footer_content:
true
,
data:
{
show_no:
true
,
show_any:
true
,
field_name:
"milestone_title"
,
selected:
params
[
:milestone_title
],
project_id:
(
@project
.
id
if
@project
),
milestones:
(
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:js
)
if
@project
)
}
})
do
-
if
@project
%ul
.dropdown-footer-list
%ul
.dropdown-footer-list
-
if
can?
current_user
,
:admin_milestone
,
@project
-
if
can?
current_user
,
:admin_milestone
,
@project
%li
%li
...
@@ -39,7 +40,7 @@
...
@@ -39,7 +40,7 @@
-
if
params
[
:label_name
]
-
if
params
[
:label_name
]
=
hidden_field_tag
(
:label_name
,
params
[
:label_name
])
=
hidden_field_tag
(
:label_name
,
params
[
:label_name
])
.dropdown
.dropdown
%button
.dropdown-menu-toggle.js-label-select.js-filter-submit
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
field_name:
"label_name"
,
show_no:
"true"
,
show_any:
"true"
,
selected:
params
[
:label_name
],
project_id:
@project
.
id
,
labels:
namespace_project_labels_path
(
@project
.
namespace
,
@project
,
:js
)}}
%button
.dropdown-menu-toggle.js-label-select.js-filter-submit
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
field_name:
"label_name"
,
show_no:
"true"
,
show_any:
"true"
,
selected:
params
[
:label_name
],
project_id:
(
@project
.
id
if
@project
),
labels:
(
namespace_project_labels_path
(
@project
.
namespace
,
@project
,
:js
)
if
@project
)}}
%span
.dropdown-toggle-text
%span
.dropdown-toggle-text
Label
Label
=
icon
(
'chevron-down'
)
=
icon
(
'chevron-down'
)
...
@@ -48,6 +49,7 @@
...
@@ -48,6 +49,7 @@
=
dropdown_title
(
"Filter by label"
)
=
dropdown_title
(
"Filter by label"
)
=
dropdown_filter
(
"Search labels"
)
=
dropdown_filter
(
"Search labels"
)
=
dropdown_content
=
dropdown_content
-
if
@project
=
dropdown_footer
do
=
dropdown_footer
do
%ul
.dropdown-footer-list
%ul
.dropdown-footer-list
-
if
can?
current_user
,
:admin_label
,
@project
-
if
can?
current_user
,
:admin_label
,
@project
...
@@ -92,7 +94,7 @@
...
@@ -92,7 +94,7 @@
%a
{
href:
"#"
,
data:
{
id:
"close"
}}
Closed
%a
{
href:
"#"
,
data:
{
id:
"close"
}}
Closed
.filter-item.inline
.filter-item.inline
=
dropdown_tag
(
"Assignee"
,
options:
{
toggle_class:
"js-user-search"
,
title:
"Assign to"
,
filter:
true
,
dropdown_class:
"dropdown-menu-user dropdown-menu-selectable"
,
=
dropdown_tag
(
"Assignee"
,
options:
{
toggle_class:
"js-user-search"
,
title:
"Assign to"
,
filter:
true
,
dropdown_class:
"dropdown-menu-user dropdown-menu-selectable"
,
placeholder:
"Search authors"
,
data:
{
first_user:
true
,
current_user:
true
,
project_id:
@project
.
id
,
field_name:
"update[assignee_id]"
}
})
placeholder:
"Search authors"
,
data:
{
first_user:
(
current_user
.
username
if
current_user
)
,
current_user:
true
,
project_id:
@project
.
id
,
field_name:
"update[assignee_id]"
}
})
.filter-item.inline
.filter-item.inline
=
dropdown_tag
(
"Milestone"
,
options:
{
title:
"Assign milestone"
,
toggle_class:
'js-milestone-select'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
=
dropdown_tag
(
"Milestone"
,
options:
{
title:
"Assign milestone"
,
toggle_class:
'js-milestone-select'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
placeholder:
"Search milestones"
,
data:
{
show_no:
true
,
field_name:
"update[milestone_id]"
,
project_id:
@project
.
id
,
milestones:
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:js
),
use_id:
true
}
})
placeholder:
"Search milestones"
,
data:
{
show_no:
true
,
field_name:
"update[milestone_id]"
,
project_id:
@project
.
id
,
milestones:
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:js
),
use_id:
true
}
})
...
...
features/steps/dashboard/issues.rb
View file @
8d7e0f0b
...
@@ -36,13 +36,22 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
...
@@ -36,13 +36,22 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
end
end
step
'I click "Authored by me" link'
do
step
'I click "Authored by me" link'
do
select2
(
current_user
.
id
,
from:
"#author_id"
)
execute_script
(
'$("#assignee_id").val("")'
)
select2
(
nil
,
from:
"#assignee_id"
)
execute_script
(
'$(".js-user-search").first().click()'
)
sleep
1
execute_script
(
"$('.dropdown-content li:contains(
\"
#{
current_user
.
to_reference
}
\"
) a').click()"
)
sleep
1
end
end
step
'I click "All" link'
do
step
'I click "All" link'
do
select2
(
nil
,
from:
"#author_id"
)
execute_script
(
'$(".js-user-search").first().click()'
)
select2
(
nil
,
from:
"#assignee_id"
)
sleep
1
execute_script
(
'$(".js-user-search").first().parent().find("li a").first().click()'
)
sleep
1
execute_script
(
'$(".js-user-search").eq(1).click()'
)
sleep
1
execute_script
(
'$(".js-user-search").eq(1).parent().find("li a").first().click()'
)
sleep
1
end
end
def
should_see
(
issue
)
def
should_see
(
issue
)
...
...
features/steps/dashboard/merge_requests.rb
View file @
8d7e0f0b
...
@@ -40,13 +40,22 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
...
@@ -40,13 +40,22 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
end
end
step
'I click "Authored by me" link'
do
step
'I click "Authored by me" link'
do
select2
(
current_user
.
id
,
from:
"#author_id"
)
execute_script
(
'$("#assignee_id").val("")'
)
select2
(
nil
,
from:
"#assignee_id"
)
execute_script
(
'$(".js-user-search").first().click()'
)
sleep
0.5
execute_script
(
"$('.dropdown-content li:contains(
\"
#{
current_user
.
to_reference
}
\"
) a').click()"
)
sleep
2
end
end
step
'I click "All" link'
do
step
'I click "All" link'
do
select2
(
nil
,
from:
"#author_id"
)
execute_script
(
'$(".js-user-search").first().click()'
)
select2
(
nil
,
from:
"#assignee_id"
)
sleep
0.5
execute_script
(
'$(".js-user-search").first().parent().find("li a").first().click()'
)
sleep
2
execute_script
(
'$(".js-user-search").eq(1).click()'
)
sleep
0.5
execute_script
(
'$(".js-user-search").eq(1).parent().find("li a").first().click()'
)
sleep
2
end
end
def
should_see
(
merge_request
)
def
should_see
(
merge_request
)
...
...
features/steps/project/issues/filter_labels.rb
View file @
8d7e0f0b
...
@@ -29,7 +29,10 @@ class Spinach::Features::ProjectIssuesFilterLabels < Spinach::FeatureSteps
...
@@ -29,7 +29,10 @@ class Spinach::Features::ProjectIssuesFilterLabels < Spinach::FeatureSteps
end
end
step
'I click link "bug"'
do
step
'I click link "bug"'
do
select2
(
'bug'
,
from:
"#label_name"
)
page
.
find
(
'.js-label-select'
).
click
sleep
0.5
execute_script
(
"$('.dropdown-menu-labels li:contains(
\"
bug
\"
) a').click()"
)
sleep
2
end
end
step
'I click link "feature"'
do
step
'I click link "feature"'
do
...
...
features/steps/project/issues/issues.rb
View file @
8d7e0f0b
...
@@ -27,7 +27,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -27,7 +27,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
end
step
'I click link "Closed"'
do
step
'I click link "Closed"'
do
click_link
"Closed"
find
(
'.issues-state-filters a'
,
text:
"Closed"
).
click
end
end
step
'I click button "Unsubscribe"'
do
step
'I click button "Unsubscribe"'
do
...
@@ -63,14 +63,15 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -63,14 +63,15 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
end
step
'I click "author" dropdown'
do
step
'I click "author" dropdown'
do
first
(
'#s2id_author_id'
).
click
page
.
find
(
'.js-author-search'
).
click
sleep
1
end
end
step
'I see current user as the first user'
do
step
'I see current user as the first user'
do
expect
(
page
).
to
have_selector
(
'.
user-result'
,
visible:
true
,
count:
3
)
expect
(
page
).
to
have_selector
(
'.
dropdown-content'
,
visible:
true
)
users
=
page
.
all
(
'.
user-name
'
)
users
=
page
.
all
(
'.
dropdown-menu-author .dropdown-content li a
'
)
expect
(
users
[
0
].
text
).
to
eq
'Any Author'
expect
(
users
[
0
].
text
).
to
eq
'Any Author'
expect
(
users
[
1
].
text
).
to
eq
current_user
.
name
expect
(
users
[
1
].
text
).
to
eq
"
#{
current_user
.
name
}
#{
current_user
.
to_reference
}
"
end
end
step
'I submit new issue "500 error on profile"'
do
step
'I submit new issue "500 error on profile"'
do
...
...
spec/features/issues/filter_by_milestone_spec.rb
View file @
8d7e0f0b
...
@@ -31,6 +31,9 @@ feature 'Issue filtering by Milestone', feature: true do
...
@@ -31,6 +31,9 @@ feature 'Issue filtering by Milestone', feature: true do
end
end
def
filter_by_milestone
(
title
)
def
filter_by_milestone
(
title
)
select2
(
title
,
from:
'#milestone_title'
)
find
(
".js-milestone-select"
).
click
sleep
1
find
(
".milestone-filter a"
,
text:
title
).
click
sleep
1
end
end
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