From 127fcf58a998158dae3899418dd96e1bfbc1f2e7 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 15 Oct 2018 13:57:06 +0200 Subject: [PATCH 01/10] add missing sticker translation --- src/i18n/strings/en_EN.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 338f744a9f..00b4051c9e 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1265,5 +1265,6 @@ "You've previously used Riot on %(host)s with lazy loading of members enabled. In this version lazy loading is disabled. As the local cache is not compatible between these two settings, Riot needs to resync your account.": "You've previously used Riot on %(host)s with lazy loading of members enabled. In this version lazy loading is disabled. As the local cache is not compatible between these two settings, Riot needs to resync your account.", "If the other version of Riot is still open in another tab, please close it as using Riot on the same host with both lazy loading enabled and disabled simultaneously will cause issues.": "If the other version of Riot is still open in another tab, please close it as using Riot on the same host with both lazy loading enabled and disabled simultaneously will cause issues.", "Incompatible local cache": "Incompatible local cache", - "Clear cache and resync": "Clear cache and resync" + "Clear cache and resync": "Clear cache and resync", + "Add some now": "Add some now" } From 94aac62f255859a95d22b813e4e1004dca21449c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 15 Oct 2018 14:26:02 -0600 Subject: [PATCH 02/10] Move the login box from the left sidebar to where the composer is Fixes https://github.com/vector-im/riot-web/issues/4227 This includes removing the collapse button that isn't needed anymore. --- res/css/structures/_LoginBox.scss | 1 + src/components/structures/LeftPanel.js | 10 +---- src/components/structures/LoginBox.js | 62 ++++++-------------------- src/components/structures/RoomView.js | 7 ++- 4 files changed, 22 insertions(+), 58 deletions(-) diff --git a/res/css/structures/_LoginBox.scss b/res/css/structures/_LoginBox.scss index 7f6199c451..0a3e21a980 100644 --- a/res/css/structures/_LoginBox.scss +++ b/res/css/structures/_LoginBox.scss @@ -19,6 +19,7 @@ limitations under the License. height: unset !important; padding-top: 13px !important; padding-bottom: 14px !important; + order: 4; } .mx_LoginBox_loginButton_wrapper { diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js index ebe5d7f507..72d640bcac 100644 --- a/src/components/structures/LeftPanel.js +++ b/src/components/structures/LeftPanel.js @@ -181,14 +181,8 @@ var LeftPanel = React.createClass({ const BottomLeftMenu = sdk.getComponent('structures.BottomLeftMenu'); const CallPreview = sdk.getComponent('voip.CallPreview'); - let topBox; - if (this.context.matrixClient.isGuest()) { - const LoginBox = sdk.getComponent('structures.LoginBox'); - topBox = ; - } else { - const SearchBox = sdk.getComponent('structures.SearchBox'); - topBox = ; - } + const SearchBox = sdk.getComponent('structures.SearchBox'); + const topBox = ; const classes = classNames( "mx_LeftPanel", diff --git a/src/components/structures/LoginBox.js b/src/components/structures/LoginBox.js index a9ea1f95c6..a2269706ee 100644 --- a/src/components/structures/LoginBox.js +++ b/src/components/structures/LoginBox.js @@ -1,5 +1,6 @@ /* Copyright 2017 Vector Creations Ltd +Copyright 2018 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,31 +17,15 @@ limitations under the License. 'use strict'; -var React = require('react'); +const React = require('react'); import { _t } from '../../languageHandler'; -var sdk = require('../../index') -var dis = require('../../dispatcher'); -var rate_limited_func = require('../../ratelimitedfunc'); -var AccessibleButton = require('../../components/views/elements/AccessibleButton'); +const dis = require('../../dispatcher'); +const AccessibleButton = require('../../components/views/elements/AccessibleButton'); module.exports = React.createClass({ displayName: 'LoginBox', propTypes: { - collapsed: React.PropTypes.bool, - }, - - onToggleCollapse: function(show) { - if (show) { - dis.dispatch({ - action: 'show_left_panel', - }); - } - else { - dis.dispatch({ - action: 'hide_left_panel', - }); - } }, onLoginClick: function() { @@ -52,41 +37,20 @@ module.exports = React.createClass({ }, render: function() { - var TintableSvg = sdk.getComponent('elements.TintableSvg'); - - var toggleCollapse; - if (this.props.collapsed) { - toggleCollapse = - - + const loginButton = ( +
+ + { _t("Login") } - } - else { - toggleCollapse = - - + + { _t("Register") } - } +
+ ); - var loginButton; - if (!this.props.collapsed) { - loginButton = ( -
- - { _t("Login") } - - - { _t("Register") } - -
- ); - } - - var self = this; return ( -
+
{ loginButton } - { toggleCollapse }
); } diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 32121d6de5..62c596e939 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -1669,7 +1669,7 @@ module.exports = React.createClass({ let messageComposer, searchInfo; const canSpeak = ( // joined and not showing search results - myMembership == 'join' && !this.state.searchResults + myMembership === 'join' && !this.state.searchResults ); if (canSpeak) { messageComposer = @@ -1683,6 +1683,11 @@ module.exports = React.createClass({ />; } + if (MatrixClientPeg.get().isGuest()) { + const LoginBox = sdk.getComponent('structures.LoginBox'); + messageComposer = ; + } + // TODO: Why aren't we storing the term/scope/count in this format // in this.state if this is what RoomHeader desires? if (this.state.searchResults) { From af8dfda9a7a78873d5e0b7f5aede5cd266ed270c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 17 Oct 2018 13:53:12 -0600 Subject: [PATCH 03/10] Add a bit of text to explain the purpose of the RoomPreviewSpinner Fixes https://github.com/vector-im/riot-web/issues/5869 --- res/css/views/rooms/_RoomPreviewBar.scss | 4 ++++ src/components/structures/RoomView.js | 3 +++ src/components/views/rooms/RoomPreviewBar.js | 11 ++++++++++- src/i18n/strings/en_EN.json | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/res/css/views/rooms/_RoomPreviewBar.scss b/res/css/views/rooms/_RoomPreviewBar.scss index 331eb582ea..8196740499 100644 --- a/res/css/views/rooms/_RoomPreviewBar.scss +++ b/res/css/views/rooms/_RoomPreviewBar.scss @@ -56,3 +56,7 @@ limitations under the License. .mx_RoomPreviewBar_warningIcon { padding: 12px; } + +.mx_RoomPreviewBar_spinnerIntro { + margin-top: 50px; +} \ No newline at end of file diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 8e226bdfcf..52264266a8 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -1514,6 +1514,7 @@ module.exports = React.createClass({ canPreview={false} error={this.state.roomLoadError} roomAlias={roomAlias} spinner={this.state.joining} + spinnerState="joining" inviterName={inviterName} invitedEmail={invitedEmail} room={this.state.room} @@ -1558,6 +1559,7 @@ module.exports = React.createClass({ inviterName={inviterName} canPreview={false} spinner={this.state.joining} + spinnerState="joining" room={this.state.room} />
@@ -1645,6 +1647,7 @@ module.exports = React.createClass({ onForgetClick={this.onForgetClick} onRejectClick={this.onRejectThreepidInviteButtonClicked} spinner={this.state.joining} + spinnerState="joining" inviterName={inviterName} invitedEmail={invitedEmail} canPreview={this.state.canPeek} diff --git a/src/components/views/rooms/RoomPreviewBar.js b/src/components/views/rooms/RoomPreviewBar.js index 5ec19d185e..9d3dbe5217 100644 --- a/src/components/views/rooms/RoomPreviewBar.js +++ b/src/components/views/rooms/RoomPreviewBar.js @@ -44,9 +44,13 @@ module.exports = React.createClass({ error: PropTypes.object, canPreview: PropTypes.bool, - spinner: PropTypes.bool, room: PropTypes.object, + // When a spinner is present, a spinnerState can be specified to indicate the + // purpose of the spinner. + spinner: PropTypes.bool, + spinnerState: PropTypes.oneOf(["joining"]), + // The alias that was used to access this room, if appropriate // If given, this will be how the room is referred to (eg. // in error messages). @@ -93,7 +97,12 @@ module.exports = React.createClass({ if (this.props.spinner || this.state.busy) { const Spinner = sdk.getComponent("elements.Spinner"); + let spinnerIntro = ""; + if (this.props.spinnerState === "joining") { + spinnerIntro = _t("Joining room..."); + } return (
+

{ spinnerIntro }

); } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index e42d3ce434..e0f4663532 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -512,6 +512,7 @@ "You have no historical rooms": "You have no historical rooms", "Historical": "Historical", "System Alerts": "System Alerts", + "Joining room...": "Joining room...", "Unable to ascertain that the address this invite was sent to matches one associated with your account.": "Unable to ascertain that the address this invite was sent to matches one associated with your account.", "This invitation was sent to an email address which is not associated with this account:": "This invitation was sent to an email address which is not associated with this account:", "You may wish to login with a different account, or add this email to this account.": "You may wish to login with a different account, or add this email to this account.", From fa14d0ed3c2e6f84ab38448faac2c14b51bc3e96 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 15 Oct 2018 14:41:00 -0600 Subject: [PATCH 04/10] Move tinter init to MatrixChat This is a much better place for it to live --- src/components/structures/MatrixChat.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index db5e898946..f385aacd40 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1403,6 +1403,11 @@ export default React.createClass({ break; } }); + + // Fire the tinter right on startup to ensure the default theme is applied + // A later sync can/will correct the tint to be the right value for the user + const color_scheme = SettingsStore.getValue("roomColor"); + Tinter.tint(color_scheme.primary_color, color_scheme.secondary_color); }, /** From 0f592f5887575470f47adcf9b84f02d9441b0bd7 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 19 Oct 2018 16:39:07 +0200 Subject: [PATCH 05/10] Prepare changelog for v0.14.1 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40cb8c5283..00b035ac9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +Changes in [0.14.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.14.1) (2018-10-19) +===================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.14.0...v0.14.1) + + * Apply the user's tint once the MatrixClientPeg is moderately ready + [\#2214](https://github.com/matrix-org/matrix-react-sdk/pull/2214) + Changes in [0.14.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.14.0) (2018-10-16) ===================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.14.0-rc.1...v0.14.0) From 167746f41d891d053643e061a583489f2826755a Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 19 Oct 2018 16:39:08 +0200 Subject: [PATCH 06/10] v0.14.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 93cbcd1c67..38ed26f23c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "0.14.0", + "version": "0.14.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From 49efefa6307e6eb42ac64dfb0a9f7af5e8220b00 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 19 Oct 2018 14:18:05 -0600 Subject: [PATCH 07/10] Fix an error where React doesn't like value=null on a select This only happens when there are no canonical aliases for a room. --- src/components/views/room_settings/AliasSettings.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/room_settings/AliasSettings.js b/src/components/views/room_settings/AliasSettings.js index f9bf52cd24..92a025f10c 100644 --- a/src/components/views/room_settings/AliasSettings.js +++ b/src/components/views/room_settings/AliasSettings.js @@ -220,8 +220,9 @@ module.exports = React.createClass({ let canonical_alias_section; if (this.props.canSetCanonicalAlias) { let found = false; + const canonicalValue = this.state.canonicalAlias || ""; canonical_alias_section = ( - { Object.keys(self.state.domainToAliases).map((domain, i) => { From 9582c1e65a490c7797236b1740332d014a3bd66e Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 19 Oct 2018 15:33:23 -0600 Subject: [PATCH 08/10] Move all dialog buttons to the right and fix their order Fixes https://github.com/vector-im/riot-web/issues/5689 Some dialogs had their own CSS that prevented the buttons from being placed in the right spot. This has been fixed by using a generic standard for the buttons. The only strange dialog that needed more CSS was the devtools dialog due to the header. Not all dialogs have been checked - I spot-checked about half of them and verified the CSS manually on an established account. It's hard to get at all the dialogs without convoluted testing. --- res/css/_common.scss | 5 +++++ res/css/_components.scss | 1 - res/css/views/dialogs/_ChatInviteDialog.scss | 8 -------- res/css/views/dialogs/_DevtoolsDialog.scss | 4 ++++ res/css/views/dialogs/_QuestionDialog.scss | 18 ------------------ src/components/views/dialogs/DevtoolsDialog.js | 4 ++-- src/components/views/elements/DialogButtons.js | 10 +++++----- 7 files changed, 16 insertions(+), 34 deletions(-) delete mode 100644 res/css/views/dialogs/_QuestionDialog.scss diff --git a/res/css/_common.scss b/res/css/_common.scss index 38f576a532..bf67edc1c3 100644 --- a/res/css/_common.scss +++ b/res/css/_common.scss @@ -222,6 +222,11 @@ textarea { word-wrap: break-word; } +.mx_Dialog_buttons { + padding-right: 58px; + text-align: right; +} + .mx_Dialog button, .mx_Dialog input[type="submit"] { @mixin mx_DialogButton; margin-left: 0px; diff --git a/res/css/_components.scss b/res/css/_components.scss index 0e40b40a29..a09f895d5f 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -38,7 +38,6 @@ @import "./views/dialogs/_DevtoolsDialog.scss"; @import "./views/dialogs/_EncryptedEventDialog.scss"; @import "./views/dialogs/_GroupAddressPicker.scss"; -@import "./views/dialogs/_QuestionDialog.scss"; @import "./views/dialogs/_RoomUpgradeDialog.scss"; @import "./views/dialogs/_SetEmailDialog.scss"; @import "./views/dialogs/_SetMxIdDialog.scss"; diff --git a/res/css/views/dialogs/_ChatInviteDialog.scss b/res/css/views/dialogs/_ChatInviteDialog.scss index 6fc211743d..dcc0f5921a 100644 --- a/res/css/views/dialogs/_ChatInviteDialog.scss +++ b/res/css/views/dialogs/_ChatInviteDialog.scss @@ -14,14 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_ChatInviteDialog { - /* XXX: padding-left is on mx_Dialog but padding-right has subsequently - * been added on other dialogs. Surely all our dialogs should have consistent - * right hand padding? - */ - padding-right: 58px; -} - /* Using a textarea for this element, to circumvent autofill */ .mx_ChatInviteDialog_input, .mx_ChatInviteDialog_input:focus diff --git a/res/css/views/dialogs/_DevtoolsDialog.scss b/res/css/views/dialogs/_DevtoolsDialog.scss index a4a868bd11..3764bb13b3 100644 --- a/res/css/views/dialogs/_DevtoolsDialog.scss +++ b/res/css/views/dialogs/_DevtoolsDialog.scss @@ -14,6 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +.mx_DevTools_dialog { + padding-right: 58px; +} + .mx_DevTools_content { margin: 10px 0; } diff --git a/res/css/views/dialogs/_QuestionDialog.scss b/res/css/views/dialogs/_QuestionDialog.scss deleted file mode 100644 index 3d47f17592..0000000000 --- a/res/css/views/dialogs/_QuestionDialog.scss +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 New Vector 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. -*/ -.mx_QuestionDialog { - padding-right: 58px; -} diff --git a/src/components/views/dialogs/DevtoolsDialog.js b/src/components/views/dialogs/DevtoolsDialog.js index ea198461c5..22ee44f81a 100644 --- a/src/components/views/dialogs/DevtoolsDialog.js +++ b/src/components/views/dialogs/DevtoolsDialog.js @@ -625,7 +625,7 @@ export default class DevtoolsDialog extends React.Component { let body; if (this.state.mode) { - body =
+ body =
{ this.state.mode.getLabel() }
Room ID: { this.props.roomId }
@@ -634,7 +634,7 @@ export default class DevtoolsDialog extends React.Component { } else { const classes = "mx_DevTools_RoomStateExplorer_button"; body =
-
+
{ _t('Toolbox') }
Room ID: { this.props.roomId }
diff --git a/src/components/views/elements/DialogButtons.js b/src/components/views/elements/DialogButtons.js index baf831415f..f314588caa 100644 --- a/src/components/views/elements/DialogButtons.js +++ b/src/components/views/elements/DialogButtons.js @@ -70,15 +70,15 @@ module.exports = React.createClass({ } return (
+ { cancelButton } + { this.props.children } - { this.props.children } - { cancelButton }
); }, From 275d88dd4f4f0a7c6fea946518294183b4165858 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 19 Oct 2018 16:22:20 -0600 Subject: [PATCH 09/10] Redirect widgets to another location before deleting them This is so that shutdown hooks in the widget can correctly fire, such as Jitsi's hook to abandon its hold on the webcam. Fixes https://github.com/vector-im/riot-web/issues/7351 --- src/components/views/elements/AppTile.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index 7be0bab33c..71cd65c89f 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -318,6 +318,19 @@ export default class AppTile extends React.Component { } this.setState({deleting: true}); + // HACK: This is a really dirty way to ensure that Jitsi cleans up + // its hold on the webcam. Without this, the widget holds a media + // stream open, even after death. See https://github.com/vector-im/riot-web/issues/7351 + if (this.refs.appFrame) { + // In practice we could just do `+= ''` to trick the browser + // into thinking the URL changed, however I can foresee this + // being optimized out by a browser. Instead, we'll just point + // the iframe at a page that is reasonably safe to use in the + // event the iframe doesn't wink away. + // This is relative to where the Riot instance is located. + this.refs.appFrame.src = '/config.json'; + } + WidgetUtils.setRoomWidget( this.props.room.roomId, this.props.id, From c75beb01963228c21e0b4420caaa909851f555f4 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 19 Oct 2018 16:22:20 -0600 Subject: [PATCH 10/10] Revert "Redirect widgets to another location before deleting them" This reverts commit 275d88dd4f4f0a7c6fea946518294183b4165858. --- src/components/views/elements/AppTile.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index 71cd65c89f..7be0bab33c 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -318,19 +318,6 @@ export default class AppTile extends React.Component { } this.setState({deleting: true}); - // HACK: This is a really dirty way to ensure that Jitsi cleans up - // its hold on the webcam. Without this, the widget holds a media - // stream open, even after death. See https://github.com/vector-im/riot-web/issues/7351 - if (this.refs.appFrame) { - // In practice we could just do `+= ''` to trick the browser - // into thinking the URL changed, however I can foresee this - // being optimized out by a browser. Instead, we'll just point - // the iframe at a page that is reasonably safe to use in the - // event the iframe doesn't wink away. - // This is relative to where the Riot instance is located. - this.refs.appFrame.src = '/config.json'; - } - WidgetUtils.setRoomWidget( this.props.room.roomId, this.props.id,