1
1
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 5d826f2..5163137 100644
2
+ index 5d826f2..51baf28 100644
3
3
--- a/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx
4
4
+++ b/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx
5
- @@ -32,6 +32,7 @@ import DialogButtons from "../elements/DialogButtons";
5
+ @@ -32,6 +32,8 @@ import DialogButtons from "../elements/DialogButtons";
6
6
import { sendSentryReport } from "../../../sentry";
7
7
import defaultDispatcher from "../../../dispatcher/dispatcher";
8
8
import { Action } from "../../../dispatcher/actions";
9
9
+ import { MatrixClientPeg } from '../../../MatrixClientPeg'; // :TCHAP:
10
+ + import TchapUtils from "../../../../../../src/tchap/util/TchapUtils"; // :TCHAP:
10
11
11
12
interface IProps {
12
13
onFinished: (success: boolean) => void;
13
- @@ -96,12 +97 ,21 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
14
+ @@ -96,12 +98 ,21 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
14
15
};
15
16
16
17
private onSubmit = (): void => {
@@ -32,7 +33,7 @@ index 5d826f2..5163137 100644
32
33
33
34
const userText =
34
35
(this.state.text.length > 0 ? this.state.text + "\n\n" : "") +
35
- @@ -111,11 +121,24 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
36
+ @@ -111,11 +122,34 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
36
37
this.setState({ busy: true, progress: null, err: null });
37
38
this.sendProgressCallback(_t("bug_reporting|preparing_logs"));
38
39
@@ -43,13 +44,23 @@ index 5d826f2..5163137 100644
43
44
- labels: this.props.label ? [this.props.label] : [],
44
45
+ // :TCHAP: customise report : add email, prefix with "tchap-web"
45
46
+ const client = MatrixClientPeg.get();
47
+ + const customFields = {};
46
48
+ client.getThreePids().then(result => {
47
- + const customFields = {};
48
49
+ result.threepids.forEach(threepid => {
49
50
+ return customFields[threepid.medium] = threepid.address;
50
51
+ });
51
52
+ return customFields;
52
53
+ }).then(customFields => {
54
+ + // is this a voip report ? Add it in "context" field
55
+ + if (this.props.label === "voip-feedback") {
56
+ + customFields.context = "voip";
57
+ + }
58
+ +
59
+ + return TchapUtils.isCurrentlyUsingBluetooth().then(isCurrentlyUsingBluetooth => {
60
+ + customFields.audio_input = isCurrentlyUsingBluetooth ? "headset_bluetooth" : "device";
61
+ + return customFields;
62
+ + })
63
+ + }).then(customFields => {
53
64
+ return sendBugReport(SdkConfig.get().bug_report_endpoint_url, {
54
65
+ userText,
55
66
+ sendLogs: true,
@@ -62,15 +73,15 @@ index 5d826f2..5163137 100644
62
73
}).then(
63
74
() => {
64
75
if (!this.unmounted) {
65
- @@ -150,6 +173 ,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
76
+ @@ -150,6 +184 ,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
66
77
sendLogs: true,
67
78
progressCallback: this.downloadProgressCallback,
68
79
labels: this.props.label ? [this.props.label] : [],
69
80
+ customApp: 'tchap-web', // :TCHAP: we don't add email here. You know your own email already.
70
81
});
71
82
72
83
this.setState({
73
- @@ -214,6 +238 ,53 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
84
+ @@ -214,6 +249 ,53 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
74
85
);
75
86
}
76
87
@@ -124,7 +135,7 @@ index 5d826f2..5163137 100644
124
135
return (
125
136
<BaseDialog
126
137
className="mx_BugReportDialog"
127
- @@ -281,5 +352 ,6 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
138
+ @@ -281,5 +363 ,6 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
128
139
/>
129
140
</BaseDialog>
130
141
);
@@ -144,6 +155,55 @@ index 1eb0379..90955dd 100644
144
155
};
145
156
146
157
/**
158
+ diff --git a/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx b/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx
159
+ index 3c8241d..cdd9a83 100644
160
+ --- a/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx
161
+ +++ b/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx
162
+ @@ -28,6 +28,10 @@ import AccessibleTooltipButton from "../elements/AccessibleTooltipButton";
163
+ import { formatPreciseDuration } from "../../../DateUtils";
164
+ import Clock from "../audio_messages/Clock";
165
+
166
+ + import Modal from "matrix-react-sdk/src/Modal"; // :TCHAP:
167
+ + import BugReportDialog from "matrix-react-sdk/src/components/views/dialogs/BugReportDialog"; // :TCHAP:
168
+ + import "../../../../../../res/css/views/messages/TchapLegacyCallEvent.pcss"; // :TCHAP:
169
+ +
170
+ const MAX_NON_NARROW_WIDTH = (450 / 70) * 100;
171
+
172
+ interface IProps {
173
+ @@ -192,6 +196,7 @@ export default class LegacyCallEvent extends React.PureComponent<IProps, IState>
174
+ return (
175
+ <div className="mx_LegacyCallEvent_content">
176
+ {text}
177
+ + {this.renderBugReportButton()}
178
+ {this.props.timestamp}
179
+ </div>
180
+ );
181
+ @@ -264,6 +269,25 @@ export default class LegacyCallEvent extends React.PureComponent<IProps, IState>
182
+ );
183
+ }
184
+
185
+ + private onReportBugClick = (): void => {
186
+ + Modal.createDialog(BugReportDialog, {
187
+ + initialText: _t("tchap_voip_bug_report_prefill"),
188
+ + label: "voip-feedback",
189
+ + });
190
+ + };
191
+ +
192
+ + private renderBugReportButton(): JSX.Element {
193
+ + return (
194
+ + <AccessibleButton
195
+ + className="mx_LegacyCallEvent_content_button mx_LegacyCallEvent_content_button_reportBug"
196
+ + onClick={this.onReportBugClick}
197
+ + kind="primary"
198
+ + >
199
+ + <span> {_t("Report a problem")} </span>
200
+ + </AccessibleButton>
201
+ + );
202
+ + }
203
+ +
204
+ public render(): React.ReactNode {
205
+ const event = this.props.mxEvent;
206
+ const sender = event.sender ? event.sender.name : event.getSender();
147
207
diff --git a/node_modules/matrix-react-sdk/src/rageshake/submit-rageshake.ts b/node_modules/matrix-react-sdk/src/rageshake/submit-rageshake.ts
148
208
index d15f3d9..7c7f6d8 100644
149
209
--- a/node_modules/matrix-react-sdk/src/rageshake/submit-rageshake.ts
0 commit comments