Skip to content

Commit 04741e2

Browse files
Rework the bug report dialog (#218)
* Rework the bug report dialog * Fix messaging in previous dialog
1 parent f7b475d commit 04741e2

File tree

3 files changed

+154
-6
lines changed

3 files changed

+154
-6
lines changed

patches/better-help-settings-2/matrix-react-sdk+3.54.0.patch

Lines changed: 97 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,47 @@
11
diff --git a/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx b/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx
2-
index 7df389f..6eb6e17 100644
2+
index 7df389f..4523228 100644
33
--- a/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx
44
+++ b/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx
5-
@@ -225,7 +225,9 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
5+
@@ -88,12 +88,21 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
6+
};
7+
8+
private onSubmit = (): void => {
9+
+ /* :TCHAP: do not ask for a github issue
10+
if ((!this.state.text || !this.state.text.trim()) && (!this.state.issueUrl || !this.state.issueUrl.trim())) {
11+
this.setState({
12+
err: _t("Please tell us what went wrong or, better, create a GitHub issue that describes the problem."),
13+
});
14+
return;
15+
}
16+
+ */
17+
+ if ((!this.state.text || !this.state.text.trim())) {
18+
+ this.setState({
19+
+ err: _t("Please tell us what went wrong in the \"Notes\" field."),
20+
+ });
21+
+ return;
22+
+ }
23+
+ // end :TCHAP:
24+
25+
const userText =
26+
(this.state.text.length > 0 ? this.state.text + '\n\n': '') + 'Issue: ' +
27+
@@ -205,7 +214,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
28+
<BaseDialog
29+
className="mx_BugReportDialog"
30+
onFinished={this.onCancel}
31+
- title={_t('Submit debug logs')}
32+
+ title={_t('Submit debug logs to Tchap support team') /** :TCHAP: more precise title */}
33+
contentId='mx_Dialog_content'
34+
>
35+
<div className="mx_Dialog_content" id='mx_Dialog_content'>
36+
@@ -218,6 +227,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
37+
"and the usernames of other users. They do not contain messages.",
38+
) }
39+
</p>
40+
+ { /* :TCHAP: remove requirement to send github issue, it's too complicated
41+
<p><b>
42+
{ _t(
43+
"Before submitting logs, you must <a>create a GitHub issue</a> to describe your problem.",
44+
@@ -225,29 +235,38 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
645
{
746
a: (sub) => <a
847
target="_blank"
@@ -13,7 +52,24 @@ index 7df389f..6eb6e17 100644
1352
>
1453
{ sub }
1554
</a>,
16-
@@ -246,7 +248,9 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
55+
},
56+
) }
57+
</b></p>
58+
+ */}
59+
60+
+ { /* :TCHAP: move this below, it's not where the user expects it, so it's hard to understand
61+
<div className="mx_BugReportDialog_download">
62+
<AccessibleButton onClick={this.onDownload} kind="link" disabled={this.state.downloadBusy}>
63+
{ _t("Download logs") }
64+
</AccessibleButton>
65+
{ this.state.downloadProgress && <span>{ this.state.downloadProgress } ...</span> }
66+
</div>
67+
+ */ }
68+
69+
+ { /* :TCHAP: remove requirement to send github issue, it's too complicated
70+
<Field
71+
type="text"
72+
className="mx_BugReportDialog_field_input"
1773
label={_t("GitHub issue")}
1874
onChange={this.onIssueUrlChange}
1975
value={this.state.issueUrl}
@@ -22,5 +78,43 @@ index 7df389f..6eb6e17 100644
2278
+ placeholder="https://github.com/tchapgouv/tchap-web-v4/issues/..."
2379
+ // end :TCHAP:
2480
/>
81+
+ */ }
2582
<Field
2683
className="mx_BugReportDialog_field_input"
84+
element="textarea"
85+
@@ -264,13 +283,29 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
86+
/>
87+
{ progress }
88+
{ error }
89+
+ <DialogButtons primaryButton={_t("Send logs")}
90+
+ onPrimaryButtonClick={this.onSubmit}
91+
+ focus={true}
92+
+ // :TCHAP: remove cancel button, now that we added more buttons it doesn't make sense
93+
+ // onCancel={this.onCancel}
94+
+ hasCancel={false}
95+
+ disabled={this.state.busy}
96+
+ />
97+
+
98+
+ {/** :TCHAP: move the log download here, and add an explanation text */}
99+
+ <div className="mx_BugReportDialog_download mx_Dialog_content">
100+
+ <p>
101+
+ { _t("Just want to get your own logs, without sharing them with the Tchap team?") }
102+
+ </p>
103+
+ <div className="mx_Dialog_buttons_row">
104+
+ { this.state.downloadProgress && <span>{ this.state.downloadProgress } ...</span> }
105+
+ <AccessibleButton onClick={this.onDownload} kind="primary" disabled={this.state.downloadBusy}>
106+
+ { _t("Download my logs") }
107+
+ </AccessibleButton>
108+
+ </div>
109+
+ </div>
110+
</div>
111+
- <DialogButtons primaryButton={_t("Send logs")}
112+
- onPrimaryButtonClick={this.onSubmit}
113+
- focus={true}
114+
- onCancel={this.onCancel}
115+
- disabled={this.state.busy}
116+
- />
117+
+ {/** end :TCHAP: */}
118+
</BaseDialog>
119+
);
120+
}

