Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

UI for blacklisting unverified devices per-room & globally #636

Merged
merged 14 commits into from
Feb 3, 2017

Conversation

ara4n
Copy link
Member

@ara4n ara4n commented Jan 22, 2017

This should solve element-hq/element-web#2313, modulo hitting up against the regression in element-hq/element-web#3020.

It builds on top of #635, which should land first for sensible review.

@ara4n
Copy link
Member Author

ara4n commented Jan 23, 2017

(hm, even once #3020 is fixed, which I guess it now is, it'll probably need Dialog to support stacks of dialogs so that the user can jump in & out of verifying/blocking devices nicely)

@richvdh
Copy link
Member

richvdh commented Jan 23, 2017 via email

@richvdh
Copy link
Member

richvdh commented Jan 26, 2017

Ok, some thoughts on this:

Firstly this PR mixes two concepts. Let's tale them separately.

Firstly, it adds the verify/blacklist buttons to the UnknownDeviceDialog.

Second, it includes the UI for twiddling the global blacklist setting. This is ok - though presumably in this case we will never see the UnknownDeviceDialog, so there's no point handling it specially?

@ara4n
Copy link
Member Author

ara4n commented Jan 26, 2017

sounds plausible on all counts. sorry for mixing the two issues.

@richvdh
Copy link
Member

richvdh commented Jan 31, 2017

currently blocked on #635, which is with @ara4n

@richvdh richvdh assigned ara4n and unassigned richvdh Jan 31, 2017
@ara4n
Copy link
Member Author

ara4n commented Feb 2, 2017

no longer blocked on #635. @richvdh, PTAL as the UnkDeviceDialog is pretty crap without this..

@ara4n ara4n assigned richvdh and unassigned ara4n Feb 2, 2017
@ara4n
Copy link
Member Author

ara4n commented Feb 2, 2017

(just merging)

@ara4n
Copy link
Member Author

ara4n commented Feb 2, 2017

having just tried this, there are some minor problems:

  • Blacklist button doesn't work
  • Actually verifying (or blacklisting) devices doesn't seem to update the device list
  • it really feels like there should be some kind of way to bring up this dialog at any point, to help manage en-masse all the devices in the room (and show the known devices to, so you have a full dashboard), otherwise you are just a bit blind when going and verifying/blacklisting the listed devices.

Hum.

@richvdh
Copy link
Member

richvdh commented Feb 2, 2017

it really feels like there should be some kind of way to bring up this dialog at any point, to help manage en-masse all the devices in the room (and show the known devices to, so you have a full dashboard), otherwise you are just a bit blind when going and verifying/blacklisting the listed devices.

That would imply we need to rethink what it means to be "known".

@ara4n
Copy link
Member Author

ara4n commented Feb 3, 2017

i've fixed the verify/blacklist UI updating problem in the above commit.
in terms of whether the dialog should be displayable on demand... yes. probably by clicking on the padlock or something. but i think that can be a separate PR and isn't so critical.

@richvdh PTAL.

@@ -149,6 +149,23 @@ module.exports = {
return MatrixClientPeg.get().setAccountData("im.vector.web.settings", settings);
},

getLocalSettings: function() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be good to explain wtf a 'local setting' is. Turns out, it's a setting which is persisted in localstorage.

return JSON.parse(localSettingsString);
},

getLocalSetting: function(type, defaultValue = null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type? why type?

return JSON.parse(localSettingsString);
},

getLocalSetting: function(type, defaultValue = null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments on what the behaviour is if the setting is absent would be nice.

@@ -149,6 +149,23 @@ module.exports = {
return MatrixClientPeg.get().setAccountData("im.vector.web.settings", settings);
},

getLocalSettings: function() {
var localSettingsString = localStorage.getItem('mx_local_settings') || '{}';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ought to handle localStorage === undefined here

_renderLocalSetting: function(setting) {
const client = MatrixClientPeg.get();
return <div className="mx_UserSettings_toggle" key={ setting.id }>
<input id={ setting.id }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is crying out to be made a separate react component.

Don't enable encryption unless the box is checked!
var isGlobalBlacklistUnverified = UserSettingsStore.getLocalSettings().blacklistUnverifiedDevices;
var isRoomBlacklistUnverified = this._isRoomBlacklistUnverified();

var settings =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please can we put parens around multi-line jsx?

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of stylistic nits which I'd love to see fixed, but realistically we want this in a release today. I've fixed the visible problems, so will land this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants