1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-18 08:46:10 +01:00

add logging and responsive user navigation

This commit is contained in:
Tim Daubenschütz 2015-07-16 19:12:18 +02:00
parent 343ebcf741
commit 13e151e83b
8 changed files with 15 additions and 7 deletions

View File

@ -52,7 +52,7 @@
</script> </script>
<!-- Logging for sentry --> <!-- 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 --> <!-- Intercom library -->
<script> <script>

View File

@ -19,6 +19,7 @@ class UserActions {
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
this.actions.updateCurrentUser({});
}); });
} }
logoutCurrentUser() { logoutCurrentUser() {

View File

@ -28,17 +28,16 @@ requests.defaults({
}, },
fatalErrorHandler: (err) => { fatalErrorHandler: (err) => {
console.log(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 // pass along the version of your application
release: '1.0.0' release: '1.0.0'
}).install(); }).install();
window.onerror = Raven.process; window.onerror = Raven.process;
*/
class AppGateway { class AppGateway {
start() { start() {

View File

@ -103,8 +103,10 @@ let AclButton = React.createClass({
showNotification(response){ showNotification(response){
this.props.handleSuccess(); this.props.handleSuccess();
let notification = new GlobalNotificationModel(response.notification, 'success'); if(response.notification) {
GlobalNotificationActions.appendGlobalNotification(notification); let notification = new GlobalNotificationModel(response.notification, 'success');
GlobalNotificationActions.appendGlobalNotification(notification);
}
}, },
// plz move to share form // plz move to share form

View File

@ -312,6 +312,7 @@ var ReactS3FineUploader = React.createClass({
}, },
onError() { onError() {
Raven.captureException('react-fineuploader-error');
let notification = new GlobalNotificationModel(this.props.defaultErrorMessage, 'danger', 5000); let notification = new GlobalNotificationModel(this.props.defaultErrorMessage, 'danger', 5000);
GlobalNotificationActions.appendGlobalNotification(notification); GlobalNotificationActions.appendGlobalNotification(notification);
}, },

View File

@ -102,6 +102,10 @@ let Header = React.createClass({
activator: '#IntercomDefaultWidget' activator: '#IntercomDefaultWidget'
} }
}); });
Raven.setUserContext({
email: this.state.currentUser.email
});
} }
}, },

View File

@ -72,7 +72,6 @@ export function getCookie(name) {
return parts[i].split('=').pop(); return parts[i].split('=').pop();
} }
} }
console.warn('There wasn\'t a cookie with name: ' + name + ' found.');
} }
/* /*

View File

@ -23,6 +23,8 @@ class Requests {
unpackResponse(response) { unpackResponse(response) {
if (response.status >= 500) { if (response.status >= 500) {
throw new ServerError(); throw new ServerError();
} else if(response.status === 403) {
Raven.captureException('csrftoken error');
} }
return response.text(); return response.text();
} }