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
Jérome Perrin
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
Hide 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
class
@
Flash
constructor
:
(
message
,
type
)
->
constructor
:
(
message
,
type
=
'alert'
)
->
@
flash
=
$
(
".flash-container"
)
@
flash
=
$
(
".flash-container"
)
@
flash
.
html
(
""
)
@
flash
.
html
(
""
)
...
...
app/assets/javascripts/gl_dropdown.js.coffee
View file @
5ea01651
...
@@ -460,10 +460,10 @@ class GitLabDropdown
...
@@ -460,10 +460,10 @@ class GitLabDropdown
el
.
addClass
ACTIVE_CLASS
el
.
addClass
ACTIVE_CLASS
el
.
removeClass
INDETERMINATE_CLASS
el
.
removeClass
INDETERMINATE_CLASS
if
!
value
?
if
not
value
?
field
.
remove
()
field
.
remove
()
if
!
field
.
length
and
fieldName
if
not
field
.
length
and
fieldName
@
addInput
(
fieldName
,
value
)
@
addInput
(
fieldName
,
value
)
return
selectedObject
return
selectedObject
...
@@ -491,14 +491,12 @@ class GitLabDropdown
...
@@ -491,14 +491,12 @@ class GitLabDropdown
addInput
:
(
fieldName
,
value
)
->
addInput
:
(
fieldName
,
value
)
->
# Create hidden input for form
# Create hidden input for form
input
=
"<input type='hidden' name='
#{
fieldName
}
' value='
#{
value
}
' />"
$input
=
$
(
"<input type='hidden' name='
#{
fieldName
}
' value='
#{
value
}
' />"
)
if
@
options
.
inputId
?
if
@
options
.
inputId
?
input
=
$
(
input
)
$input
.
attr
(
'id'
,
@
options
.
inputId
)
.
attr
(
'id'
,
@
options
.
inputId
)
@
dropdown
.
before
input
removeInputs
:
->
@
dropdown
.
before
$input
@
dropdown
.
parent
().
find
(
'input[type="hidden"]'
).
remove
()
selectRowAtIndex
:
(
e
,
index
)
->
selectRowAtIndex
:
(
e
,
index
)
->
selector
=
".dropdown-content li:not(.divider,.dropdown-header,.separator):eq(
#{
index
}
) a"
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
...
@@ -32,10 +32,9 @@ class @IssuableBulkActions
location
.
reload
()
location
.
reload
()
xhr
.
fail
->
xhr
.
fail
->
console
.
error
'fail'
new
Flash
(
"Issue update failed"
)
xhr
.
always
->
xhr
.
always
@
onFormSubmitAlways
.
bind
(
@
)
_this
.
onFormSubmitAlways
()
onFormSubmitAlways
:
->
onFormSubmitAlways
:
->
@
form
.
find
(
'[type="submit"]'
).
enable
()
@
form
.
find
(
'[type="submit"]'
).
enable
()
...
@@ -49,7 +48,7 @@ class @IssuableBulkActions
...
@@ -49,7 +48,7 @@ class @IssuableBulkActions
@
getSelectedIssues
().
map
->
@
getSelectedIssues
().
map
->
_labels
=
$
(
@
).
data
(
'labels'
)
_labels
=
$
(
@
).
data
(
'labels'
)
if
_labels
if
_labels
_labels
.
map
(
labelId
)
->
_labels
.
map
(
labelId
)
->
labels
.
push
(
labelId
)
if
labels
.
indexOf
(
labelId
)
is
-
1
labels
.
push
(
labelId
)
if
labels
.
indexOf
(
labelId
)
is
-
1
labels
labels
...
@@ -85,10 +84,10 @@ class @IssuableBulkActions
...
@@ -85,10 +84,10 @@ class @IssuableBulkActions
add_label_ids
:
[]
add_label_ids
:
[]
remove_label_ids
:
[]
remove_label_ids
:
[]
for
id
in
@
getLabelsToApply
()
@
getLabelsToApply
().
map
(
id
)
->
formData
.
update
.
add_label_ids
.
push
id
formData
.
update
.
add_label_ids
.
push
id
for
id
in
@
getLabelsToRemove
()
@
getLabelsToRemove
().
map
(
id
)
->
formData
.
update
.
remove_label_ids
.
push
id
formData
.
update
.
remove_label_ids
.
push
id
formData
formData
...
@@ -97,7 +96,7 @@ class @IssuableBulkActions
...
@@ -97,7 +96,7 @@ class @IssuableBulkActions
labelIds
=
[]
labelIds
=
[]
$labels
=
@
form
.
find
(
'.labels-filter input[name="update[label_ids][]"]'
)
$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
.
push
$
(
label
).
val
()
if
label
labelIds
labelIds
...
...
spec/features/issues/bulk_assigment_labels_spec.rb
View file @
5ea01651
...
@@ -27,7 +27,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
...
@@ -27,7 +27,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
before
do
before
do
check
'check_all_issues'
check
'check_all_issues'
open_labels_dropdown
[
'bug'
]
open_labels_dropdown
[
'bug'
]
click_button
'Update issues'
update_issues
end
end
it
do
it
do
...
@@ -40,7 +40,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
...
@@ -40,7 +40,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
before
do
before
do
check
"selected_issue_
#{
issue1
.
id
}
"
check
"selected_issue_
#{
issue1
.
id
}
"
open_labels_dropdown
[
'bug'
]
open_labels_dropdown
[
'bug'
]
click_button
'Update issues'
update_issues
end
end
it
do
it
do
...
@@ -55,7 +55,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
...
@@ -55,7 +55,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
before
do
before
do
check
'check_all_issues'
check
'check_all_issues'
open_labels_dropdown
[
'bug'
,
'feature'
]
open_labels_dropdown
[
'bug'
,
'feature'
]
click_button
'Update issues'
update_issues
end
end
it
do
it
do
...
@@ -70,7 +70,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
...
@@ -70,7 +70,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
before
do
before
do
check
"selected_issue_
#{
issue1
.
id
}
"
check
"selected_issue_
#{
issue1
.
id
}
"
open_labels_dropdown
[
'bug'
,
'feature'
]
open_labels_dropdown
[
'bug'
,
'feature'
]
click_button
'Update issues'
update_issues
end
end
it
do
it
do
...
@@ -95,7 +95,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
...
@@ -95,7 +95,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
check
'check_all_issues'
check
'check_all_issues'
unmark_labels_in_dropdown
[
'bug'
,
'feature'
]
unmark_labels_in_dropdown
[
'bug'
,
'feature'
]
click_button
'Update issues'
update_issues
end
end
it
do
it
do
...
@@ -115,7 +115,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
...
@@ -115,7 +115,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
check_issue
issue1
check_issue
issue1
unmark_labels_in_dropdown
[
'bug'
]
unmark_labels_in_dropdown
[
'bug'
]
click_button
'Update issues'
update_issues
end
end
it
do
it
do
...
@@ -136,7 +136,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
...
@@ -136,7 +136,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
check_issue
issue1
check_issue
issue1
check_issue
issue2
check_issue
issue2
unmark_labels_in_dropdown
[
'bug'
]
unmark_labels_in_dropdown
[
'bug'
]
click_button
'Update issues'
update_issues
end
end
it
do
it
do
...
@@ -188,4 +188,9 @@ feature 'Issues > Labels bulk assignment', feature: true do
...
@@ -188,4 +188,9 @@ feature 'Issues > Labels bulk assignment', feature: true do
check
"selected_issue_
#{
issue
.
id
}
"
check
"selected_issue_
#{
issue
.
id
}
"
end
end
end
end
def
update_issues
click_button
'Update issues'
wait_for_ajax
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