Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bug report button after voip calls #916

Merged
merged 11 commits into from
Feb 22, 2024
8 changes: 8 additions & 0 deletions modules/tchap-translations/tchap_translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -713,5 +713,13 @@
"widget|error_need_kick_permission": {
"en": "You need to be able to kick users to do that.",
"fr": "Vous devez avoir l’autorisation de retirer des utilisateurs pour faire ceci."
},
"Report a problem": {
"en": "Report a problem",
"fr": "Signaler un problème"
},
"tchap_voip_bug_report_prefill": {
"en": "Congratulations, your account has been renewed",
"fr": "Sujet: problème sur appel Tchap. \nPouver-vous donner des détails?\n\nJe suis connecté en : WIFI / VPN / sur la 4G d'un portable / AUTRE\nJe suis sur : AU TRAVAIL / AILLEURS\nDétails du problème : ..."
}
}
63 changes: 58 additions & 5 deletions patches/bug-reporting/matrix-react-sdk+3.92.0.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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
index 5d826f2..5163137 100644
index 5d826f2..e3ec671 100644
--- a/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx
+++ b/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx
@@ -32,6 +32,7 @@ import DialogButtons from "../elements/DialogButtons";
Expand Down Expand Up @@ -32,7 +32,7 @@ index 5d826f2..5163137 100644

const userText =
(this.state.text.length > 0 ? this.state.text + "\n\n" : "") +
@@ -111,11 +121,24 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
@@ -111,11 +121,28 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
this.setState({ busy: true, progress: null, err: null });
this.sendProgressCallback(_t("bug_reporting|preparing_logs"));

Expand All @@ -48,6 +48,10 @@ index 5d826f2..5163137 100644
+ result.threepids.forEach(threepid => {
+ return customFields[threepid.medium] = threepid.address;
+ });
+ // is this a voip report ? Add it in "context" field
+ if (this.props.label === 'voip') {
+ customFields.context = 'voip';
+ }
+ return customFields;
+ }).then(customFields => {
+ return sendBugReport(SdkConfig.get().bug_report_endpoint_url, {
Expand All @@ -62,15 +66,15 @@ index 5d826f2..5163137 100644
}).then(
() => {
if (!this.unmounted) {
@@ -150,6 +173,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
@@ -150,6 +177,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
sendLogs: true,
progressCallback: this.downloadProgressCallback,
labels: this.props.label ? [this.props.label] : [],
+ customApp: 'tchap-web', // :TCHAP: we don't add email here. You know your own email already.
});

this.setState({
@@ -214,6 +238,53 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
@@ -214,6 +242,53 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
);
}

Expand Down Expand Up @@ -124,7 +128,7 @@ index 5d826f2..5163137 100644
return (
<BaseDialog
className="mx_BugReportDialog"
@@ -281,5 +352,6 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
@@ -281,5 +356,6 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
/>
</BaseDialog>
);
Expand All @@ -144,6 +148,55 @@ index 1eb0379..90955dd 100644
};

/**
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
index 3c8241d..414e7cd 100644
--- a/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx
+++ b/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx
@@ -28,6 +28,10 @@ import AccessibleTooltipButton from "../elements/AccessibleTooltipButton";
import { formatPreciseDuration } from "../../../DateUtils";
import Clock from "../audio_messages/Clock";

+import Modal from "matrix-react-sdk/src/Modal"; // :TCHAP:
+import BugReportDialog from "matrix-react-sdk/src/components/views/dialogs/BugReportDialog"; // :TCHAP:
+import "../../../../../../res/css/views/messages/TchapLegacyCallEvent.pcss"; // :TCHAP:
+
const MAX_NON_NARROW_WIDTH = (450 / 70) * 100;

interface IProps {
@@ -192,6 +196,7 @@ export default class LegacyCallEvent extends React.PureComponent<IProps, IState>
return (
<div className="mx_LegacyCallEvent_content">
{text}
+ {this.renderBugReportButton()}
{this.props.timestamp}
</div>
);
@@ -264,6 +269,25 @@ export default class LegacyCallEvent extends React.PureComponent<IProps, IState>
);
}

+ private onReportBugClick = (): void => {
+ Modal.createDialog(BugReportDialog, {
+ initialText: _t("tchap_voip_bug_report_prefill"),
+ label: "voip",
+ });
+ };
+
+ private renderBugReportButton(): JSX.Element {
+ return (
+ <AccessibleButton
+ className="mx_LegacyCallEvent_content_button mx_LegacyCallEvent_content_button_reportBug"
+ onClick={this.onReportBugClick}
+ kind="primary"
+ >
+ <span> {_t("Report a problem")} </span>
+ </AccessibleButton>
+ );
+ }
+
public render(): React.ReactNode {
const event = this.props.mxEvent;
const sender = event.sender ? event.sender.name : event.getSender();
diff --git a/node_modules/matrix-react-sdk/src/rageshake/submit-rageshake.ts b/node_modules/matrix-react-sdk/src/rageshake/submit-rageshake.ts
index d15f3d9..7c7f6d8 100644
--- a/node_modules/matrix-react-sdk/src/rageshake/submit-rageshake.ts
Expand Down
7 changes: 4 additions & 3 deletions patches/patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
},
"bug-reporting": {
"package": "matrix-react-sdk",
"github-issue":"https://github.com/tchapgouv/tchap-web-v4/issues/527, https://github.com/tchapgouv/tchap-web-v4/issues/526",
"comments" : "add email in rageshake",
"github-issue":"https://github.com/tchapgouv/tchap-web-v4/issues/527, https://github.com/tchapgouv/tchap-web-v4/issues/526, https://github.com/tchapgouv/tchap-product/issues/267",
"comments" : "add email in rageshake + voip",
"files": [
"src/components/views/dialogs/BugReportDialog.tsx",
"src/rageshake/submit-rageshake.ts",
"src/components/views/elements/AccessibleButton.tsx"
"src/components/views/elements/AccessibleButton.tsx",
"src/components/views/messages/LegacyCallEvent.tsx"
]
},
"content-scanner": {
Expand Down
9 changes: 9 additions & 0 deletions res/css/views/messages/TchapLegacyCallEvent.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.mx_LegacyCallEvent_wrapper {
.mx_LegacyCallEvent {
&.mx_LegacyCallEvent_voice {
.mx_LegacyCallEvent_content_button_reportBug span::before {
mask-image: url("~matrix-react-sdk/res/img/feather-customised/bug.svg");
}
}
}
}
Loading