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
118619ea
Commit
118619ea
authored
Feb 09, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert groups_select ajax to use axios
parent
f7c662c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
app/assets/javascripts/groups_select.js
app/assets/javascripts/groups_select.js
+11
-11
No files found.
app/assets/javascripts/groups_select.js
View file @
118619ea
import
axios
from
'
./lib/utils/axios_utils
'
;
import
Api
from
'
./api
'
;
import
Api
from
'
./api
'
;
import
{
normalize
CRLF
Headers
}
from
'
./lib/utils/common_utils
'
;
import
{
normalizeHeaders
}
from
'
./lib/utils/common_utils
'
;
export
default
function
groupsSelect
()
{
export
default
function
groupsSelect
()
{
// Needs to be accessible in rspec
// Needs to be accessible in rspec
...
@@ -17,24 +18,23 @@ export default function groupsSelect() {
...
@@ -17,24 +18,23 @@ export default function groupsSelect() {
dataType
:
'
json
'
,
dataType
:
'
json
'
,
quietMillis
:
250
,
quietMillis
:
250
,
transport
(
params
)
{
transport
(
params
)
{
return
$
.
ajax
(
params
)
axios
[
params
.
type
.
toLowerCase
()](
params
.
url
,
{
.
then
((
data
,
status
,
xhr
)
=>
{
params
:
params
.
data
,
const
results
=
data
||
[];
})
.
then
((
res
)
=>
{
const
headers
=
normalizeCRLFHeaders
(
xhr
.
getAllResponseHeaders
());
const
results
=
res
.
data
||
[];
const
headers
=
normalizeHeaders
(
res
.
headers
);
const
currentPage
=
parseInt
(
headers
[
'
X-PAGE
'
],
10
)
||
0
;
const
currentPage
=
parseInt
(
headers
[
'
X-PAGE
'
],
10
)
||
0
;
const
totalPages
=
parseInt
(
headers
[
'
X-TOTAL-PAGES
'
],
10
)
||
0
;
const
totalPages
=
parseInt
(
headers
[
'
X-TOTAL-PAGES
'
],
10
)
||
0
;
const
more
=
currentPage
<
totalPages
;
const
more
=
currentPage
<
totalPages
;
return
{
params
.
success
(
{
results
,
results
,
pagination
:
{
pagination
:
{
more
,
more
,
},
},
};
});
})
}).
catch
(
params
.
error
);
.
then
(
params
.
success
)
.
fail
(
params
.
error
);
},
},
data
(
search
,
page
)
{
data
(
search
,
page
)
{
return
{
return
{
...
...
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