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
9d96b9eb
Commit
9d96b9eb
authored
Jun 16, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes icon state when selecting issues that have the same labels assigned
parent
84632f0a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+3
-0
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+25
-0
spec/features/issues/bulk_assigment_labels_spec.rb
spec/features/issues/bulk_assigment_labels_spec.rb
+2
-1
No files found.
app/assets/javascripts/gl_dropdown.js.coffee
View file @
9d96b9eb
...
...
@@ -302,6 +302,9 @@ class GitLabDropdown
if
@
options
.
setIndeterminateIds
@
options
.
setIndeterminateIds
.
call
(
@
)
if
@
options
.
setActiveIds
@
options
.
setActiveIds
.
call
(
@
)
# Makes indeterminate items effective
if
@
fullData
and
@
dropdown
.
find
(
'.dropdown-menu-toggle'
).
hasClass
(
'js-filter-bulk-update'
)
@
parseData
@
fullData
...
...
app/assets/javascripts/labels_select.js.coffee
View file @
9d96b9eb
...
...
@@ -210,9 +210,21 @@ class @LabelsSelect
if
$dropdown
.
hasClass
(
'js-filter-bulk-update'
)
indeterminate
=
instance
.
indeterminateIds
active
=
instance
.
activeIds
if
indeterminate
.
indexOf
(
label
.
id
)
isnt
-
1
selectedClass
.
push
'is-indeterminate'
if
active
.
indexOf
(
label
.
id
)
isnt
-
1
# Remove is-indeterminate class if the item will be marked as active
i
=
selectedClass
.
indexOf
'is-indeterminate'
selectedClass
.
splice
i
,
1
unless
i
is
-
1
selectedClass
.
push
'is-active'
# Add input manually
instance
.
addInput
@
fieldName
,
label
.
id
if
$form
.
find
(
"input[type='hidden']
\
[name='
#{
$dropdown
.
data
(
'fieldName'
)
}
']
\
[value='
#{
this
.
id
(
label
)
}
']"
).
length
...
...
@@ -328,6 +340,10 @@ class @LabelsSelect
setIndeterminateIds
:
->
if
@
dropdown
.
find
(
'.dropdown-menu-toggle'
).
hasClass
(
'js-filter-bulk-update'
)
@
indeterminateIds
=
_this
.
getIndeterminateIds
()
setActiveIds
:
->
if
@
dropdown
.
find
(
'.dropdown-menu-toggle'
).
hasClass
(
'js-filter-bulk-update'
)
@
activeIds
=
_this
.
getActiveIds
()
)
@
bindEvents
()
...
...
@@ -352,3 +368,12 @@ class @LabelsSelect
label_ids
.
push
$
(
"#issue_
#{
issue_id
}
"
).
data
(
'labels'
)
_
.
flatten
(
label_ids
)
getActiveIds
:
->
label_ids
=
[]
$
(
'.selected_issue:checked'
).
each
(
i
,
el
)
->
issue_id
=
$
(
el
).
data
(
'id'
)
label_ids
.
push
$
(
"#issue_
#{
issue_id
}
"
).
data
(
'labels'
)
_
.
intersection
.
apply
_
,
label_ids
spec/features/issues/bulk_assigment_labels_spec.rb
View file @
9d96b9eb
...
...
@@ -190,7 +190,8 @@ feature 'Issues > Labels bulk assignment', feature: true do
end
if
unmark
items
.
map
do
|
item
|
click_link
item
# Make sure we are unmarking the item no matter the state it has currently
click_link
item
while
find
(
'a'
,
text:
item
)[
:class
]
==
'label-item'
end
end
end
...
...
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