mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 18:25:49 +03:00
Support admin configurable message when reporting content
This adds support for an admin-configured message in config.json to be shown in the report content dialog to allow linking to community rules, etc. Fixes https://github.com/vector-im/riot-web/issues/11992
This commit is contained in:
parent
684974372d
commit
fbb65f068a
1 changed files with 12 additions and 1 deletions
|
@ -20,6 +20,8 @@ import { _t } from '../../../languageHandler';
|
|||
import PropTypes from "prop-types";
|
||||
import {MatrixEvent} from "matrix-js-sdk";
|
||||
import {MatrixClientPeg} from "../../../MatrixClientPeg";
|
||||
import SdkConfig from '../../../SdkConfig';
|
||||
import Markdown from '../../../Markdown';
|
||||
|
||||
/*
|
||||
* A dialog for reporting an event.
|
||||
|
@ -95,6 +97,15 @@ export default class ReportEventDialog extends PureComponent {
|
|||
);
|
||||
}
|
||||
|
||||
const adminMessageMD =
|
||||
SdkConfig.get().reportEvent &&
|
||||
SdkConfig.get().reportEvent.adminMessageMD;
|
||||
let adminMessage;
|
||||
if (adminMessageMD) {
|
||||
const html = new Markdown(adminMessageMD).toHTML();
|
||||
adminMessage = <p dangerouslySetInnerHTML={{ __html: html }} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<BaseDialog
|
||||
className="mx_BugReportDialog"
|
||||
|
@ -110,7 +121,7 @@ export default class ReportEventDialog extends PureComponent {
|
|||
"administrator will not be able to read the message text or view any files or images.")
|
||||
}
|
||||
</p>
|
||||
|
||||
{adminMessage}
|
||||
<Field
|
||||
id="mx_ReportEventDialog_reason"
|
||||
className="mx_ReportEventDialog_reason"
|
||||
|
|
Loading…
Reference in a new issue