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
989d4535
Commit
989d4535
authored
Feb 15, 2018
by
Clement Ho
Committed by
Jacob Schatz
Feb 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace $.ajax with axios in members.js
parent
da96cfad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
26 deletions
+28
-26
app/assets/javascripts/members.js
app/assets/javascripts/members.js
+28
-26
No files found.
app/assets/javascripts/members.js
View file @
989d4535
import
Flash
from
'
./flash
'
;
import
{
__
}
from
'
./locale
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
export
default
class
Members
{
constructor
()
{
...
...
@@ -50,10 +52,11 @@ export default class Members {
$toggle
.
disable
();
$dateInput
.
disable
();
this
.
overrideLdap
(
$memberListItem
,
$link
.
data
(
'
endpoint
'
),
false
).
fail
(()
=>
{
$toggle
.
enable
();
$dateInput
.
enable
();
});
this
.
overrideLdap
(
$memberListItem
,
$link
.
data
(
'
endpoint
'
),
false
)
.
catch
(()
=>
{
$toggle
.
enable
();
$dateInput
.
enable
();
});
}
},
});
...
...
@@ -101,32 +104,31 @@ export default class Members {
$btn
.
disable
();
// eslint-disable-next-line promise/catch-or-return
this
.
overrideLdap
(
$memberListItem
,
$btn
.
data
(
'
endpoint
'
),
true
).
then
(()
=>
{
this
.
showLDAPPermissionsWarning
(
e
);
$toggle
.
enable
();
$dateInput
.
enable
();
}).
fail
((
xhr
)
=>
{
$btn
.
enable
();
if
(
xhr
.
status
===
403
)
{
Flash
(
'
You do not have the correct permissions to override the settings from the LDAP group sync.
'
,
'
alert
'
);
}
else
{
Flash
(
'
An error occured whilst saving LDAP override status. Please try again.
'
,
'
alert
'
);
}
});
this
.
overrideLdap
(
$memberListItem
,
$btn
.
data
(
'
endpoint
'
),
true
)
.
then
(()
=>
{
this
.
showLDAPPermissionsWarning
(
e
);
$toggle
.
enable
();
$dateInput
.
enable
();
})
.
catch
((
xhr
)
=>
{
$btn
.
enable
();
if
(
xhr
.
status
===
403
)
{
Flash
(
__
(
'
You do not have the correct permissions to override the settings from the LDAP group sync.
'
));
}
else
{
Flash
(
__
(
'
An error occurred while saving LDAP override status. Please try again.
'
));
}
});
}
// eslint-disable-next-line class-methods-use-this
overrideLdap
(
$memberListitem
,
endpoint
,
override
)
{
return
$
.
ajax
({
url
:
endpoint
,
type
:
'
PATCH
'
,
data
:
{
group_member
:
{
override
,
},
return
axios
.
patch
(
endpoint
,
{
group_member
:
{
override
,
},
}).
then
(()
=>
{
})
.
then
(()
=>
{
$memberListitem
.
toggleClass
(
'
is-overriden
'
,
override
);
});
}
...
...
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