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
4472fd8d
Commit
4472fd8d
authored
Dec 17, 2019
by
leiminghuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
verify using this
parent
bfce0ad8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
564 additions
and
564 deletions
+564
-564
app/assets/javascripts/users_select.js
app/assets/javascripts/users_select.js
+564
-564
No files found.
app/assets/javascripts/users_select.js
View file @
4472fd8d
...
...
@@ -27,9 +27,10 @@ function UsersSelect(currentUser, els, options = {}) {
}
const
{
handleClick
}
=
options
;
const
userSelect
=
this
;
$els
.
each
(
(
i
,
dropdown
)
=>
{
const
_this
=
this
;
const
userSelect
=
this
;
const
options
=
{};
const
$dropdown
=
$
(
dropdown
);
options
.
projectId
=
$dropdown
.
data
(
'
projectId
'
);
...
...
@@ -74,7 +75,7 @@ function UsersSelect(currentUser, els, options = {}) {
// Save current selected user to the DOM
const
currentUserInfo
=
$dropdown
.
data
(
'
currentUserInfo
'
)
||
{};
const
currentUser
=
_this
.
currentUser
||
{};
const
currentUser
=
userSelect
.
currentUser
||
{};
const
fieldName
=
$dropdown
.
data
(
'
fieldName
'
);
const
userName
=
currentUserInfo
.
name
;
const
userId
=
currentUserInfo
.
id
||
currentUser
.
id
;
...
...
@@ -180,7 +181,7 @@ function UsersSelect(currentUser, els, options = {}) {
$block
.
on
(
'
click
'
,
'
.js-assign-yourself
'
,
e
=>
{
e
.
preventDefault
();
return
assignTo
(
_this
.
currentUser
.
id
);
return
assignTo
(
userSelect
.
currentUser
.
id
);
});
assignTo
=
function
(
selected
)
{
...
...
@@ -228,7 +229,7 @@ function UsersSelect(currentUser, els, options = {}) {
return
$dropdown
.
glDropdown
({
showMenuAbove
,
data
(
term
,
callback
)
{
return
_this
.
users
(
term
,
options
,
users
=>
{
return
userSelect
.
users
(
term
,
options
,
users
=>
{
// GitLabDropdownFilter returns this.instance
// GitLabDropdownRemote returns this.options.instance
const
glDropdown
=
this
.
instance
||
this
.
options
.
instance
;
...
...
@@ -550,7 +551,7 @@ function UsersSelect(currentUser, els, options = {}) {
img
=
`<img src='
${
avatar
}
' class='avatar avatar-inline m-0' width='32' />`
;
}
return
_this
.
renderRow
(
options
.
issuableType
,
user
,
selected
,
username
,
img
);
return
userSelect
.
renderRow
(
options
.
issuableType
,
user
,
selected
,
username
,
img
);
},
});
});
...
...
@@ -558,7 +559,6 @@ function UsersSelect(currentUser, els, options = {}) {
.
then
(()
=>
{
$
(
'
.ajax-users-select
'
).
each
(
(
i
,
select
)
=>
{
const
_this
=
this
;
const
options
=
{};
options
.
skipLdap
=
$
(
select
).
hasClass
(
'
skip_ldap
'
);
options
.
projectId
=
$
(
select
).
data
(
'
projectId
'
);
...
...
@@ -575,7 +575,7 @@ function UsersSelect(currentUser, els, options = {}) {
multiple
:
$
(
select
).
hasClass
(
'
multiselect
'
),
minimumInputLength
:
0
,
query
(
query
)
{
return
_this
.
users
(
query
.
term
,
options
,
users
=>
{
return
userSelect
.
users
(
query
.
term
,
options
,
users
=>
{
let
name
;
const
data
=
{
results
:
users
,
...
...
@@ -632,15 +632,15 @@ function UsersSelect(currentUser, els, options = {}) {
},
initSelection
()
{
const
args
=
1
<=
arguments
.
length
?
[].
slice
.
call
(
arguments
,
0
)
:
[];
return
_this
.
initSelection
.
apply
(
_this
,
args
);
return
userSelect
.
initSelection
.
apply
(
userSelect
,
args
);
},
formatResult
()
{
const
args
=
1
<=
arguments
.
length
?
[].
slice
.
call
(
arguments
,
0
)
:
[];
return
_this
.
formatResult
.
apply
(
_this
,
args
);
return
userSelect
.
formatResult
.
apply
(
userSelect
,
args
);
},
formatSelection
()
{
const
args
=
1
<=
arguments
.
length
?
[].
slice
.
call
(
arguments
,
0
)
:
[];
return
_this
.
formatSelection
.
apply
(
_this
,
args
);
return
userSelect
.
formatSelection
.
apply
(
userSelect
,
args
);
},
dropdownCssClass
:
'
ajax-users-dropdown
'
,
// we do not want to escape markup since we are displaying html in results
...
...
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