Run the rageshake command through the bug report dialog

Ideally we encourage users to give us information like a github issue or options to download their logs.
This commit is contained in:
Travis Ralston 2020-09-09 14:53:38 -06:00
parent 91282e8071
commit 9b5823cccb
2 changed files with 6 additions and 13 deletions

View file

@ -38,8 +38,7 @@ import {inviteUsersToRoom} from "./RoomInvite";
import { WidgetType } from "./widgets/WidgetType"; import { WidgetType } from "./widgets/WidgetType";
import { Jitsi } from "./widgets/Jitsi"; import { Jitsi } from "./widgets/Jitsi";
import { parseFragment as parseHtml } from "parse5"; import { parseFragment as parseHtml } from "parse5";
import sendBugReport from "./rageshake/submit-rageshake"; import BugReportDialog from "./components/views/dialogs/BugReportDialog";
import SdkConfig from "./SdkConfig";
import { ensureDMExists } from "./createRoom"; import { ensureDMExists } from "./createRoom";
import { ViewUserPayload } from "./dispatcher/payloads/ViewUserPayload"; import { ViewUserPayload } from "./dispatcher/payloads/ViewUserPayload";
import { Action } from "./dispatcher/actions"; import { Action } from "./dispatcher/actions";
@ -975,16 +974,9 @@ export const Commands = [
args: "<description>", args: "<description>",
runFn: function(roomId, args) { runFn: function(roomId, args) {
return success( return success(
sendBugReport(SdkConfig.get().bug_report_endpoint_url, { Modal.createTrackedDialog('Bug Report Dialog', '', BugReportDialog, {
userText: args, initialText: args,
sendLogs: true, }).finished,
}).then(() => {
const InfoDialog = sdk.getComponent('dialogs.InfoDialog');
Modal.createTrackedDialog('Slash Commands', 'Rageshake sent', InfoDialog, {
title: _t('Logs sent'),
description: _t('Thank you!'),
});
}),
); );
}, },
category: CommandCategories.advanced, category: CommandCategories.advanced,

View file

@ -34,7 +34,7 @@ export default class BugReportDialog extends React.Component {
busy: false, busy: false,
err: null, err: null,
issueUrl: "", issueUrl: "",
text: "", text: props.initialText || "",
progress: null, progress: null,
downloadBusy: false, downloadBusy: false,
downloadProgress: null, downloadProgress: null,
@ -255,4 +255,5 @@ export default class BugReportDialog extends React.Component {
BugReportDialog.propTypes = { BugReportDialog.propTypes = {
onFinished: PropTypes.func.isRequired, onFinished: PropTypes.func.isRequired,
initialText: PropTypes.string,
}; };