BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
fc53a115
Unverified
Commit
fc53a115
authored
Feb 02, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted users_select to use axios
parent
7c4dfb5a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
20 deletions
+12
-20
users_select.js
app/assets/javascripts/users_select.js
+12
-20
No files found.
app/assets/javascripts/users_select.js
View file @
fc53a115
...
...
@@ -2,6 +2,7 @@
/* global Issuable */
/* global emitSidebarEvent */
import
_
from
'underscore'
;
import
axios
from
'./lib/utils/axios_utils'
;
// TODO: remove eventHub hack after code splitting refactor
window
.
emitSidebarEvent
=
window
.
emitSidebarEvent
||
$
.
noop
;
...
...
@@ -177,12 +178,8 @@ function UsersSelect(currentUser, els, options = {}) {
$loading
.
removeClass
(
'hidden'
).
fadeIn
();
$dropdown
.
trigger
(
'loading.gl.dropdown'
);
return
$
.
ajax
({
type
:
'PUT'
,
dataType
:
'json'
,
url
:
issueURL
,
data
:
data
}).
done
(
function
(
data
)
{
return
axios
.
put
(
issueURL
,
data
)
.
then
(({
data
})
=>
{
var
user
;
$dropdown
.
trigger
(
'loaded.gl.dropdown'
);
$loading
.
fadeOut
();
...
...
@@ -660,22 +657,17 @@ UsersSelect.prototype.user = function(user_id, callback) {
var
url
;
url
=
this
.
buildUrl
(
this
.
userPath
);
url
=
url
.
replace
(
':id'
,
user_id
);
return
$
.
ajax
({
url
:
url
,
dataType
:
"json"
}).
done
(
function
(
user
)
{
return
callback
(
user
);
return
axios
.
get
(
url
)
.
then
(({
data
})
=>
{
callback
(
data
);
});
};
// Return users list. Filtered by query
// Only active users retrieved
UsersSelect
.
prototype
.
users
=
function
(
query
,
options
,
callback
)
{
var
url
;
url
=
this
.
buildUrl
(
this
.
usersPath
);
return
$
.
ajax
({
url
:
url
,
data
:
{
const
url
=
this
.
buildUrl
(
this
.
usersPath
);
const
params
=
{
search
:
query
,
per_page
:
options
.
perPage
||
20
,
active
:
true
,
...
...
@@ -687,10 +679,10 @@ UsersSelect.prototype.users = function(query, options, callback) {
current_user
:
options
.
showCurrentUser
||
null
,
author_id
:
options
.
authorId
||
null
,
skip_users
:
options
.
skipUsers
||
null
},
dataType
:
"json"
}).
done
(
function
(
users
)
{
return
callback
(
users
);
};
return
axios
.
get
(
url
,
{
params
})
.
then
(({
data
})
=>
{
callback
(
data
);
});
};
...
...
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