Add additional metadata to feedback submitted through spotlight dialog (#9024)

This commit is contained in:
Janne Mareike Koschinski 2022-07-11 12:00:40 +02:00 committed by GitHub
parent 8c67984f50
commit 32c008b3f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -33,7 +33,9 @@ const existingIssuesUrl = "https://github.com/vector-im/element-web/issues" +
"?q=is%3Aopen+is%3Aissue+sort%3Areactions-%2B1-desc";
const newIssueUrl = "https://github.com/vector-im/element-web/issues/new/choose";
interface IProps extends IDialogProps {}
interface IProps extends IDialogProps {
feature?: string;
}
const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
const feedbackRef = useRef<Field>();
@ -55,7 +57,8 @@ const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
const onFinished = (sendFeedback: boolean): void => {
if (hasFeedback && sendFeedback) {
if (rageshakeUrl) {
submitFeedback(rageshakeUrl, "feedback", comment, canContact);
const label = props.feature ? `${props.feature}-feedback` : "feedback";
submitFeedback(rageshakeUrl, label, comment, canContact);
}
Modal.createDialog(InfoDialog, {

View file

@ -1004,7 +1004,9 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
};
const openFeedback = SdkConfig.get().bug_report_endpoint_url ? () => {
Modal.createDialog(FeedbackDialog);
Modal.createDialog(FeedbackDialog, {
feature: "spotlight",
});
} : null;
const activeDescendant = rovingContext.state.activeRef?.current?.id;