mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Fix reporting of errors to HelpScout using "Report a problem" link.
Summary: Error notifications include a "Report a problem" link, but the inclusion of error message and stack trace was broken. Test Plan: Tested manually and added a test case. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2911
This commit is contained in:
parent
09b4aaa90e
commit
0a0e320ca8
@ -108,7 +108,7 @@ function _beaconOpen(userObj: IUserObj|null, options: {onOpen?: () => void, erro
|
|||||||
|
|
||||||
// The beacon remembers its content, so reset it when switching between reporting errors and
|
// The beacon remembers its content, so reset it when switching between reporting errors and
|
||||||
// sending a message.
|
// sending a message.
|
||||||
const openType = errors ? 'error' : 'message';
|
const openType = errors?.length ? 'error' : 'message';
|
||||||
if (openType !== lastOpenType) {
|
if (openType !== lastOpenType) {
|
||||||
Beacon('reset');
|
Beacon('reset');
|
||||||
lastOpenType = openType;
|
lastOpenType = openType;
|
||||||
@ -128,7 +128,7 @@ function _beaconOpen(userObj: IUserObj|null, options: {onOpen?: () => void, erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
const attrs: ISessionData = {};
|
const attrs: ISessionData = {};
|
||||||
if (errors) {
|
if (errors?.length) {
|
||||||
// If sending errors, prefill part of the message (the user sees this and can add to it), and
|
// If sending errors, prefill part of the message (the user sees this and can add to it), and
|
||||||
// include more detailed errors with stack traces into session-data.
|
// include more detailed errors with stack traces into session-data.
|
||||||
const messages = errors.map(({error, timestamp}) =>
|
const messages = errors.map(({error, timestamp}) =>
|
||||||
@ -180,7 +180,7 @@ export function beaconOpenMessage(options: IBeaconOpenOptions) {
|
|||||||
if (options.includeAppErrors && app) {
|
if (options.includeAppErrors && app) {
|
||||||
errors.push(...app.notifier.getFullAppErrors());
|
errors.push(...app.notifier.getFullAppErrors());
|
||||||
}
|
}
|
||||||
_beaconOpen(getBeaconUserObj(app), options);
|
_beaconOpen(getBeaconUserObj(app), {...options, errors});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ function buildAction(action: NotifyAction, item: Notification, options: IBeaconO
|
|||||||
{href: urlState().makeUrl({billing: 'billing'})});
|
{href: urlState().makeUrl({billing: 'billing'})});
|
||||||
|
|
||||||
case 'report-problem':
|
case 'report-problem':
|
||||||
return cssToastAction('Report a problem',
|
return cssToastAction('Report a problem', testId('toast-report-problem'),
|
||||||
dom.on('click', () => beaconOpenMessage({...options, includeAppErrors: true})));
|
dom.on('click', () => beaconOpenMessage({...options, includeAppErrors: true})));
|
||||||
|
|
||||||
case 'ask-for-help': {
|
case 'ask-for-help': {
|
||||||
|
Loading…
Reference in New Issue
Block a user