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
Tatuya Kamada
gitlab-ce
Commits
a6d7c695
Commit
a6d7c695
authored
Mar 24, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated to only include upcoming on filters
Fixes tests
parent
c9dea776
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
app/assets/javascripts/milestone_select.js.coffee
app/assets/javascripts/milestone_select.js.coffee
+22
-1
app/views/shared/issuable/_milestone_dropdown.html.haml
app/views/shared/issuable/_milestone_dropdown.html.haml
+2
-2
No files found.
app/assets/javascripts/milestone_select.js.coffee
View file @
a6d7c695
...
@@ -11,6 +11,7 @@ class @MilestoneSelect
...
@@ -11,6 +11,7 @@ class @MilestoneSelect
selectedMilestone
=
$dropdown
.
data
(
'selected'
)
selectedMilestone
=
$dropdown
.
data
(
'selected'
)
showNo
=
$dropdown
.
data
(
'show-no'
)
showNo
=
$dropdown
.
data
(
'show-no'
)
showAny
=
$dropdown
.
data
(
'show-any'
)
showAny
=
$dropdown
.
data
(
'show-any'
)
showUpcoming
=
$dropdown
.
data
(
'show-upcoming'
)
useId
=
$dropdown
.
data
(
'use-id'
)
useId
=
$dropdown
.
data
(
'use-id'
)
defaultLabel
=
$dropdown
.
data
(
'default-label'
)
defaultLabel
=
$dropdown
.
data
(
'default-label'
)
issuableId
=
$dropdown
.
data
(
'issuable-id'
)
issuableId
=
$dropdown
.
data
(
'issuable-id'
)
...
@@ -34,7 +35,6 @@ class @MilestoneSelect
...
@@ -34,7 +35,6 @@ class @MilestoneSelect
id
:
'0'
id
:
'0'
title
:
'No Milestone'
title
:
'No Milestone'
},
{
},
{
upcoming
:
true
id
:
'#upcoming'
id
:
'#upcoming'
title
:
'Upcoming'
title
:
'Upcoming'
}]
}]
...
@@ -44,6 +44,7 @@ class @MilestoneSelect
...
@@ -44,6 +44,7 @@ class @MilestoneSelect
$
.
ajax
(
$
.
ajax
(
url
:
milestonesUrl
url
:
milestonesUrl
).
done
(
data
)
->
).
done
(
data
)
->
<<<<<<<
c9dea7761dc69ff38d101d06e0e636e1f3b2a0c4
if
$dropdown
.
hasClass
"js-extra-options"
if
$dropdown
.
hasClass
"js-extra-options"
if
showNo
if
showNo
data
.
unshift
(
data
.
unshift
(
...
@@ -56,6 +57,26 @@ class @MilestoneSelect
...
@@ -56,6 +57,26 @@ class @MilestoneSelect
isAny
:
true
isAny
:
true
title
:
'Any Milestone'
title
:
'Any Milestone'
)
)
=======
extraOptions
=
[]
if
showAny
extraOptions
.
push
(
isAny
:
true
title
:
'Any Milestone'
)
if
showNo
extraOptions
.
push
(
id
:
'0'
title
:
'No Milestone'
)
if
showUpcoming
extraOptions
.
push
(
id
:
'#upcoming'
title
:
'Upcoming'
)
>>>>>>>
Updated
to
only
include
upcoming
on
filters
if
data
.
length
>
2
if
data
.
length
>
2
data
.
splice
2
,
0
,
'divider'
data
.
splice
2
,
0
,
'divider'
...
...
app/views/shared/issuable/_milestone_dropdown.html.haml
View file @
a6d7c695
-
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
(
h
(
params
[
:milestone_title
].
presence
||
"Milestone"
),
options:
{
title:
"Filter by milestone"
,
toggle_class:
'js-milestone-select js-filter-submit
js-extra-options
'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
=
dropdown_tag
(
h
(
params
[
:milestone_title
].
presence
||
"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:
@project
.
present?
,
data:
{
show_no:
true
,
show_any:
true
,
field_name:
"milestone_title"
,
selected:
params
[
:milestone_title
],
project_id:
@project
.
try
(
:id
),
milestones:
milestones_filter_dropdown_path
,
default_label:
"Milestone"
}
})
do
placeholder:
"Search milestones"
,
footer_content:
@project
.
present?
,
data:
{
show_no:
true
,
show_any:
true
,
show_upcoming:
true
,
field_name:
"milestone_title"
,
selected:
params
[
:milestone_title
],
project_id:
@project
.
try
(
:id
),
milestones:
milestones_filter_dropdown_path
,
default_label:
"Milestone"
}
})
do
-
if
@project
-
if
@project
%ul
.dropdown-footer-list
%ul
.dropdown-footer-list
-
if
can?
current_user
,
:admin_milestone
,
@project
-
if
can?
current_user
,
:admin_milestone
,
@project
...
...
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