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
5ea01651
Commit
5ea01651
authored
May 13, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enhancements
parent
2ee779f1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
23 deletions
+25
-23
app/assets/javascripts/flash.js.coffee
app/assets/javascripts/flash.js.coffee
+1
-1
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+6
-8
app/assets/javascripts/issues-bulk-assignment.js.coffee
app/assets/javascripts/issues-bulk-assignment.js.coffee
+6
-7
spec/features/issues/bulk_assigment_labels_spec.rb
spec/features/issues/bulk_assigment_labels_spec.rb
+12
-7
No files found.
app/assets/javascripts/flash.js.coffee
View file @
5ea01651
class
@
Flash
constructor
:
(
message
,
type
)
->
constructor
:
(
message
,
type
=
'alert'
)
->
@
flash
=
$
(
".flash-container"
)
@
flash
.
html
(
""
)
...
...
app/assets/javascripts/gl_dropdown.js.coffee
View file @
5ea01651
...
...
@@ -460,10 +460,10 @@ class GitLabDropdown
el
.
addClass
ACTIVE_CLASS
el
.
removeClass
INDETERMINATE_CLASS
if
!
value
?
if
not
value
?
field
.
remove
()
if
!
field
.
length
and
fieldName
if
not
field
.
length
and
fieldName
@
addInput
(
fieldName
,
value
)
return
selectedObject
...
...
@@ -491,14 +491,12 @@ class GitLabDropdown
addInput
:
(
fieldName
,
value
)
->
# Create hidden input for form
input
=
"<input type='hidden' name='
#{
fieldName
}
' value='
#{
value
}
' />"
$input
=
$
(
"<input type='hidden' name='
#{
fieldName
}
' value='
#{
value
}
' />"
)
if
@
options
.
inputId
?
input
=
$
(
input
)
.
attr
(
'id'
,
@
options
.
inputId
)
@
dropdown
.
before
input
$input
.
attr
(
'id'
,
@
options
.
inputId
)
removeInputs
:
->
@
dropdown
.
parent
().
find
(
'input[type="hidden"]'
).
remove
()
@
dropdown
.
before
$input
selectRowAtIndex
:
(
e
,
index
)
->
selector
=
".dropdown-content li:not(.divider,.dropdown-header,.separator):eq(
#{
index
}
) a"
...
...
app/assets/javascripts/issues-bulk-assignment.js.coffee
View file @
5ea01651
...
...
@@ -32,10 +32,9 @@ class @IssuableBulkActions
location
.
reload
()
xhr
.
fail
->
console
.
error
'fail'
new
Flash
(
"Issue update failed"
)
xhr
.
always
->
_this
.
onFormSubmitAlways
()
xhr
.
always
@
onFormSubmitAlways
.
bind
(
@
)
onFormSubmitAlways
:
->
@
form
.
find
(
'[type="submit"]'
).
enable
()
...
...
@@ -49,7 +48,7 @@ class @IssuableBulkActions
@
getSelectedIssues
().
map
->
_labels
=
$
(
@
).
data
(
'labels'
)
if
_labels
_labels
.
map
(
labelId
)
->
_labels
.
map
(
labelId
)
->
labels
.
push
(
labelId
)
if
labels
.
indexOf
(
labelId
)
is
-
1
labels
...
...
@@ -85,10 +84,10 @@ class @IssuableBulkActions
add_label_ids
:
[]
remove_label_ids
:
[]
for
id
in
@
getLabelsToApply
()
@
getLabelsToApply
().
map
(
id
)
->
formData
.
update
.
add_label_ids
.
push
id
for
id
in
@
getLabelsToRemove
()
@
getLabelsToRemove
().
map
(
id
)
->
formData
.
update
.
remove_label_ids
.
push
id
formData
...
...
@@ -97,7 +96,7 @@ class @IssuableBulkActions
labelIds
=
[]
$labels
=
@
form
.
find
(
'.labels-filter input[name="update[label_ids][]"]'
)
for
label
in
$labels
$labels
.
each
(
k
,
label
)
->
labelIds
.
push
$
(
label
).
val
()
if
label
labelIds
...
...
spec/features/issues/bulk_assigment_labels_spec.rb
View file @
5ea01651
...
...
@@ -27,7 +27,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
before
do
check
'check_all_issues'
open_labels_dropdown
[
'bug'
]
click_button
'Update issues'
update_issues
end
it
do
...
...
@@ -40,7 +40,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
before
do
check
"selected_issue_
#{
issue1
.
id
}
"
open_labels_dropdown
[
'bug'
]
click_button
'Update issues'
update_issues
end
it
do
...
...
@@ -55,7 +55,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
before
do
check
'check_all_issues'
open_labels_dropdown
[
'bug'
,
'feature'
]
click_button
'Update issues'
update_issues
end
it
do
...
...
@@ -70,7 +70,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
before
do
check
"selected_issue_
#{
issue1
.
id
}
"
open_labels_dropdown
[
'bug'
,
'feature'
]
click_button
'Update issues'
update_issues
end
it
do
...
...
@@ -95,7 +95,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
check
'check_all_issues'
unmark_labels_in_dropdown
[
'bug'
,
'feature'
]
click_button
'Update issues'
update_issues
end
it
do
...
...
@@ -115,7 +115,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
check_issue
issue1
unmark_labels_in_dropdown
[
'bug'
]
click_button
'Update issues'
update_issues
end
it
do
...
...
@@ -136,7 +136,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
check_issue
issue1
check_issue
issue2
unmark_labels_in_dropdown
[
'bug'
]
click_button
'Update issues'
update_issues
end
it
do
...
...
@@ -188,4 +188,9 @@ feature 'Issues > Labels bulk assignment', feature: true do
check
"selected_issue_
#{
issue
.
id
}
"
end
end
def
update_issues
click_button
'Update issues'
wait_for_ajax
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