Iterate upon the room upgrade warning bar

This lessens the warning for unstable-but-not-official versions while still communicating that the version is unstable. In the future, we may want to make this state dismissable.
This commit is contained in:
Travis Ralston 2019-01-28 17:21:33 -07:00
parent c204cd7be3
commit f8de4ba2b0
4 changed files with 51 additions and 12 deletions

View file

@ -26,6 +26,7 @@ module.exports = React.createClass({
propTypes: {
room: PropTypes.object.isRequired,
recommendation: PropTypes.object.isRequired,
},
onUpgradeClick: function() {
@ -35,19 +36,40 @@ module.exports = React.createClass({
render: function() {
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
return (
<div className="mx_RoomUpgradeWarningBar">
<div className="mx_RoomUpgradeWarningBar_header">
{_t("There is a known vulnerability affecting this room.")}
</div>
let upgradeText = (
<div>
<div className="mx_RoomUpgradeWarningBar_body">
{_t("This room version is vulnerable to malicious modification of room state.")}
{_t("This room is using an unstable room version. If you aren't expecting this, please upgrade the room.")}
</div>
<p className="mx_RoomUpgradeWarningBar_upgradelink">
<AccessibleButton onClick={this.onUpgradeClick}>
{_t("Click here to upgrade to the latest room version and ensure room integrity is protected.")}
{_t("Click here to upgrade to the latest room version.")}
</AccessibleButton>
</p>
</div>
);
if (this.props.recommendation.urgent) {
upgradeText = (
<div>
<div className="mx_RoomUpgradeWarningBar_header">
{_t("There is a known vulnerability affecting this room.")}
</div>
<div className="mx_RoomUpgradeWarningBar_body">
{_t("This room version is vulnerable to malicious modification of room state.")}
</div>
<p className="mx_RoomUpgradeWarningBar_upgradelink">
<AccessibleButton onClick={this.onUpgradeClick}>
{_t("Click here to upgrade to the latest room version and ensure room integrity is protected.")}
</AccessibleButton>
</p>
</div>
);
}
return (
<div className="mx_RoomUpgradeWarningBar">
{upgradeText}
<div className="mx_RoomUpgradeWarningBar_small">
{_t("Only room administrators will see this warning")}
</div>