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
Léo-Paul Géneau
gitlab-ce
Commits
dbb50ed8
Commit
dbb50ed8
authored
May 04, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restrict FE assignees to 1
parent
fc464f1f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
app/assets/javascripts/users_select.js
app/assets/javascripts/users_select.js
+4
-2
app/views/projects/boards/components/sidebar/_assignee.html.haml
...ws/projects/boards/components/sidebar/_assignee.html.haml
+2
-2
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+4
-3
No files found.
app/assets/javascripts/users_select.js
View file @
dbb50ed8
...
...
@@ -388,10 +388,12 @@ import eventHub from './sidebar/event_hub';
page
=
$
(
'
body
'
).
data
(
'
page
'
);
isIssueIndex
=
page
===
'
projects:issues:index
'
;
isMRIndex
=
(
page
===
page
&&
page
===
'
projects:merge_requests:index
'
);
isSelecting
=
(
user
.
id
!==
selectedId
);
selectedId
=
isSelecting
?
user
.
id
:
selectedIdDefault
;
if
(
$dropdown
.
hasClass
(
'
js-filter-bulk-update
'
)
||
$dropdown
.
hasClass
(
'
js-issuable-form-dropdown
'
))
{
e
.
preventDefault
();
let
isSelecting
=
(
user
.
id
!==
selectedId
);
selectedId
=
isSelecting
?
user
.
id
:
selectedIdDefault
;
if
(
selectedId
===
gon
.
current_user_id
)
{
$
(
'
.assign-to-me-link
'
).
hide
();
}
else
{
...
...
app/views/projects/boards/components/sidebar/_assignee.html.haml
View file @
dbb50ed8
...
...
@@ -16,11 +16,11 @@
"v-if"
=>
"issue.assignees"
,
"v-for"
=>
"assignee in issue.assignees"
}
.dropdown
%button
.dropdown-menu-toggle.js-user-search.js-author-search.js-multiselect.js-save-user-data.js-issue-board-sidebar
{
type:
"button"
,
ref:
"assigneeDropdown"
,
data:
{
toggle:
"dropdown"
,
field_name:
"issue[assignee_ids][]"
,
first_user:
(
current_user
.
username
if
current_user
),
current_user:
"true"
,
project_id:
@project
.
id
,
null_user:
"true"
,
multi_select:
"true"
,
dropdown:
{
header:
'Assignee(s)'
}
},
%button
.dropdown-menu-toggle.js-user-search.js-author-search.js-multiselect.js-save-user-data.js-issue-board-sidebar
{
type:
"button"
,
ref:
"assigneeDropdown"
,
data:
{
toggle:
"dropdown"
,
field_name:
"issue[assignee_ids][]"
,
first_user:
(
current_user
.
username
if
current_user
),
current_user:
"true"
,
project_id:
@project
.
id
,
null_user:
"true"
,
multi_select:
"true"
,
'max-select'
=>
1
,
dropdown:
{
header:
'Assignee'
}
},
":data-issuable-id"
=>
"issue.id"
,
":data-selected"
=>
"assigneeId"
,
":data-issue-update"
=>
"'#{namespace_project_issues_path(@project.namespace, @project)}/' + issue.id + '.json'"
}
Select assignee
(s)
Select assignee
=
icon
(
"chevron-down"
)
.dropdown-menu.dropdown-select.dropdown-menu-user.dropdown-menu-selectable.dropdown-menu-author
=
dropdown_title
(
"Assign to"
)
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
dbb50ed8
...
...
@@ -53,17 +53,18 @@
-
issuable
.
assignees
.
each
do
|
assignee
|
=
hidden_field_tag
"
#{
issuable
.
to_ability_name
}
[assignee_ids][]"
,
assignee
.
id
,
id:
nil
-
options
=
{
toggle_class:
'js-user-search js-author-search'
,
title:
'Assign to'
,
filter:
true
,
dropdown_class:
'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author'
,
placeholder:
'Search users'
,
data:
{
first_user:
(
current_user
.
username
if
current_user
),
current_user:
true
,
project_id:
(
@project
.
id
if
@project
),
author_id:
issuable
.
author_id
,
field_name:
"
#{
issuable
.
to_ability_name
}
[assignee_id]"
,
issue_update:
issuable_json_path
(
issuable
),
ability_name:
issuable
.
to_ability_name
,
null_user:
true
}
}
-
options
=
{
toggle_class:
'js-user-search js-author-search'
,
title:
'Assign to'
,
filter:
true
,
dropdown_class:
'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author'
,
placeholder:
'Search users'
,
data:
{
first_user:
(
current_user
.
username
if
current_user
),
current_user:
true
,
project_id:
(
@project
.
id
if
@project
),
author_id:
issuable
.
author_id
,
field_name:
"
#{
issuable
.
to_ability_name
}
[assignee_id
s][
]"
,
issue_update:
issuable_json_path
(
issuable
),
ability_name:
issuable
.
to_ability_name
,
null_user:
true
}
}
-
if
issuable
.
instance_of?
(
Issue
)
-
if
issuable
.
assignees
.
length
==
0
=
hidden_field_tag
"
#{
issuable
.
to_ability_name
}
[assignee_ids][]"
,
0
,
id:
nil
-
title
=
'Select assignee
(s)
'
-
title
=
'Select assignee'
-
options
[
:toggle_class
]
+=
' js-multiselect js-save-user-data'
-
options
[
:data
][
:field_name
]
=
"
#{
issuable
.
to_ability_name
}
[assignee_ids][]"
-
options
[
:data
][
:multi_select
]
=
true
-
options
[
:data
][
'dropdown-title'
]
=
title
-
options
[
:data
][
'dropdown-header'
]
=
'Assignee(s)'
-
options
[
:data
][
'dropdown-header'
]
=
'Assignee'
-
options
[
:data
][
'max-select'
]
=
1
-
else
-
title
=
'Select assignee'
...
...
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