From 9b5823cccb3175b07eb94fe7f7a426406a5c3d26 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 9 Sep 2020 14:53:38 -0600 Subject: [PATCH 1/2] 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. --- src/SlashCommands.tsx | 16 ++++------------ src/components/views/dialogs/BugReportDialog.js | 3 ++- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index 1dc4a8abc1..56ea5846fd 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -38,8 +38,7 @@ import {inviteUsersToRoom} from "./RoomInvite"; import { WidgetType } from "./widgets/WidgetType"; import { Jitsi } from "./widgets/Jitsi"; import { parseFragment as parseHtml } from "parse5"; -import sendBugReport from "./rageshake/submit-rageshake"; -import SdkConfig from "./SdkConfig"; +import BugReportDialog from "./components/views/dialogs/BugReportDialog"; import { ensureDMExists } from "./createRoom"; import { ViewUserPayload } from "./dispatcher/payloads/ViewUserPayload"; import { Action } from "./dispatcher/actions"; @@ -975,16 +974,9 @@ export const Commands = [ args: "", runFn: function(roomId, args) { return success( - sendBugReport(SdkConfig.get().bug_report_endpoint_url, { - userText: args, - sendLogs: true, - }).then(() => { - const InfoDialog = sdk.getComponent('dialogs.InfoDialog'); - Modal.createTrackedDialog('Slash Commands', 'Rageshake sent', InfoDialog, { - title: _t('Logs sent'), - description: _t('Thank you!'), - }); - }), + Modal.createTrackedDialog('Bug Report Dialog', '', BugReportDialog, { + initialText: args, + }).finished, ); }, category: CommandCategories.advanced, diff --git a/src/components/views/dialogs/BugReportDialog.js b/src/components/views/dialogs/BugReportDialog.js index d001d3993d..c4dd0a1430 100644 --- a/src/components/views/dialogs/BugReportDialog.js +++ b/src/components/views/dialogs/BugReportDialog.js @@ -34,7 +34,7 @@ export default class BugReportDialog extends React.Component { busy: false, err: null, issueUrl: "", - text: "", + text: props.initialText || "", progress: null, downloadBusy: false, downloadProgress: null, @@ -255,4 +255,5 @@ export default class BugReportDialog extends React.Component { BugReportDialog.propTypes = { onFinished: PropTypes.func.isRequired, + initialText: PropTypes.string, }; From 77f715ba739b267e450f8f4890f671e048228f5d Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 9 Sep 2020 14:55:27 -0600 Subject: [PATCH 2/2] Fix i18n and analytics --- src/SlashCommands.tsx | 2 +- src/i18n/strings/en_EN.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index 56ea5846fd..6456368211 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -974,7 +974,7 @@ export const Commands = [ args: "", runFn: function(roomId, args) { return success( - Modal.createTrackedDialog('Bug Report Dialog', '', BugReportDialog, { + Modal.createTrackedDialog('Slash Commands', 'Bug Report Dialog', BugReportDialog, { initialText: args, }).finished, ); diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 054777fd64..77cd8ef661 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -206,8 +206,6 @@ "Displays list of commands with usages and descriptions": "Displays list of commands with usages and descriptions", "Displays information about a user": "Displays information about a user", "Send a bug report with logs": "Send a bug report with logs", - "Logs sent": "Logs sent", - "Thank you!": "Thank you!", "Opens chat with the given user": "Opens chat with the given user", "Sends a message to the given user": "Sends a message to the given user", "Displays action": "Displays action", @@ -1602,6 +1600,8 @@ "Close dialog": "Close dialog", "Please tell us what went wrong or, better, create a GitHub issue that describes the problem.": "Please tell us what went wrong or, better, create a GitHub issue that describes the problem.", "Preparing to send logs": "Preparing to send logs", + "Logs sent": "Logs sent", + "Thank you!": "Thank you!", "Failed to send logs: ": "Failed to send logs: ", "Preparing to download logs": "Preparing to download logs", "Reminder: Your browser is unsupported, so your experience may be unpredictable.": "Reminder: Your browser is unsupported, so your experience may be unpredictable.",