mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
add logging and responsive user navigation
This commit is contained in:
parent
343ebcf741
commit
13e151e83b
@ -52,7 +52,7 @@
|
||||
</script>
|
||||
|
||||
<!-- Logging for sentry -->
|
||||
<!-- <script src="//cdn.ravenjs.com/1.1.19/raven.min.js"></script> -->
|
||||
<script src="//cdn.ravenjs.com/1.1.19/raven.min.js"></script>
|
||||
|
||||
<!-- Intercom library -->
|
||||
<script>
|
||||
|
@ -19,6 +19,7 @@ class UserActions {
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
this.actions.updateCurrentUser({});
|
||||
});
|
||||
}
|
||||
logoutCurrentUser() {
|
||||
|
@ -28,17 +28,16 @@ requests.defaults({
|
||||
},
|
||||
fatalErrorHandler: (err) => {
|
||||
console.log(err);
|
||||
//alert('Something went wrong, please reload the page');
|
||||
}
|
||||
});
|
||||
|
||||
/* Raven.config('https://0955da3388c64ab29bd32c2a429f9ef4@app.getsentry.com/48351', {
|
||||
Raven.config('https://0955da3388c64ab29bd32c2a429f9ef4@app.getsentry.com/48351', {
|
||||
// pass along the version of your application
|
||||
release: '1.0.0'
|
||||
}).install();
|
||||
|
||||
window.onerror = Raven.process;
|
||||
*/
|
||||
|
||||
class AppGateway {
|
||||
|
||||
start() {
|
||||
|
@ -103,8 +103,10 @@ let AclButton = React.createClass({
|
||||
|
||||
showNotification(response){
|
||||
this.props.handleSuccess();
|
||||
if(response.notification) {
|
||||
let notification = new GlobalNotificationModel(response.notification, 'success');
|
||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||
}
|
||||
},
|
||||
|
||||
// plz move to share form
|
||||
|
@ -312,6 +312,7 @@ var ReactS3FineUploader = React.createClass({
|
||||
},
|
||||
|
||||
onError() {
|
||||
Raven.captureException('react-fineuploader-error');
|
||||
let notification = new GlobalNotificationModel(this.props.defaultErrorMessage, 'danger', 5000);
|
||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||
},
|
||||
|
@ -102,6 +102,10 @@ let Header = React.createClass({
|
||||
activator: '#IntercomDefaultWidget'
|
||||
}
|
||||
});
|
||||
|
||||
Raven.setUserContext({
|
||||
email: this.state.currentUser.email
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -72,7 +72,6 @@ export function getCookie(name) {
|
||||
return parts[i].split('=').pop();
|
||||
}
|
||||
}
|
||||
console.warn('There wasn\'t a cookie with name: ' + name + ' found.');
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -23,6 +23,8 @@ class Requests {
|
||||
unpackResponse(response) {
|
||||
if (response.status >= 500) {
|
||||
throw new ServerError();
|
||||
} else if(response.status === 403) {
|
||||
Raven.captureException('csrftoken error');
|
||||
}
|
||||
return response.text();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user