Intro.js Fixes and better client side logging (#11480)

* fix intro.js button and border for username modal

* fix unhandled error and add better logging
This commit is contained in:
Matteo Pagliazzi
2019-10-27 13:11:40 +01:00
committed by GitHub
parent 5dc5b4ac92
commit 57b9dc374a
5 changed files with 36 additions and 3 deletions

View File

@@ -1275,7 +1275,9 @@ export default {
});
this.$root.$emit('bv::hide::modal', 'avatar-modal');
this.$router.push('/');
if (this.$route.path !== '/') {
this.$router.push('/');
}
this.$store.dispatch('user:set', {
'flags.welcomed': true,
});

View File

@@ -48,7 +48,6 @@
margin: 2px;
position: relative;
height: 131px;
min-height: 131px !important;
width: 400px;
max-width: 400px;

View File

@@ -110,7 +110,7 @@
border: solid 1px $gray-500;
}
input {
input.form-control:not(:focus):not(:active) {
border: 0px;
}

View File

@@ -1,4 +1,14 @@
import Vue from 'vue';
export function setUpLogging () { // eslint-disable-line import/prefer-default-export
window.onerror = function windowOnError (message, source, lineno, colno, error) {
console.error('Unhandled error JS code.');
console.error('Message:', message);
console.error('Source:', source);
console.error('Line:', lineno, 'Column:', colno);
console.error('Error;', error);
};
let _LTracker = window._LTracker || []; // eslint-disable-line
_LTracker.push({ // eslint-disable-line
logglyKey: process.env.LOGGLY_CLIENT_TOKEN, // eslint-disable-line no-process-env
@@ -6,4 +16,25 @@ export function setUpLogging () { // eslint-disable-line import/prefer-default-e
tag: 'ClientJS',
json: true,
});
window.onunhandledrejection = event => {
console.error(`Unhandled promise rejection: ${event.reason}`);
console.error('Full info:', event);
_LTracker.push({
event,
});
};
Vue.config.errorHandler = (err, vm, info) => {
console.error('Unhandled error in Vue.js code.');
console.error('Error:', err);
console.error('Component where it occured:', vm);
console.error('Info:', info);
_LTracker.push({
err,
vm,
info,
});
};
}

View File

@@ -180,6 +180,7 @@ export default {
exitOnOverlayClick: false,
steps: opts.steps,
doneLabel: this.$t('letsgo'),
buttonClass: 'btn btn-small btn-primary',
});
intro.start();
intro.oncomplete(() => {