Commit 04c053e0 authored by Phil Hughes's avatar Phil Hughes

Added error handling

parent 7f9f9711
/* eslint-disable class-methods-use-this */ /* eslint-disable class-methods-use-this */
/* eslint-disable no-new */
/* global Flash */
(() => { (() => {
window.gl = window.gl || {}; window.gl = window.gl || {};
...@@ -50,7 +52,10 @@ ...@@ -50,7 +52,10 @@
$toggle.disable(); $toggle.disable();
$dateInput.disable(); $dateInput.disable();
this.overrideLdap($memberListItem, $link.data('endpoint'), false); this.overrideLdap($memberListItem, $link.data('endpoint'), false).fail(() => {
$toggle.enable();
$dateInput.enable();
});
} }
}, },
}); });
...@@ -111,9 +116,17 @@ ...@@ -111,9 +116,17 @@
this.overrideLdap($memberListItem, $btn.data('endpoint'), true).then(() => { this.overrideLdap($memberListItem, $btn.data('endpoint'), true).then(() => {
this.showLDAPPermissionsWarning(e); this.showLDAPPermissionsWarning(e);
$toggle.enable(); $toggle.enable();
$dateInput.enable(); $dateInput.enable();
}).fail((xhr) => {
$btn.enable(); $btn.enable();
if (xhr.status === 403) {
new Flash('You do not have the correct permissions to override the settings from the LDAP group sync.', 'alert');
} else {
new Flash('An error occured whilst saving LDAP override status. Please try again.', 'alert');
}
}); });
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment