-
-
Notifications
You must be signed in to change notification settings - Fork 833
very barebones support for warning users when rooms contain unknown devices #635
Changes from 1 commit
2e15e8f
21f3aea
a2dd1fa
5538ce7
5da6ca8
70190be
ebf6ba8
60d7575
2c7b3d9
c09d173
5e5b7f8
5d5125d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
Copyright 2015, 2016 OpenMarket Ltd | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
var React = require("react"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would be nice to use |
||
var sdk = require('../../../index'); | ||
var MatrixClientPeg = require("../../../MatrixClientPeg"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this appears to be unused. And if it wasn't, I'd be asking you to pass in the |
||
|
||
module.exports = React.createClass({ | ||
displayName: 'UnknownEventDialog', | ||
|
||
propTypes: { | ||
devices: React.PropTypes.object.isRequired, | ||
onFinished: React.PropTypes.func.isRequired, | ||
}, | ||
|
||
onKeyDown: function(e) { | ||
if (e.keyCode === 27) { // escape | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
this.props.onFinished(false); | ||
} | ||
}, | ||
|
||
render: function() { | ||
return ( | ||
<div className="mx_UnknownDeviceDialog" onKeyDown={ this.onKeyDown }> | ||
<div className="mx_Dialog_title"> | ||
Room contains unknown devices | ||
</div> | ||
<div className="mx_Dialog_content"> | ||
<h4>This room contains unknown devices which have not been verified.</h4> | ||
<h4>We strongly recommend you verify them before continuing.</h4> | ||
<p>Unknown devices: | ||
<ul>{ | ||
Object.keys(this.props.devices).map(userId=>{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could do with factoring this out to a separate function |
||
return <li key={ userId }> | ||
<p>{ userId }:</p> | ||
<ul> | ||
{ | ||
Object.keys(this.props.devices[userId]).map(deviceId=>{ | ||
return <li key={ deviceId }> | ||
{ deviceId } ( { this.props.devices[userId][deviceId].getDisplayName() } ) | ||
</li> | ||
}) | ||
} | ||
</ul> | ||
</li> | ||
}) | ||
}</ul> | ||
</p> | ||
</div> | ||
<div className="mx_Dialog_buttons"> | ||
<button className="mx_Dialog_primary" onClick={ this.props.onFinished } autoFocus={ true }> | ||
OK | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
} | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ module.exports = React.createClass({ | |
|
||
var cancelButton; | ||
if (this.props.onCancelClick) { | ||
cancelButton = <div className="mx_RoomHeader_cancelButton" onClick={this.props.onCancelClick}><img src="img/cancel.svg" width="18" height="18" alt="Cancel"/> </div>; | ||
cancelButton = <div className="mx_RoomHeader_cancelButton" onClick={this.props.onCancelClick}><img src="img/cancel.svg" className="mx_filterFlipColor" width="18" height="18" alt="Cancel"/> </div>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks unrelated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oops; random trivial dark theme fix that snuck in. should have gone straight to develop probably. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, factored out to #651 along with a fix that removes some c&p and therefore fixes it for the room settings too... |
||
} | ||
|
||
var showRhsButton; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<cough>