Skip to content

Commit

Permalink
Send feedback to Sentry.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Apr 24, 2024
1 parent 27646be commit 2c2716b
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions server_manager/web_app/ui_components/outline-contact-us-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {SingleSelectedEvent} from '@material/mwc-list/mwc-list';
import { OutlineFeedbackDialog } from './outline-feedback-dialog';
import { PaperDialogElement } from '@polymer/paper-dialog/paper-dialog';
import '@polymer/paper-button/paper-button';
import * as Sentry from '@sentry/electron/renderer';

import './outline-support-form';
import {FormValues, OutlineSupportForm, ValidFormValues} from './outline-support-form';
Expand Down Expand Up @@ -222,12 +223,16 @@ export class OutlineContactUsDialog extends LitElement implements OutlineFeedbac

const {description, email, ...tags} = this.formValues as ValidFormValues;
try {
// TODO
console.log(description, email, tags);
// await this.errorReporter.report(description, this.selectedIssueType?.toString() ?? 'unknown', email, {
// ...tags,
// formVersion: 2,
// });
Sentry.captureEvent({
message: description,
user: {email},
tags: {
category: this.selectedIssueType?.toString() ?? 'unknown',
isFeedback: true,
formVersion: 2,
...tags
},
});
} catch (e) {
console.error(`Failed to send feedback report: ${e.message}`);
this.isFormSubmitting = false;
Expand All @@ -237,6 +242,7 @@ export class OutlineContactUsDialog extends LitElement implements OutlineFeedbac

this.isFormSubmitting = false;
this.reset();
this.close();
this.dispatchEvent(new CustomEvent('success'));
}

Expand Down Expand Up @@ -358,4 +364,8 @@ export class OutlineContactUsDialog extends LitElement implements OutlineFeedbac

this.dialogRef.value?.open();
}

close() {
this.dialogRef.value?.close();
}
}

0 comments on commit 2c2716b

Please sign in to comment.