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
bf1d0cbe
Commit
bf1d0cbe
authored
Jul 16, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed label dropdown not selecting no labels
parent
0a986081
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+4
-0
app/views/shared/issuable/_form.html.haml
app/views/shared/issuable/_form.html.haml
+3
-1
app/views/shared/issuable/_label_dropdown.html.haml
app/views/shared/issuable/_label_dropdown.html.haml
+3
-2
No files found.
app/assets/javascripts/labels_select.js.coffee
View file @
bf1d0cbe
...
@@ -27,6 +27,10 @@ class @LabelsSelect
...
@@ -27,6 +27,10 @@ class @LabelsSelect
$newLabelCreateButton
=
$
(
'.js-new-label-btn'
)
$newLabelCreateButton
=
$
(
'.js-new-label-btn'
)
selectedLabels
=
[]
selectedLabels
=
[]
$
(
"input[name='
#{
$dropdown
.
data
(
'field-name'
)
}
']"
).
each
->
title
=
$
(
this
).
data
(
'title'
)
selectedLabels
.
push
(
$
(
this
).
data
(
'title'
))
if
title
$newLabelError
.
hide
()
$newLabelError
.
hide
()
$loading
=
$block
.
find
(
'.block-loading'
).
fadeOut
()
$loading
=
$block
.
find
(
'.block-loading'
).
fadeOut
()
...
...
app/views/shared/issuable/_form.html.haml
View file @
bf1d0cbe
...
@@ -66,10 +66,12 @@
...
@@ -66,10 +66,12 @@
-
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
-
label_dropdown_toggle
=
issuable
.
labels
.
map
{
|
label
|
label
.
title
}
-
label_dropdown_toggle
=
issuable
.
labels
.
map
{
|
label
|
label
.
title
}
-
field_name
=
"
#{
issuable
.
class
.
model_name
.
param_key
}
[label_ids][]"
=
f
.
label
:label_ids
,
"Labels"
,
class:
"control-label
#{
"col-lg-4"
if
has_due_date
}
"
=
f
.
label
:label_ids
,
"Labels"
,
class:
"control-label
#{
"col-lg-4"
if
has_due_date
}
"
=
hidden_field_tag
field_name
,
""
.col-sm-10
{
class:
"#{"
col
-
lg
-
8
" if has_due_date} #{'issuable-form-padding-top' if !has_labels}"
}
.col-sm-10
{
class:
"#{"
col
-
lg
-
8
" if has_due_date} #{'issuable-form-padding-top' if !has_labels}"
}
.issuable-form-select-holder
.issuable-form-select-holder
=
render
"shared/issuable/label_dropdown"
,
classes:
[
"js-issuable-form-dropdown"
],
selected:
selected_labels
,
selected_toggle:
label_dropdown_toggle
,
data_options:
{
field_name:
"
#{
issuable
.
class
.
model_name
.
param_key
}
[label_ids][]"
,
show_any:
"false"
}
=
render
"shared/issuable/label_dropdown"
,
classes:
[
"js-issuable-form-dropdown"
],
selected:
selected_labels
,
selected_toggle:
label_dropdown_toggle
,
data_options:
{
field_name:
field_name
,
show_any:
"false"
}
-
if
has_due_date
-
if
has_due_date
.col-lg-6
.col-lg-6
.form-group
.form-group
...
...
app/views/shared/issuable/_label_dropdown.html.haml
View file @
bf1d0cbe
...
@@ -14,11 +14,12 @@
...
@@ -14,11 +14,12 @@
-
if
selected
.
present?
-
if
selected
.
present?
-
if
selected
.
respond_to?
(
'any?'
)
-
if
selected
.
respond_to?
(
'any?'
)
-
selected
=
project
.
labels
.
find
(
selected
)
-
selected
.
each
do
|
label
|
-
selected
.
each
do
|
label
|
=
hidden_field_tag
data_options
[
:field_name
],
label
,
id:
nil
=
hidden_field_tag
data_options
[
:field_name
],
label
.
id
,
id:
nil
,
data:
{
title:
label
.
title
}
.dropdown
.dropdown
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
{
class:
classes
.
join
(
' '
),
type:
"button"
,
data:
dropdown_data
}
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
{
class:
classes
.
join
(
' '
),
type:
"button"
,
data:
dropdown_data
}
%span
.dropdown-toggle-text
{
class:
(
"is-default"
if
selected
_toggle
)
}
%span
.dropdown-toggle-text
{
class:
(
"is-default"
if
selected
.
nil?
)
}
=
h
(
multi_label_name
(
selected_toggle
||
selected
,
"Label"
))
=
h
(
multi_label_name
(
selected_toggle
||
selected
,
"Label"
))
=
icon
(
'chevron-down'
)
=
icon
(
'chevron-down'
)
.dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
.dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
...
...
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