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
88024b17
Commit
88024b17
authored
Mar 24, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Standardised the output of the JSON to always include the name
The frontend will then always use the name as the ID - like previous
parent
3aeda8c9
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
13 deletions
+30
-13
milestone_select.js.coffee
app/assets/javascripts/milestone_select.js.coffee
+12
-10
milestones_controller.rb
app/controllers/projects/milestones_controller.rb
+1
-1
issuable_finder.rb
app/finders/issuable_finder.rb
+1
-1
issuables_helper.rb
app/helpers/issuables_helper.rb
+14
-0
global_milestone.rb
app/models/global_milestone.rb
+1
-0
_milestone_dropdown.html.haml
app/views/shared/issuable/_milestone_dropdown.html.haml
+1
-1
No files found.
app/assets/javascripts/milestone_select.js.coffee
View file @
88024b17
...
@@ -50,19 +50,22 @@ class @MilestoneSelect
...
@@ -50,19 +50,22 @@ class @MilestoneSelect
extraOptions
=
[]
extraOptions
=
[]
if
showAny
if
showAny
extraOptions
.
push
(
extraOptions
.
push
(
isAny
:
true
id
:
0
name
:
''
title
:
'Any Milestone'
title
:
'Any Milestone'
)
)
if
showNo
if
showNo
extraOptions
.
push
(
extraOptions
.
push
(
id
:
'0'
id
:
-
1
name
:
'No Milestone'
title
:
'No Milestone'
title
:
'No Milestone'
)
)
if
showUpcoming
if
showUpcoming
extraOptions
.
push
(
extraOptions
.
push
(
id
:
'#upcoming'
id
:
-
2
name
:
'#upcoming'
title
:
'Upcoming'
title
:
'Upcoming'
)
)
>>>>>>>
Updated
to
only
include
upcoming
on
filters
>>>>>>>
Updated
to
only
include
upcoming
on
filters
...
@@ -84,14 +87,11 @@ class @MilestoneSelect
...
@@ -84,14 +87,11 @@ class @MilestoneSelect
milestone
.
title
milestone
.
title
id
:
(
milestone
)
->
id
:
(
milestone
)
->
if
!
useId
if
!
useId
if
!
milestone
.
isAny
?
milestone
.
name
milestone
.
title
else
''
else
else
milestone
.
id
milestone
.
id
isSelected
:
(
milestone
)
->
isSelected
:
(
milestone
)
->
milestone
.
titl
e
is
selectedMilestone
milestone
.
nam
e
is
selectedMilestone
hidden
:
->
hidden
:
->
$selectbox
.
hide
()
$selectbox
.
hide
()
$value
.
show
()
$value
.
show
()
...
@@ -99,8 +99,10 @@ class @MilestoneSelect
...
@@ -99,8 +99,10 @@ class @MilestoneSelect
if
$dropdown
.
hasClass
'js-filter-bulk-update'
if
$dropdown
.
hasClass
'js-filter-bulk-update'
return
return
if
$dropdown
.
hasClass
'js-filter-submit'
if
$dropdown
.
hasClass
(
'js-filter-submit'
)
and
(
isIssueIndex
or
isMRIndex
)
if
selected
.
title
?
if
selected
.
name
?
selectedMilestone
=
selected
.
name
else
if
selected
.
title
?
selectedMilestone
=
selected
.
title
selectedMilestone
=
selected
.
title
$dropdown
.
parents
(
'form'
).
submit
()
$dropdown
.
parents
(
'form'
).
submit
()
else
else
...
...
app/controllers/projects/milestones_controller.rb
View file @
88024b17
...
@@ -24,7 +24,7 @@ class Projects::MilestonesController < Projects::ApplicationController
...
@@ -24,7 +24,7 @@ class Projects::MilestonesController < Projects::ApplicationController
@milestones
=
@milestones
.
page
(
params
[
:page
])
@milestones
=
@milestones
.
page
(
params
[
:page
])
end
end
format
.
json
do
format
.
json
do
render
json:
@milestones
render
json:
@milestones
.
to_json
(
methods: :name
)
end
end
end
end
end
end
...
...
app/finders/issuable_finder.rb
View file @
88024b17
...
@@ -243,7 +243,7 @@ class IssuableFinder
...
@@ -243,7 +243,7 @@ class IssuableFinder
end
end
def
filter_by_upcoming_milestone?
def
filter_by_upcoming_milestone?
params
[
:milestone_title
]
==
'Upcoming'
params
[
:milestone_title
]
==
Milestone
::
Upcoming
.
name
end
end
def
by_milestone
(
items
)
def
by_milestone
(
items
)
...
...
app/helpers/issuables_helper.rb
View file @
88024b17
...
@@ -47,6 +47,20 @@ module IssuablesHelper
...
@@ -47,6 +47,20 @@ module IssuablesHelper
end
end
end
end
def
milestone_dropdown_label
(
milestone_title
,
default_label
)
milestone_title
=
if
milestone_title
==
Milestone
::
Upcoming
.
name
Milestone
::
Upcoming
.
title
else
milestone_title
end
if
!
milestone_title
.
nil?
&&
!
milestone_title
.
empty?
h
(
milestone_title
)
else
default_label
end
end
private
private
def
sidebar_gutter_collapsed?
def
sidebar_gutter_collapsed?
...
...
app/models/global_milestone.rb
View file @
88024b17
...
@@ -14,6 +14,7 @@ class GlobalMilestone
...
@@ -14,6 +14,7 @@ class GlobalMilestone
def
initialize
(
title
,
milestones
)
def
initialize
(
title
,
milestones
)
@title
=
title
@title
=
title
@name
=
title
@milestones
=
milestones
@milestones
=
milestones
end
end
...
...
app/views/shared/issuable/_milestone_dropdown.html.haml
View file @
88024b17
-
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'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
=
dropdown_tag
(
milestone_dropdown_label
(
params
[
:milestone_title
],
"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
,
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
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
...
...
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