From cff1c3010b0af2a2b583080aabbe0f686ca67f7e Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 12 Apr 2016 13:18:57 +0100 Subject: [PATCH 1/9] Get & display pushers in settings Really this is so (in a subsequent PR) we can show whether a user has an email pusher, but we can basically display the list of pushers for free, so adding this too. --- .../views/settings/Notifications.js | 38 ++++++++++++++++++- .../views/settings/Notifications.css | 5 +++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js index db066774c5..2cd634b25f 100644 --- a/src/components/views/settings/Notifications.js +++ b/src/components/views/settings/Notifications.js @@ -601,7 +601,7 @@ module.exports = React.createClass({ _refreshFromServer: function() { var self = this; - MatrixClientPeg.get().getPushRules().then(self._portRulesToNewAPI).done(function(rulesets) { + var pushRulesPromise = MatrixClientPeg.get().getPushRules().then(self._portRulesToNewAPI).done(function(rulesets) { MatrixClientPeg.get().pushRules = rulesets; // Get homeserver default rules and triage them by categories @@ -811,10 +811,20 @@ module.exports = React.createClass({ self.state.externalPushRules.push(rule); } } + }); + var pushersPromise = MatrixClientPeg.get().getPushers().then(function(resp) { + self.setState({pushers: resp.pushers}); + }); + + q.all([pushRulesPromise, pushersPromise]).done(function() { self.setState({ phase: self.phases.DISPLAY }); + }, function(error) { + self.setState({ + phase: self.phases.ERROR + }); }); }, @@ -936,6 +946,28 @@ module.exports = React.createClass({ externalRules.push(
  • Notifications on the following keywords follow rules which can’t be displayed here: { externalKeyWords }
  • ); } + var devicesSection; + if (this.state.pushers === undefined) { + devicesSection =
    Unable to fetch device list
    + } else if (this.state.pushers.length == 0) { + devicesSection =
    No devices are push notifications
    + } else { + var rows = []; + for (var i = 0; i < this.state.pushers.length; ++i) { + rows.push( + {this.state.pushers[i].app_display_name} + {this.state.pushers[i].device_display_name} + ); + } + devicesSection = ( + + + + + {rows} +
    ApplicationDevice
    ); + } + var advancedSettings; if (externalRules.length) { advancedSettings = ( @@ -1010,6 +1042,10 @@ module.exports = React.createClass({ +

    Devices

    + + { devicesSection } + { advancedSettings } diff --git a/src/skins/vector/css/vector-web/views/settings/Notifications.css b/src/skins/vector/css/vector-web/views/settings/Notifications.css index 041958af75..7ac8fd1d00 100644 --- a/src/skins/vector/css/vector-web/views/settings/Notifications.css +++ b/src/skins/vector/css/vector-web/views/settings/Notifications.css @@ -60,3 +60,8 @@ limitations under the License. cursor: pointer; color: #76cfa6; } + +.mx_UserSettings_devicesTable td { + padding-left: 20px; + padding-right: 20px; +} From c5524851f307304c133d6cfbfc7f83160cb3085b Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 12 Apr 2016 13:22:58 +0100 Subject: [PATCH 2/9] Comment future possibility for deleting pushers --- src/components/views/settings/Notifications.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js index 2cd634b25f..5f51388f27 100644 --- a/src/components/views/settings/Notifications.js +++ b/src/components/views/settings/Notifications.js @@ -952,6 +952,8 @@ module.exports = React.createClass({ } else if (this.state.pushers.length == 0) { devicesSection =
    No devices are push notifications
    } else { + // It would be great to be able to delete pushers from here too, + // and this wouldn't be hard to add. var rows = []; for (var i = 0; i < this.state.pushers.length; ++i) { rows.push( From 34bdd409539213ca5d3a45002b7b65d67cb797be Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 12 Apr 2016 13:34:10 +0100 Subject: [PATCH 3/9] timestamps are permalinks --- .../vector/css/matrix-react-sdk/views/rooms/EventTile.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css b/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css index f28b576fc8..5316663d4a 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css @@ -158,6 +158,10 @@ limitations under the License. margin-right: 10px; } +.mx_EventTile_msgOption a { + text-decoration: none; +} + .mx_EventTile .mx_MessageTimestamp { display: block; visibility: hidden; From 356a4a4392e9292f04b14aeefd991e470ba31df3 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 12 Apr 2016 14:10:17 +0100 Subject: [PATCH 4/9] Typo and use CSS rather than --- src/components/views/settings/Notifications.js | 4 +++- .../vector/css/vector-web/views/settings/Notifications.css | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js index 5f51388f27..749bc9ae7a 100644 --- a/src/components/views/settings/Notifications.js +++ b/src/components/views/settings/Notifications.js @@ -950,7 +950,9 @@ module.exports = React.createClass({ if (this.state.pushers === undefined) { devicesSection =
    Unable to fetch device list
    } else if (this.state.pushers.length == 0) { - devicesSection =
    No devices are push notifications
    + devicesSection =
    + No devices are receiving push notifications +
    } else { // It would be great to be able to delete pushers from here too, // and this wouldn't be hard to add. diff --git a/src/skins/vector/css/vector-web/views/settings/Notifications.css b/src/skins/vector/css/vector-web/views/settings/Notifications.css index 7ac8fd1d00..f2f400600f 100644 --- a/src/skins/vector/css/vector-web/views/settings/Notifications.css +++ b/src/skins/vector/css/vector-web/views/settings/Notifications.css @@ -65,3 +65,6 @@ limitations under the License. padding-left: 20px; padding-right: 20px; } +.mx_UserSettings_devicesTable_nodevices { + font-style: italic; +} From 05e963d1e2acc8b43c1ec5d00bd8b3190f6e2725 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 12 Apr 2016 17:17:08 +0100 Subject: [PATCH 5/9] make the UI fadable to help with decluttering --- src/components/structures/LeftPanel.js | 4 ++-- src/components/structures/RightPanel.js | 4 ++-- src/skins/vector/css/common.css | 9 +++++++++ .../vector/css/matrix-react-sdk/structures/RoomView.css | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js index 0e13f39e4a..5c27abc58e 100644 --- a/src/components/structures/LeftPanel.js +++ b/src/components/structures/LeftPanel.js @@ -89,7 +89,7 @@ var LeftPanel = React.createClass({ var BottomLeftMenu = sdk.getComponent('structures.BottomLeftMenu'); var collapseButton; - var classes = "mx_LeftPanel"; + var classes = "mx_LeftPanel mx_fadable"; if (this.props.collapsed) { classes += " collapsed"; } @@ -109,7 +109,7 @@ var LeftPanel = React.createClass({ } return ( -