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
0858cb09
Commit
0858cb09
authored
Mar 16, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue with labels dropdown getting wrong labels
parent
9280fd4a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
20 deletions
+17
-20
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+0
-9
app/assets/javascripts/milestone_select.js.coffee
app/assets/javascripts/milestone_select.js.coffee
+0
-9
app/controllers/projects/labels_controller.rb
app/controllers/projects/labels_controller.rb
+7
-0
app/controllers/projects/milestones_controller.rb
app/controllers/projects/milestones_controller.rb
+8
-0
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+2
-2
No files found.
app/assets/javascripts/labels_select.js.coffee
View file @
0858cb09
...
@@ -39,18 +39,9 @@ class @LabelsSelect
...
@@ -39,18 +39,9 @@ class @LabelsSelect
$dropdown
.
glDropdown
(
$dropdown
.
glDropdown
(
data
:
(
term
,
callback
)
->
data
:
(
term
,
callback
)
->
# We have to fetch the JS version of the labels list because there is no
# public facing JSON url for labels
$
.
ajax
(
$
.
ajax
(
url
:
labelUrl
url
:
labelUrl
).
done
(
data
)
->
).
done
(
data
)
->
html
=
$
(
data
)
data
=
[]
html
.
find
(
'.label-row a'
).
each
->
data
.
push
(
title
:
$
(
@
).
text
().
trim
()
)
if
showNo
if
showNo
data
.
unshift
(
data
.
unshift
(
id
:
0
id
:
0
...
...
app/assets/javascripts/milestone_select.js.coffee
View file @
0858cb09
...
@@ -15,15 +15,6 @@ class @MilestoneSelect
...
@@ -15,15 +15,6 @@ class @MilestoneSelect
$
.
ajax
(
$
.
ajax
(
url
:
milestonesUrl
url
:
milestonesUrl
).
done
(
data
)
->
).
done
(
data
)
->
html
=
$
(
data
)
data
=
[]
html
.
find
(
'.milestone strong a'
).
each
->
link
=
$
(
@
).
attr
(
'href'
).
split
(
'/'
)
data
.
push
(
id
:
link
[
link
.
length
-
1
]
title
:
$
(
@
).
text
().
trim
()
)
if
showNo
if
showNo
data
.
unshift
(
data
.
unshift
(
id
:
'0'
id
:
'0'
...
...
app/controllers/projects/labels_controller.rb
View file @
0858cb09
...
@@ -12,6 +12,13 @@ class Projects::LabelsController < Projects::ApplicationController
...
@@ -12,6 +12,13 @@ class Projects::LabelsController < Projects::ApplicationController
def
index
def
index
@labels
=
@project
.
labels
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@labels
=
@project
.
labels
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
respond_to
do
|
format
|
format
.
html
format
.
json
do
render
json:
@labels
.
to_json
end
end
end
end
def
new
def
new
...
...
app/controllers/projects/milestones_controller.rb
View file @
0858cb09
...
@@ -19,7 +19,15 @@ class Projects::MilestonesController < Projects::ApplicationController
...
@@ -19,7 +19,15 @@ class Projects::MilestonesController < Projects::ApplicationController
end
end
@milestones
=
@milestones
.
includes
(
:project
)
@milestones
=
@milestones
.
includes
(
:project
)
@milestones_all
=
@milestones
@milestones
=
@milestones
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@milestones
=
@milestones
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
respond_to
do
|
format
|
format
.
html
format
.
json
do
render
json:
@milestones_all
.
to_json
end
end
end
end
def
new
def
new
...
...
app/views/shared/issuable/_filter.html.haml
View file @
0858cb09
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
-
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_name
]
||
"Milestone"
),
options:
{
title:
"Filter by milestone"
,
toggle_class:
'js-milestone-select js-filter-submit'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
=
dropdown_tag
(
h
(
params
[
:milestone_name
]
||
"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
if
@project
),
milestones:
(
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:js
)
if
@project
)
}
})
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
on
)
if
@project
)
}
})
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
...
@@ -40,7 +40,7 @@
...
@@ -40,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
if
@project
),
labels:
(
namespace_project_labels_path
(
@project
.
namespace
,
@project
,
:js
)
if
@project
)}}
%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
on
)
if
@project
)}}
%span
.dropdown-toggle-text
%span
.dropdown-toggle-text
=
h
(
params
[
:label_name
]
||
"Label"
)
=
h
(
params
[
:label_name
]
||
"Label"
)
=
icon
(
'chevron-down'
)
=
icon
(
'chevron-down'
)
...
...
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