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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
dbccacdb
Commit
dbccacdb
authored
Apr 22, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ability to assign a label to multiple issues
parent
9aca0a1f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
+19
-2
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+4
-0
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+2
-1
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+4
-0
app/views/shared/issuable/_label_dropdown.html.haml
app/views/shared/issuable/_label_dropdown.html.haml
+9
-1
No files found.
app/assets/javascripts/labels_select.js.coffee
View file @
dbccacdb
...
@@ -12,6 +12,7 @@ class @LabelsSelect
...
@@ -12,6 +12,7 @@ class @LabelsSelect
newColorField
=
$
(
'#new_label_color'
)
newColorField
=
$
(
'#new_label_color'
)
showNo
=
$dropdown
.
data
(
'show-no'
)
showNo
=
$dropdown
.
data
(
'show-no'
)
showAny
=
$dropdown
.
data
(
'show-any'
)
showAny
=
$dropdown
.
data
(
'show-any'
)
useId
=
$dropdown
.
data
(
'use-id'
)
defaultLabel
=
$dropdown
.
data
(
'default-label'
)
defaultLabel
=
$dropdown
.
data
(
'default-label'
)
abilityName
=
$dropdown
.
data
(
'ability-name'
)
abilityName
=
$dropdown
.
data
(
'ability-name'
)
$selectbox
=
$dropdown
.
closest
(
'.selectbox'
)
$selectbox
=
$dropdown
.
closest
(
'.selectbox'
)
...
@@ -284,6 +285,9 @@ class @LabelsSelect
...
@@ -284,6 +285,9 @@ class @LabelsSelect
multiSelect
:
$dropdown
.
hasClass
'js-multiselect'
multiSelect
:
$dropdown
.
hasClass
'js-multiselect'
clicked
:
(
label
)
->
clicked
:
(
label
)
->
if
$dropdown
.
hasClass
(
'js-filter-bulk-update'
)
return
page
=
$
(
'body'
).
data
'page'
page
=
$
(
'body'
).
data
'page'
isIssueIndex
=
page
is
'projects:issues:index'
isIssueIndex
=
page
is
'projects:issues:index'
isMRIndex
=
page
is
'projects:merge_requests:index'
isMRIndex
=
page
is
'projects:merge_requests:index'
...
...
app/controllers/projects/issues_controller.rb
View file @
dbccacdb
...
@@ -216,7 +216,8 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -216,7 +216,8 @@ class Projects::IssuesController < Projects::ApplicationController
:issues_ids
,
:issues_ids
,
:assignee_id
,
:assignee_id
,
:milestone_id
,
:milestone_id
,
:state_event
:state_event
,
:label_ids
)
)
end
end
end
end
app/views/shared/issuable/_filter.html.haml
View file @
dbccacdb
...
@@ -44,6 +44,10 @@
...
@@ -44,6 +44,10 @@
placeholder:
"Search authors"
,
data:
{
first_user:
(
current_user
.
username
if
current_user
),
null_user:
true
,
current_user:
true
,
project_id:
@project
.
id
,
field_name:
"update[assignee_id]"
}
})
placeholder:
"Search authors"
,
data:
{
first_user:
(
current_user
.
username
if
current_user
),
null_user:
true
,
current_user:
true
,
project_id:
@project
.
id
,
field_name:
"update[assignee_id]"
}
})
.filter-item.inline
.filter-item.inline
=
dropdown_tag
(
"Milestone"
,
options:
{
title:
"Assign milestone"
,
toggle_class:
'js-milestone-select js-extra-options js-filter-submit js-filter-bulk-update'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable dropdown-menu-milestone"
,
placeholder:
"Search milestones"
,
data:
{
show_no:
true
,
field_name:
"update[milestone_id]"
,
project_id:
@project
.
id
,
milestones:
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:json
),
use_id:
true
}
})
=
dropdown_tag
(
"Milestone"
,
options:
{
title:
"Assign milestone"
,
toggle_class:
'js-milestone-select js-extra-options js-filter-submit js-filter-bulk-update'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable dropdown-menu-milestone"
,
placeholder:
"Search milestones"
,
data:
{
show_no:
true
,
field_name:
"update[milestone_id]"
,
project_id:
@project
.
id
,
milestones:
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:json
),
use_id:
true
}
})
.filter-item.inline.labels-filter
=
render
"shared/issuable/label_dropdown"
,
classes:
' js-filter-bulk-update js-multiselect '
,
extra_options:
false
,
show_footer:
false
,
extra_options:
false
,
data_options:
{
field_name:
"update[label_ids]"
,
show_no:
false
,
show_any:
false
,
use_id:
true
}
=
hidden_field_tag
'update[issues_ids]'
,
[]
=
hidden_field_tag
'update[issues_ids]'
,
[]
=
hidden_field_tag
:state_event
,
params
[
:state_event
]
=
hidden_field_tag
:state_event
,
params
[
:state_event
]
.filter-item.inline
.filter-item.inline
...
...
app/views/shared/issuable/_label_dropdown.html.haml
View file @
dbccacdb
-
extra_options
=
local_assigns
.
fetch
(
:extra_options
,
true
)
-
show_footer
=
local_assigns
.
fetch
(
:show_footer
,
true
)
-
data_options
=
local_assigns
.
fetch
(
:data_options
,
{})
-
classes
=
local_assigns
.
fetch
(
:classes
,
''
)
-
dropdown_data
=
{
toggle:
'dropdown'
,
field_name:
'label_name[]'
,
show_no:
"true"
,
show_any:
"true"
,
selected:
params
[
:label_name
],
project_id:
@project
.
try
(
:id
),
labels:
labels_filter_path
,
default_label:
"Label"
}
-
dropdown_data
.
merge!
(
data_options
)
-
classes
<<
' js-extra-options '
if
extra_options
-
if
params
[
:label_name
].
present?
-
if
params
[
:label_name
].
present?
-
if
params
[
:label_name
].
respond_to?
(
'any?'
)
-
if
params
[
:label_name
].
respond_to?
(
'any?'
)
-
params
[
:label_name
].
each
do
|
label
|
-
params
[
:label_name
].
each
do
|
label
|
=
hidden_field_tag
"label_name[]"
,
label
,
id:
nil
=
hidden_field_tag
"label_name[]"
,
label
,
id:
nil
.dropdown
.dropdown
%button
.dropdown-menu-toggle.js-label-select.js-filter-submit.js-multiselect
.js-extra-options
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
field_name:
"label_name[]"
,
show_no:
"true"
,
show_any:
"true"
,
selected:
params
[
:label_name
],
project_id:
@project
.
try
(
:id
),
labels:
labels_filter_path
,
default_label:
"Label"
}
}
%button
.dropdown-menu-toggle.js-label-select.js-filter-submit.js-multiselect
{
class:
classes
,
type:
"button"
,
data:
dropdown_data
}
%span
.dropdown-toggle-text
%span
.dropdown-toggle-text
=
h
(
multi_label_name
(
params
[
:label_name
],
"Label"
))
=
h
(
multi_label_name
(
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