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
7311b53a
Commit
7311b53a
authored
Mar 29, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Multiple Issue Assignee] Fix issue filters
parent
985f8b1a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
10 deletions
+24
-10
app/controllers/concerns/issuable_collections.rb
app/controllers/concerns/issuable_collections.rb
+1
-1
app/finders/issues_finder.rb
app/finders/issues_finder.rb
+17
-3
app/views/shared/issuable/form/_metadata.html.haml
app/views/shared/issuable/form/_metadata.html.haml
+6
-6
No files found.
app/controllers/concerns/issuable_collections.rb
View file @
7311b53a
...
...
@@ -40,7 +40,7 @@ module IssuableCollections
end
def
issues_collection
issues_finder
.
execute
.
preload
(
:project
,
:author
,
:
assignees
,
:
labels
,
:milestone
,
project: :namespace
)
issues_finder
.
execute
.
preload
(
:project
,
:author
,
:labels
,
:milestone
,
project: :namespace
)
end
def
merge_requests_collection
...
...
app/finders/issues_finder.rb
View file @
7311b53a
...
...
@@ -26,12 +26,26 @@ class IssuesFinder < IssuableFinder
IssuesFinder
.
not_restricted_by_confidentiality
(
current_user
)
end
def
by_assignee
(
items
)
if
assignee
items
=
items
.
where
(
"issue_assignees.user_id = ?"
,
assignee
.
id
)
elsif
no_assignee?
items
=
items
.
where
(
"issue_assignees.user_id is NULL"
)
elsif
assignee_id?
||
assignee_username?
# assignee not found
items
=
items
.
none
end
items
end
def
self
.
not_restricted_by_confidentiality
(
user
)
return
Issue
.
where
(
'issues.confidential IS NULL OR issues.confidential IS FALSE'
)
if
user
.
blank?
issues
=
Issue
.
with_assignees
return
issues
.
where
(
'issues.confidential IS NULL OR issues.confidential IS FALSE'
)
if
user
.
blank?
return
Issue
.
all
if
user
.
admin_or_auditor?
return
issues
.
all
if
user
.
admin_or_auditor?
Issue
.
with_assigne
es
.
where
(
'
issu
es
.
where
(
'
issues.confidential IS NULL
OR issues.confidential IS FALSE
OR (issues.confidential = TRUE
...
...
app/views/shared/issuable/form/_metadata.html.haml
View file @
7311b53a
...
...
@@ -12,13 +12,13 @@
.form-group.issue-assignee
-
if
issuable
.
is_a?
(
Issue
)
=
form
.
label
:assignee_ids
,
"Assignee"
,
class:
"control-label
#{
"col-lg-4"
if
has_due_date
}
"
.col-sm-10
{
class:
(
"col-lg-8"
if
has_due_date
)
}
.issuable-form-select-holder
=
form
.
hidden_field
:assignee_ids
.col-sm-10
{
class:
(
"col-lg-8"
if
has_due_date
)
}
.issuable-form-select-holder
=
form
.
hidden_field
:assignee_ids
=
dropdown_tag
(
user_dropdown_label
(
issuable
.
assignee_ids
,
"Assignee"
),
options:
{
toggle_class:
"js-dropdown-keep-input js-user-search js-issuable-form-dropdown js-assignee-search"
,
title:
"Select assignee"
,
filter:
true
,
dropdown_class:
"dropdown-menu-user dropdown-menu-selectable dropdown-menu-assignee js-filter-submit"
,
placeholder:
"Search assignee"
,
data:
{
first_user:
current_user
.
try
(
:username
),
null_user:
true
,
current_user:
true
,
project_id:
issuable
.
project
.
try
(
:id
),
selected:
issuable
.
assignee_ids
,
field_name:
"
#{
issuable
.
class
.
model_name
.
param_key
}
[assignee_ids]"
,
default_label:
"Assignee"
}
})
=
link_to
'Assign to me'
,
'#'
,
class:
"assign-to-me-link
#{
'hide'
if
issuable
.
assignee_ids
.
split
(
', '
).
include?
(
current_user
.
id
)
}
"
=
dropdown_tag
(
user_dropdown_label
(
issuable
.
assignee_ids
,
"Assignee"
),
options:
{
toggle_class:
"js-dropdown-keep-input js-user-search js-issuable-form-dropdown js-assignee-search"
,
title:
"Select assignee"
,
filter:
true
,
dropdown_class:
"dropdown-menu-user dropdown-menu-selectable dropdown-menu-assignee js-filter-submit"
,
placeholder:
"Search assignee"
,
data:
{
first_user:
current_user
.
try
(
:username
),
null_user:
true
,
current_user:
true
,
project_id:
issuable
.
project
.
try
(
:id
),
selected:
issuable
.
assignee_ids
,
field_name:
"
#{
issuable
.
class
.
model_name
.
param_key
}
[assignee_ids]"
,
default_label:
"Assignee"
}
})
=
link_to
'Assign to me'
,
'#'
,
class:
"assign-to-me-link
#{
'hide'
if
issuable
.
assignee_ids
.
split
(
', '
).
include?
(
current_user
.
id
)
}
"
-
else
=
form
.
label
:assignee_id
,
"Assignee"
,
class:
"control-label
#{
"col-lg-4"
if
has_due_date
}
"
.col-sm-10
{
class:
(
"col-lg-8"
if
has_due_date
)
}
...
...
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