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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
4fde6b81
Commit
4fde6b81
authored
Mar 14, 2016
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'new-dropdowns' into 'master'
Weight filter uses the new dropdown See merge request !261
parents
f20f7b7b
2f6c4124
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
11 deletions
+28
-11
app/assets/javascripts/weight_select.js.coffee
app/assets/javascripts/weight_select.js.coffee
+12
-0
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+10
-3
features/steps/dashboard/issues.rb
features/steps/dashboard/issues.rb
+4
-5
spec/features/issues/filter_by_weight_spec.rb
spec/features/issues/filter_by_weight_spec.rb
+2
-3
No files found.
app/assets/javascripts/weight_select.js.coffee
0 → 100644
View file @
4fde6b81
class
@
WeightSelect
constructor
:
->
$
(
'.js-weight-select'
).
each
(
i
,
dropdown
)
->
$
(
dropdown
).
glDropdown
(
selectable
:
true
fieldName
:
$
(
dropdown
).
data
(
"field-name"
)
id
:
(
obj
,
el
)
->
$
(
el
).
data
"id"
clicked
:
->
if
$
(
dropdown
).
is
".js-filter-submit"
$
(
dropdown
).
parents
(
'form'
).
submit
()
)
app/views/shared/issuable/_filter.html.haml
View file @
4fde6b81
...
...
@@ -81,9 +81,15 @@
-
if
controller
.
controller_name
==
'issues'
.filter-item.inline.weight-filter
=
select_tag
(
'weight'
,
issues_weight_options
(
edit:
false
),
class:
'select2 trigger-submit'
,
include_blank:
true
,
data:
{
placeholder:
'Weight'
})
-
if
params
[
:weight
]
=
hidden_field_tag
(
:weight
,
params
[
:weight
])
=
dropdown_tag
(
"Weight"
,
options:
{
title:
"Filter by weight"
,
toggle_class:
'js-weight-select js-filter-submit'
,
dropdown_class:
"dropdown-menu-selectable"
,
placeholder:
"Search weight"
,
data:
{
field_name:
"weight"
}
})
do
%ul
-
Issue
.
weight_options
.
each
do
|
weight
|
%li
%a
{
href:
"#"
,
data:
{
id:
weight
},
class:
(
"is-active"
if
params
[
:weight
]
==
weight
.
to_s
)}
=
weight
.pull-right
=
render
'shared/sort_dropdown'
...
...
@@ -118,6 +124,7 @@
new
LabelsSelect
();
new
MilestoneSelect
();
new
IssueStatusSelect
();
new
WeightSelect
();
$
(
'
form.filter-form
'
).
on
(
'
submit
'
,
function
(
event
)
{
event
.
preventDefault
();
Turbolinks
.
visit
(
this
.
action
+
'
&
'
+
$
(
this
).
serialize
());
...
...
features/steps/dashboard/issues.rb
View file @
4fde6b81
...
...
@@ -42,11 +42,10 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
end
step
'I click "All" link'
do
find
(
'.js-author-search'
).
click
find
(
'.dropdown-menu-user-full-name'
,
match: :first
).
click
find
(
'.js-assignee-search'
).
click
find
(
'.dropdown-menu-user-full-name'
,
match: :first
).
click
find
(
".js-author-search"
).
click
find
(
".dropdown-menu-author li a"
,
match: :first
).
click
find
(
".js-assignee-search"
).
click
find
(
".dropdown-menu-assignee li a"
,
match: :first
).
click
end
def
should_see
(
issue
)
...
...
spec/features/issues/filter_by_weight_spec.rb
View file @
4fde6b81
require
'rails_helper'
feature
'Issue filtering by Weight'
,
feature:
true
do
include
Select2Helper
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:weight_num
)
{
random_weight
}
...
...
@@ -45,7 +43,8 @@ feature 'Issue filtering by Weight', feature: true do
end
def
filter_by_weight
(
title
)
select2
(
title
,
from:
'#weight'
)
find
(
'.js-weight-select'
).
click
find
(
'.weight-filter .dropdown-content a'
,
text:
title
,
match: :first
).
click
end
def
random_weight
...
...
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