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
7f0ccbac
Commit
7f0ccbac
authored
Jul 16, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue with milestone dropdown submitting the form without selected value
parent
a33a67e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
app/assets/javascripts/milestone_select.js.coffee
app/assets/javascripts/milestone_select.js.coffee
+4
-3
app/views/shared/issuable/_form.html.haml
app/views/shared/issuable/_form.html.haml
+1
-1
app/views/shared/issuable/_milestone_dropdown.html.haml
app/views/shared/issuable/_milestone_dropdown.html.haml
+2
-1
No files found.
app/assets/javascripts/milestone_select.js.coffee
View file @
7f0ccbac
...
@@ -79,7 +79,7 @@ class @MilestoneSelect
...
@@ -79,7 +79,7 @@ class @MilestoneSelect
text
:
(
milestone
)
->
text
:
(
milestone
)
->
_
.
escape
(
milestone
.
title
)
_
.
escape
(
milestone
.
title
)
id
:
(
milestone
)
->
id
:
(
milestone
)
->
if
!
useId
if
!
useId
and
not
$dropdown
.
is
(
'.js-issuable-form-dropdown'
)
milestone
.
name
milestone
.
name
else
else
milestone
.
id
milestone
.
id
...
@@ -90,12 +90,13 @@ class @MilestoneSelect
...
@@ -90,12 +90,13 @@ class @MilestoneSelect
# display:block overrides the hide-collapse rule
# display:block overrides the hide-collapse rule
$value
.
css
(
'display'
,
''
)
$value
.
css
(
'display'
,
''
)
clicked
:
(
selected
)
->
clicked
:
(
selected
,
$el
,
e
)
->
page
=
$
(
'body'
).
data
'page'
page
=
$
(
'body'
).
data
'page'
isIssueIndex
=
page
is
'projects:issues:index'
isIssueIndex
=
page
is
'projects:issues:index'
isMRIndex
=
page
is
page
is
'projects:merge_requests:index'
isMRIndex
=
page
is
page
is
'projects:merge_requests:index'
if
$dropdown
.
hasClass
'js-filter-bulk-update'
if
$dropdown
.
hasClass
(
'js-filter-bulk-update'
)
or
$dropdown
.
hasClass
(
'js-issuable-form-dropdown'
)
e
.
preventDefault
()
return
return
if
$dropdown
.
hasClass
(
'js-filter-submit'
)
and
(
isIssueIndex
or
isMRIndex
)
if
$dropdown
.
hasClass
(
'js-filter-submit'
)
and
(
isIssueIndex
or
isMRIndex
)
...
...
app/views/shared/issuable/_form.html.haml
View file @
7f0ccbac
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
=
f
.
label
:milestone_id
,
"Milestone"
,
class:
"control-label
#{
"col-lg-4"
if
has_due_date
}
"
=
f
.
label
:milestone_id
,
"Milestone"
,
class:
"control-label
#{
"col-lg-4"
if
has_due_date
}
"
.col-sm-10
{
class:
(
"col-lg-8"
if
has_due_date
)
}
.col-sm-10
{
class:
(
"col-lg-8"
if
has_due_date
)
}
.issuable-form-select-holder
.issuable-form-select-holder
=
render
"shared/issuable/milestone_dropdown"
,
selected:
issuable
.
milestone_id
,
name:
"
#{
issuable
.
class
.
model_name
.
param_key
}
[milestone_id]"
,
show_any:
false
,
show_upcoming:
false
=
render
"shared/issuable/milestone_dropdown"
,
selected:
issuable
.
milestone_id
,
name:
"
#{
issuable
.
class
.
model_name
.
param_key
}
[milestone_id]"
,
show_any:
false
,
show_upcoming:
false
,
extra_class:
'js-issuable-form-dropdown'
.form-group
.form-group
-
has_labels
=
issuable
.
project
.
labels
.
any?
-
has_labels
=
issuable
.
project
.
labels
.
any?
-
selected_labels
=
issuable
.
label_ids
.
any?
?
issuable
.
label_ids
:
nil
-
selected_labels
=
issuable
.
label_ids
.
any?
?
issuable
.
label_ids
:
nil
...
...
app/views/shared/issuable/_milestone_dropdown.html.haml
View file @
7f0ccbac
-
project
=
@target_project
||
@project
-
project
=
@target_project
||
@project
-
selected_text
=
project
.
milestones
.
find
(
selected
).
try
(
:name
)
-
if
selected
.
present?
-
if
selected
.
present?
=
hidden_field_tag
(
name
,
selected
)
=
hidden_field_tag
(
name
,
selected
)
=
dropdown_tag
(
milestone_dropdown_label
(
selected
),
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
(
selected
_text
),
options:
{
title:
"Filter by milestone"
,
toggle_class:
"js-milestone-select js-filter-submit
#{
extra_class
}
"
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
placeholder:
"Search milestones"
,
footer_content:
project
.
present?
,
data:
{
show_no:
true
,
show_any:
show_any
,
show_upcoming:
show_upcoming
,
field_name:
name
,
selected:
selected
,
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:
show_any
,
show_upcoming:
show_upcoming
,
field_name:
name
,
selected:
selected
,
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