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
e12d754b
Commit
e12d754b
authored
Apr 29, 2017
by
Sam Rose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to select the null user as the default
parent
575d9027
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
app/assets/javascripts/users_select.js
app/assets/javascripts/users_select.js
+4
-2
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+1
-1
No files found.
app/assets/javascripts/users_select.js
View file @
e12d754b
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
$els
.
each
((
function
(
_this
)
{
$els
.
each
((
function
(
_this
)
{
return
function
(
i
,
dropdown
)
{
return
function
(
i
,
dropdown
)
{
var
options
=
{};
var
options
=
{};
var
$block
,
$collapsedSidebar
,
$dropdown
,
$loading
,
$selectbox
,
$value
,
abilityName
,
assignTo
,
assigneeTemplate
,
collapsedAssigneeTemplate
,
defaultLabel
,
firstUser
,
issueURL
,
selectedId
,
showAnyUser
,
showNullUser
,
showMenuAbove
;
var
$block
,
$collapsedSidebar
,
$dropdown
,
$loading
,
$selectbox
,
$value
,
abilityName
,
assignTo
,
assigneeTemplate
,
collapsedAssigneeTemplate
,
defaultLabel
,
defaultNullUser
,
firstUser
,
issueURL
,
selectedId
,
showAnyUser
,
showNullUser
,
showMenuAbove
;
$dropdown
=
$
(
dropdown
);
$dropdown
=
$
(
dropdown
);
options
.
projectId
=
$dropdown
.
data
(
'
project-id
'
);
options
.
projectId
=
$dropdown
.
data
(
'
project-id
'
);
options
.
groupId
=
$dropdown
.
data
(
'
group-id
'
);
options
.
groupId
=
$dropdown
.
data
(
'
group-id
'
);
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
options
.
todoFilter
=
$dropdown
.
data
(
'
todo-filter
'
);
options
.
todoFilter
=
$dropdown
.
data
(
'
todo-filter
'
);
options
.
todoStateFilter
=
$dropdown
.
data
(
'
todo-state-filter
'
);
options
.
todoStateFilter
=
$dropdown
.
data
(
'
todo-state-filter
'
);
showNullUser
=
$dropdown
.
data
(
'
null-user
'
);
showNullUser
=
$dropdown
.
data
(
'
null-user
'
);
defaultNullUser
=
$dropdown
.
data
(
'
null-user-default
'
);
showMenuAbove
=
$dropdown
.
data
(
'
showMenuAbove
'
);
showMenuAbove
=
$dropdown
.
data
(
'
showMenuAbove
'
);
showAnyUser
=
$dropdown
.
data
(
'
any-user
'
);
showAnyUser
=
$dropdown
.
data
(
'
any-user
'
);
firstUser
=
$dropdown
.
data
(
'
first-user
'
);
firstUser
=
$dropdown
.
data
(
'
first-user
'
);
...
@@ -50,7 +51,8 @@
...
@@ -50,7 +51,8 @@
$value
=
$block
.
find
(
'
.value
'
);
$value
=
$block
.
find
(
'
.value
'
);
$collapsedSidebar
=
$block
.
find
(
'
.sidebar-collapsed-user
'
);
$collapsedSidebar
=
$block
.
find
(
'
.sidebar-collapsed-user
'
);
$loading
=
$block
.
find
(
'
.block-loading
'
).
fadeOut
();
$loading
=
$block
.
find
(
'
.block-loading
'
).
fadeOut
();
selectedId
=
$dropdown
.
data
(
'
selected
'
)
||
showNullUser
?
0
:
null
;
selectedId
=
$dropdown
.
data
(
'
selected
'
);
if
(
!
selectedId
)
selectedId
=
(
defaultNullUser
&&
showNullUser
)
?
0
:
null
;
var
updateIssueBoardsIssue
=
function
()
{
var
updateIssueBoardsIssue
=
function
()
{
$loading
.
removeClass
(
'
hidden
'
).
fadeIn
();
$loading
.
removeClass
(
'
hidden
'
).
fadeIn
();
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
e12d754b
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
.selectbox.hide-collapsed
.selectbox.hide-collapsed
=
f
.
hidden_field
'assignee_id'
,
value:
issuable
.
assignee_id
,
id:
'issue_assignee_id'
=
f
.
hidden_field
'assignee_id'
,
value:
issuable
.
assignee_id
,
id:
'issue_assignee_id'
=
dropdown_tag
(
'Select assignee'
,
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
,
selected:
issuable
.
assignee_id
}
})
=
dropdown_tag
(
'Select assignee'
,
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
,
null_user_default:
true
,
selected:
issuable
.
assignee_id
}
})
.block.milestone
.block.milestone
.sidebar-collapsed-icon
.sidebar-collapsed-icon
...
...
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