patches/better-help-settings/matrix-react-sdk+3.54.0.patch

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/node_modules/matrix-react-sdk/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx b/node_modules/matrix-react-sdk/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx
2-
index 7bb06f1..a21b096 100644
2+
index 7bb06f1..39fdcf9 100644
33
--- a/node_modules/matrix-react-sdk/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx
44
+++ b/node_modules/matrix-react-sdk/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx
55
@@ -181,6 +181,7 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
@@ -18,7 +18,40 @@ index 7bb06f1..a21b096 100644
1818

1919
let updateButton = null;
2020
if (this.state.canUpdate) {
21-
@@ -267,10 +269,90 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
21+
@@ -235,16 +237,22 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
22+
<div className="mx_SettingsTab_section">
23+
<span className='mx_SettingsTab_subheading'>{ _t('Bug reporting') }</span>
24+
<div className='mx_SettingsTab_subsectionText'>
25+
- { _t(
26+
- "If you've submitted a bug via GitHub, debug logs can help " +
27+
- "us track down the problem. ",
28+
- ) }
29+
- { _t("Debug logs contain application " +
30+
- "usage data including your username, the IDs or aliases of " +
31+
- "the rooms you have visited, which UI elements you " +
32+
- "last interacted with, and the usernames of other users. " +
33+
- "They do not contain messages.",
34+
- ) }
35+
+ { /** :TCHAP: add paragraphs, clarify text */ }
36+
+ <p>
37+
+ { _t(
38+
+ "If you've submitted a bug to the Tchap team (via support or GitHub), debug logs can help " +
39+
+ "us track down the problem.",
40+
+ ) }
41+
+ </p>
42+
+ <p>
43+
+ { _t("Debug logs contain application " +
44+
+ "usage data including your username, the IDs or aliases of " +
45+
+ "the rooms you have visited, which UI elements you " +
46+
+ "last interacted with, and the usernames of other users. " +
47+
+ "They do not contain messages.",
48+
+ ) }
49+
+ </p>
50+
+ { /** end :TCHAP: */ }
51+
</div>
52+
<AccessibleButton onClick={this.onBugReport} kind='primary'>
53+
{ _t("Submit debug logs") }
54+
@@ -267,10 +275,90 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
2255

2356
const { appVersion, olmVersion } = this.getVersionInfo();
2457

@@ -110,7 +143,7 @@ index 7bb06f1..a21b096 100644
110143
<div className='mx_SettingsTab_section'>
111144
<span className='mx_SettingsTab_subheading'>{ _t("FAQ") }</span>
112145
<div className='mx_SettingsTab_subsectionText'>
113-
@@ -279,7 +361,9 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
146+
@@ -279,7 +367,9 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
114147
<AccessibleButton kind="primary" onClick={this.onKeyboardShortcutsClicked}>
115148
{ _t("Keyboard Shortcuts") }
116149
</AccessibleButton>

src/i18n/strings/tchap_translations.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,27 @@
8989
"en": "We have compiled a list of the questions our users ask the most frequently. Your question may be answered there.",
9090
"fr": "Nous avons constitué une liste des question les plus fréquentes posées par nos utilisateurs. Votre question a peut-être déjà une solution."
9191
},
92+
"Please tell us what went wrong in the \"Notes\" field.": {
93+
"en": "Please tell us what went wrong in the \"Notes\" field.",
94+
"fr": "Veuillez nous expliquer le problème dans le champ \"Notes\"."
95+
},
96+
"Submit debug logs to Tchap support team": {
97+
"en": "Submit debug logs to Tchap support team",
98+
"fr": "Envoyez les journaux de débogage à l'équipe support de Tchap",
99+
"comment": "The title of BugReportDialog is unclear, specify it"
100+
},
101+
"Just want to get your own logs, without sharing them with the Tchap team?": {
102+
"en": "Just want to get your own logs, without sharing them with the Tchap team?",
103+
"fr": "Vous voulez juste obtenir vos journaux sans les partager avec l'équipe Tchap ?"
104+
},
105+
"Download my logs": {
106+
"en": "Download my logs",
107+
"fr": "Obtenir mes journaux"
108+
},
109+
"If you've submitted a bug to the Tchap team (via support or GitHub), debug logs can help us track down the problem." : {
110+
"en": "If you've submitted a bug to the Tchap team (via support or GitHub), debug logs can help us track down the problem.",
111+
"fr": "Si vous avez signalé une anomalie à l'équipe Tchap (via le support ou GitHub), les journaux de débogage peuvent nous aider à cibler le problème."
112+
},
92113
"Allow external users to join this room": {
93114
"en": "Allow external users to join this room",
94115
"fr": "Autoriser les externes à rejoindre ce salon"

0 commit comments

Comments
 (0)