From 815a126b5644ab913ecee4961b4e64d678a3ed6c Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Fri, 29 Jan 2021 17:23:17 +0000 Subject: [PATCH 01/16] Upgrade matrix-js-sdk to 9.6.0-rc.1 --- package.json | 2 +- yarn.lock | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 014cee02aa..2b3cbe3000 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "katex": "^0.12.0", "linkifyjs": "^2.1.9", "lodash": "^4.17.20", - "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", + "matrix-js-sdk": "9.6.0-rc.1", "matrix-widget-api": "^0.1.0-beta.12", "minimist": "^1.2.5", "pako": "^2.0.3", diff --git a/yarn.lock b/yarn.lock index 83a708f510..3359314305 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5577,9 +5577,10 @@ mathml-tag-names@^2.1.3: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": - version "9.5.1" - resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/7cfbd0da95edc66671e166aa83145b5e17ca76fc" +matrix-js-sdk@9.6.0-rc.1: + version "9.6.0-rc.1" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.6.0-rc.1.tgz#f5dd325b9b5c5b3fdf5199351ab51ecab1b2113c" + integrity sha512-Da5C4uTm7LRfjyb9pM7dbmkwFVVYH8HdjRa7rpaRP9elHwptJmAeoKEzPU5HcPkFFNQbBy11Kq+58IgKcVpwKA== dependencies: "@babel/runtime" "^7.12.5" another-json "^0.2.0" From 9bb906f5d4d3bf7afc53eb50a8911330f97f341c Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Fri, 29 Jan 2021 17:28:25 +0000 Subject: [PATCH 02/16] Prepare changelog for v3.13.0-rc.1 --- CHANGELOG.md | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 589121dca6..18f2c1a421 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,103 @@ +Changes in [3.13.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.13.0-rc.1) (2021-01-29) +=============================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.12.1...v3.13.0-rc.1) + + * Upgrade to JS SDK 9.6.0-rc.1 + * Translations update from Weblate + [\#5597](https://github.com/matrix-org/matrix-react-sdk/pull/5597) + * Support managed hybrid widgets from config + [\#5596](https://github.com/matrix-org/matrix-react-sdk/pull/5596) + * Add managed hybrid call widgets when supported + [\#5594](https://github.com/matrix-org/matrix-react-sdk/pull/5594) + * Tweak mobile guide toast copy + [\#5595](https://github.com/matrix-org/matrix-react-sdk/pull/5595) + * Improve SSO auth flow + [\#5578](https://github.com/matrix-org/matrix-react-sdk/pull/5578) + * Add optional mobile guide toast + [\#5586](https://github.com/matrix-org/matrix-react-sdk/pull/5586) + * Fix invisible text after logging out in the dark theme + [\#5588](https://github.com/matrix-org/matrix-react-sdk/pull/5588) + * Fix escape for cancelling replies + [\#5591](https://github.com/matrix-org/matrix-react-sdk/pull/5591) + * Update widget-api to beta.12 + [\#5589](https://github.com/matrix-org/matrix-react-sdk/pull/5589) + * Add commands for DM conversion + [\#5540](https://github.com/matrix-org/matrix-react-sdk/pull/5540) + * Run a UI refresh over the OIDC Exchange confirmation dialog + [\#5580](https://github.com/matrix-org/matrix-react-sdk/pull/5580) + * Allow stickerpickers the legacy "visibility" capability + [\#5581](https://github.com/matrix-org/matrix-react-sdk/pull/5581) + * Hide local video if it is muted + [\#5529](https://github.com/matrix-org/matrix-react-sdk/pull/5529) + * Don't use name width in reply thread for IRC layout + [\#5518](https://github.com/matrix-org/matrix-react-sdk/pull/5518) + * Update code_style.md + [\#5554](https://github.com/matrix-org/matrix-react-sdk/pull/5554) + * Fix Czech capital letters like ŠČŘ... + [\#5569](https://github.com/matrix-org/matrix-react-sdk/pull/5569) + * Add optional search shortcut + [\#5548](https://github.com/matrix-org/matrix-react-sdk/pull/5548) + * Fix Sudden 'find a room' UI shows up when the only room moves to favourites + [\#5584](https://github.com/matrix-org/matrix-react-sdk/pull/5584) + * Increase PersistedElement's z-index + [\#5568](https://github.com/matrix-org/matrix-react-sdk/pull/5568) + * Remove check that prevents Jitsi widgets from being unpinned + [\#5582](https://github.com/matrix-org/matrix-react-sdk/pull/5582) + * Fix Jitsi widgets causing localized tile crashes + [\#5583](https://github.com/matrix-org/matrix-react-sdk/pull/5583) + * Log candidates for calls + [\#5573](https://github.com/matrix-org/matrix-react-sdk/pull/5573) + * Upgrade deps 2021-01 + [\#5579](https://github.com/matrix-org/matrix-react-sdk/pull/5579) + * Fix "Continuing without email" dialog bug + [\#5566](https://github.com/matrix-org/matrix-react-sdk/pull/5566) + * Require registration for verification actions + [\#5574](https://github.com/matrix-org/matrix-react-sdk/pull/5574) + * Don't play the hangup sound when the call is answered from elsewhere + [\#5572](https://github.com/matrix-org/matrix-react-sdk/pull/5572) + * Move to newer base image for end-to-end tests + [\#5570](https://github.com/matrix-org/matrix-react-sdk/pull/5570) + * Update widgets in the room upon join + [\#5564](https://github.com/matrix-org/matrix-react-sdk/pull/5564) + * Update AuxPanel and related buttons when widgets change or on reload + [\#5563](https://github.com/matrix-org/matrix-react-sdk/pull/5563) + * Add VoIP user mapper + [\#5560](https://github.com/matrix-org/matrix-react-sdk/pull/5560) + * Improve styling of SSO Buttons for multiple IdPs + [\#5558](https://github.com/matrix-org/matrix-react-sdk/pull/5558) + * Fixes for the general tab in the room dialog + [\#5522](https://github.com/matrix-org/matrix-react-sdk/pull/5522) + * fix issue 16226 to allow switching back to default HS. + [\#5561](https://github.com/matrix-org/matrix-react-sdk/pull/5561) + * Support room-defined widget layouts + [\#5553](https://github.com/matrix-org/matrix-react-sdk/pull/5553) + * Change a bunch of strings from Recovery Key/Phrase to Security Key/Phrase + [\#5533](https://github.com/matrix-org/matrix-react-sdk/pull/5533) + * Give a bigger target area to AppsDrawer vertical resizer + [\#5557](https://github.com/matrix-org/matrix-react-sdk/pull/5557) + * Fix minimized left panel avatar alignment + [\#5493](https://github.com/matrix-org/matrix-react-sdk/pull/5493) + * Ensure component index has been written before renaming + [\#5556](https://github.com/matrix-org/matrix-react-sdk/pull/5556) + * Fixed continue button while selecting home-server + [\#5552](https://github.com/matrix-org/matrix-react-sdk/pull/5552) + * Wire up MSC2931 widget navigation + [\#5527](https://github.com/matrix-org/matrix-react-sdk/pull/5527) + * Various fixes for Bridge Info page (MSC2346) + [\#5454](https://github.com/matrix-org/matrix-react-sdk/pull/5454) + * Use room-specific listeners for message preview and community prototype + [\#5547](https://github.com/matrix-org/matrix-react-sdk/pull/5547) + * Fix some misc. React warnings when viewing timeline + [\#5546](https://github.com/matrix-org/matrix-react-sdk/pull/5546) + * Use device storage for allowed widgets if account data not supported + [\#5544](https://github.com/matrix-org/matrix-react-sdk/pull/5544) + * Fix incoming call box on dark theme + [\#5542](https://github.com/matrix-org/matrix-react-sdk/pull/5542) + * Convert DMRoomMap to typescript + [\#5541](https://github.com/matrix-org/matrix-react-sdk/pull/5541) + * Add in-call dialpad for DTMF sending + [\#5532](https://github.com/matrix-org/matrix-react-sdk/pull/5532) + Changes in [3.12.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.12.1) (2021-01-26) ===================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.12.0...v3.12.1) From 7494a949087679da22c6c47564e23e6a1e048188 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Fri, 29 Jan 2021 17:28:26 +0000 Subject: [PATCH 03/16] v3.13.0-rc.1 --- package.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2b3cbe3000..dab253442c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.12.1", + "version": "3.13.0-rc.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { @@ -27,7 +27,7 @@ "matrix-gen-i18n": "scripts/gen-i18n.js", "matrix-prune-i18n": "scripts/prune-i18n.js" }, - "main": "./src/index.js", + "main": "./lib/index.js", "matrix_src_main": "./src/index.js", "matrix_lib_main": "./lib/index.js", "matrix_lib_typings": "./lib/index.d.ts", @@ -190,5 +190,6 @@ "transformIgnorePatterns": [ "/node_modules/(?!matrix-js-sdk).+$" ] - } + }, + "typings": "./lib/index.d.ts" } From 077ceeb20d7d14e87bac316426b8f8c7025748d9 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 31 Jan 2021 16:09:11 +0000 Subject: [PATCH 04/16] Fix RoomView re-mounting breaking peeking Because as of React 16 order of unmount & re-mount is undefined this was causing the possibility of the unmount running after the willMount of the replacement RoomView, upsetting the state of the singleton inside the js-sdk. --- src/components/structures/RoomView.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/structures/RoomView.tsx b/src/components/structures/RoomView.tsx index 5ab403a75c..7b72b7f33f 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -267,12 +267,6 @@ export default class RoomView extends React.Component { this.layoutWatcherRef = SettingsStore.watchSetting("useIRCLayout", null, this.onLayoutChange); } - // TODO: [REACT-WARNING] Move into constructor - // eslint-disable-next-line camelcase - UNSAFE_componentWillMount() { - this.onRoomViewStoreUpdate(true); - } - private onWidgetStoreUpdate = () => { if (this.state.room) { this.checkWidgets(this.state.room); @@ -512,6 +506,8 @@ export default class RoomView extends React.Component { } componentDidMount() { + this.onRoomViewStoreUpdate(true); + const call = this.getCallForRoom(); const callState = call ? call.state : null; this.setState({ From bad71cf52f12267f46c6e3a285e785164c67b7d1 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 1 Feb 2021 16:25:50 +0000 Subject: [PATCH 05/16] Better errors for SSO failures --- src/BasePlatform.ts | 4 +++ src/Lifecycle.ts | 38 ++++++++++++++++++--- src/components/structures/MatrixChat.tsx | 1 + src/components/views/dialogs/ErrorDialog.js | 6 +++- src/i18n/strings/en_EN.json | 5 +++ 5 files changed, 49 insertions(+), 5 deletions(-) diff --git a/src/BasePlatform.ts b/src/BasePlatform.ts index 927de5a0a8..d0d5e60ce8 100644 --- a/src/BasePlatform.ts +++ b/src/BasePlatform.ts @@ -30,6 +30,7 @@ import {idbLoad, idbSave, idbDelete} from "./utils/StorageManager"; export const SSO_HOMESERVER_URL_KEY = "mx_sso_hs_url"; export const SSO_ID_SERVER_URL_KEY = "mx_sso_is_url"; +export const SSO_IDP_ID_KEY = "mx_sso_idp_id"; export enum UpdateCheckStatus { Checking = "CHECKING", @@ -258,6 +259,9 @@ export default abstract class BasePlatform { if (mxClient.getIdentityServerUrl()) { localStorage.setItem(SSO_ID_SERVER_URL_KEY, mxClient.getIdentityServerUrl()); } + if (idpId) { + localStorage.setItem(SSO_IDP_ID_KEY, idpId); + } const callbackUrl = this.getSSOCallbackUrl(fragmentAfterLogin); window.location.href = mxClient.getSsoLoginUrl(callbackUrl.toString(), loginType, idpId); // redirect to SSO } diff --git a/src/Lifecycle.ts b/src/Lifecycle.ts index 4602f2b5bb..a4519309af 100644 --- a/src/Lifecycle.ts +++ b/src/Lifecycle.ts @@ -46,11 +46,13 @@ import {IntegrationManagers} from "./integrations/IntegrationManagers"; import {Mjolnir} from "./mjolnir/Mjolnir"; import DeviceListener from "./DeviceListener"; import {Jitsi} from "./widgets/Jitsi"; -import {SSO_HOMESERVER_URL_KEY, SSO_ID_SERVER_URL_KEY} from "./BasePlatform"; +import {SSO_HOMESERVER_URL_KEY, SSO_ID_SERVER_URL_KEY, SSO_IDP_ID_KEY} from "./BasePlatform"; import ThreepidInviteStore from "./stores/ThreepidInviteStore"; import CountlyAnalytics from "./CountlyAnalytics"; import CallHandler from './CallHandler'; import LifecycleCustomisations from "./customisations/Lifecycle"; +import ErrorDialog from "./components/views/dialogs/ErrorDialog"; +import {_t} from "./languageHandler"; const HOMESERVER_URL_KEY = "mx_hs_url"; const ID_SERVER_URL_KEY = "mx_is_url"; @@ -162,7 +164,8 @@ export async function getStoredSessionOwner(): Promise<[string, boolean]> { * query-parameters extracted from the real query-string of the starting * URI. * - * @param {String} defaultDeviceDisplayName + * @param {string} defaultDeviceDisplayName + * @param {string} fragmentAfterLogin path to go to after a successful login, only used for "Try again" * * @returns {Promise} promise which resolves to true if we completed the token * login, else false @@ -170,6 +173,7 @@ export async function getStoredSessionOwner(): Promise<[string, boolean]> { export function attemptTokenLogin( queryParams: Record, defaultDeviceDisplayName?: string, + fragmentAfterLogin?: string, ): Promise { if (!queryParams.loginToken) { return Promise.resolve(false); @@ -179,6 +183,12 @@ export function attemptTokenLogin( const identityServer = localStorage.getItem(SSO_ID_SERVER_URL_KEY); if (!homeserver) { console.warn("Cannot log in with token: can't determine HS URL to use"); + Modal.createTrackedDialog("SSO", "Unknown HS", ErrorDialog, { + title: _t("We couldn't log you in"), + description: _t("We asked the browser to remember which homeserver you use, to let you sign in. " + + "Unfortunately your browser has forgotten in. Go to the sign in page and try again."), + button: _t("Try again"), + }); return Promise.resolve(false); } @@ -198,8 +208,28 @@ export function attemptTokenLogin( return true; }); }).catch((err) => { - console.error("Failed to log in with login token: " + err + " " + - err.data); + Modal.createTrackedDialog("SSO", "Token Rejected", ErrorDialog, { + title: _t("We couldn't log you in"), + description: err.name === "ConnectionError" + ? _t("Your homeserver was unreachable and was not able to log you in. Please try again. " + + "If this continues, please contact your homeserver administrator.") + : _t("Your homeserver rejected your log in attempt. " + + "This could be due to things just taking too long. Please try again. " + + "If this continues, please contact your homeserver administrator."), + button: _t("Try again"), + onFinished: tryAgain => { + if (tryAgain) { + const cli = Matrix.createClient({ + baseUrl: homeserver, + idBaseUrl: identityServer, + }); + const idpId = localStorage.getItem(SSO_IDP_ID_KEY) || undefined; + PlatformPeg.get().startSingleSignOn(cli, "sso", fragmentAfterLogin, idpId); + } + }, + }); + console.error("Failed to log in with login token:"); + console.error(err); return false; }); } diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 2c652f7c8c..8ed4b6cd11 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -325,6 +325,7 @@ export default class MatrixChat extends React.PureComponent { Lifecycle.attemptTokenLogin( this.props.realQueryParams, this.props.defaultDeviceDisplayName, + this.getFragmentAfterLogin(), ).then(async (loggedIn) => { if (this.props.realQueryParams?.loginToken) { // remove the loginToken from the URL regardless diff --git a/src/components/views/dialogs/ErrorDialog.js b/src/components/views/dialogs/ErrorDialog.js index acebdcd854..3bfa635adf 100644 --- a/src/components/views/dialogs/ErrorDialog.js +++ b/src/components/views/dialogs/ErrorDialog.js @@ -50,6 +50,10 @@ export default class ErrorDialog extends React.Component { button: null, }; + onClick = () => { + this.props.onFinished(true); + }; + render() { const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); return ( @@ -64,7 +68,7 @@ export default class ErrorDialog extends React.Component { { this.props.description || _t('An error has occurred.') }
-
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 06b1023a51..37645aeb00 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -118,6 +118,11 @@ "This action requires accessing the default identity server to validate an email address or phone number, but the server does not have any terms of service.": "This action requires accessing the default identity server to validate an email address or phone number, but the server does not have any terms of service.", "Only continue if you trust the owner of the server.": "Only continue if you trust the owner of the server.", "Trust": "Trust", + "We couldn't log you in": "We couldn't log you in", + "We asked the browser to remember which homeserver you use, to let you sign in. Unfortunately your browser has forgotten in. Go to the sign in page and try again.": "We asked the browser to remember which homeserver you use, to let you sign in. Unfortunately your browser has forgotten in. Go to the sign in page and try again.", + "Try again": "Try again", + "Your homeserver was unreachable and was not able to log you in. Please try again. If this continues, please contact your homeserver administrator.": "Your homeserver was unreachable and was not able to log you in. Please try again. If this continues, please contact your homeserver administrator.", + "Your homeserver rejected your log in attempt. This could be due to things just taking too long. Please try again. If this continues, please contact your homeserver administrator.": "Your homeserver rejected your log in attempt. This could be due to things just taking too long. Please try again. If this continues, please contact your homeserver administrator.", "%(name)s is requesting verification": "%(name)s is requesting verification", "%(brand)s does not have permission to send you notifications - please check your browser settings": "%(brand)s does not have permission to send you notifications - please check your browser settings", "%(brand)s was not given permission to send notifications - please try again": "%(brand)s was not given permission to send notifications - please try again", From f8f9b4e390aaca5ab90319b8ea670ddcf0010b49 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 2 Feb 2021 12:58:31 +0000 Subject: [PATCH 06/16] Update src/Lifecycle.ts Co-authored-by: J. Ryan Stinnett --- src/Lifecycle.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Lifecycle.ts b/src/Lifecycle.ts index a4519309af..7780d4c87a 100644 --- a/src/Lifecycle.ts +++ b/src/Lifecycle.ts @@ -185,8 +185,8 @@ export function attemptTokenLogin( console.warn("Cannot log in with token: can't determine HS URL to use"); Modal.createTrackedDialog("SSO", "Unknown HS", ErrorDialog, { title: _t("We couldn't log you in"), - description: _t("We asked the browser to remember which homeserver you use, to let you sign in. " + - "Unfortunately your browser has forgotten in. Go to the sign in page and try again."), + description: _t("We asked the browser to remember which homeserver you use to let you sign in, " + + "but unfortunately your browser has forgotten it. Go to the sign in page and try again."), button: _t("Try again"), }); return Promise.resolve(false); From 10ffac9f41cb5e8814eedb87bdff4e21d1281010 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 2 Feb 2021 13:01:57 +0000 Subject: [PATCH 07/16] i18n --- src/i18n/strings/en_EN.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 37645aeb00..823efd1adf 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -119,7 +119,7 @@ "Only continue if you trust the owner of the server.": "Only continue if you trust the owner of the server.", "Trust": "Trust", "We couldn't log you in": "We couldn't log you in", - "We asked the browser to remember which homeserver you use, to let you sign in. Unfortunately your browser has forgotten in. Go to the sign in page and try again.": "We asked the browser to remember which homeserver you use, to let you sign in. Unfortunately your browser has forgotten in. Go to the sign in page and try again.", + "We asked the browser to remember which homeserver you use to let you sign in, but unfortunately your browser has forgotten it. Go to the sign in page and try again.": "We asked the browser to remember which homeserver you use to let you sign in, but unfortunately your browser has forgotten it. Go to the sign in page and try again.", "Try again": "Try again", "Your homeserver was unreachable and was not able to log you in. Please try again. If this continues, please contact your homeserver administrator.": "Your homeserver was unreachable and was not able to log you in. Please try again. If this continues, please contact your homeserver administrator.", "Your homeserver rejected your log in attempt. This could be due to things just taking too long. Please try again. If this continues, please contact your homeserver administrator.": "Your homeserver rejected your log in attempt. This could be due to things just taking too long. Please try again. If this continues, please contact your homeserver administrator.", From 14f9a529b8ad303a94c2f7c75abe6fef0e9f212d Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 2 Feb 2021 14:22:28 +0000 Subject: [PATCH 08/16] Lock widget room ID when added This changes the widget room ID available to widget URL templates so that it's locked to the room the widget was added in. Fixes https://github.com/vector-im/element-web/issues/16337 --- src/components/views/dialogs/ModalWidgetDialog.tsx | 4 ++-- src/stores/ModalWidgetStore.ts | 7 ++++++- src/stores/widgets/StopGapWidget.ts | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/views/dialogs/ModalWidgetDialog.tsx b/src/components/views/dialogs/ModalWidgetDialog.tsx index 484e8f0dcf..92fb406965 100644 --- a/src/components/views/dialogs/ModalWidgetDialog.tsx +++ b/src/components/views/dialogs/ModalWidgetDialog.tsx @@ -35,13 +35,13 @@ import { } from "matrix-widget-api"; import {StopGapWidgetDriver} from "../../../stores/widgets/StopGapWidgetDriver"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; -import RoomViewStore from "../../../stores/RoomViewStore"; import {OwnProfileStore} from "../../../stores/OwnProfileStore"; import { arrayFastClone } from "../../../utils/arrays"; import { ElementWidget } from "../../../stores/widgets/StopGapWidget"; interface IProps { widgetDefinition: IModalWidgetOpenRequestData; + widgetRoomId?: string; sourceWidgetId: string; onFinished(success: boolean, data?: IModalWidgetReturnData): void; } @@ -123,7 +123,7 @@ export default class ModalWidgetDialog extends React.PureComponent { return !this.modalInstance; }; - public openModalWidget = (requestData: IModalWidgetOpenRequestData, sourceWidget: Widget) => { + public openModalWidget = ( + requestData: IModalWidgetOpenRequestData, + sourceWidget: Widget, + widgetRoomId?: string, + ) => { if (this.modalInstance) return; this.openSourceWidgetId = sourceWidget.id; this.modalInstance = Modal.createTrackedDialog('Modal Widget', '', ModalWidgetDialog, { widgetDefinition: {...requestData}, + widgetRoomId, sourceWidgetId: sourceWidget.id, onFinished: (success: boolean, data?: IModalWidgetReturnData) => { if (!success) { diff --git a/src/stores/widgets/StopGapWidget.ts b/src/stores/widgets/StopGapWidget.ts index cc2934aec1..17371d6d45 100644 --- a/src/stores/widgets/StopGapWidget.ts +++ b/src/stores/widgets/StopGapWidget.ts @@ -190,7 +190,7 @@ export class StopGapWidget extends EventEmitter { private runUrlTemplate(opts = {asPopout: false}): string { const templated = this.mockWidget.getCompleteUrl({ - currentRoomId: RoomViewStore.getRoomId(), + widgetRoomId: this.roomId, currentUserId: MatrixClientPeg.get().getUserId(), userDisplayName: OwnProfileStore.instance.displayName, userHttpAvatarUrl: OwnProfileStore.instance.getHttpAvatarUrl(), From ad2a18756606523bda9ff5126b0ce09bb5f3768d Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 2 Feb 2021 14:42:10 +0000 Subject: [PATCH 09/16] Upgrade matrix-widget-api --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index dab253442c..f616e76c61 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "linkifyjs": "^2.1.9", "lodash": "^4.17.20", "matrix-js-sdk": "9.6.0-rc.1", - "matrix-widget-api": "^0.1.0-beta.12", + "matrix-widget-api": "^0.1.0-beta.13", "minimist": "^1.2.5", "pako": "^2.0.3", "parse5": "^6.0.1", diff --git a/yarn.lock b/yarn.lock index 3359314305..88376bcad0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5605,10 +5605,10 @@ matrix-react-test-utils@^0.2.2: resolved "https://registry.yarnpkg.com/matrix-react-test-utils/-/matrix-react-test-utils-0.2.2.tgz#c87144d3b910c7edc544a6699d13c7c2bf02f853" integrity sha512-49+7gfV6smvBIVbeloql+37IeWMTD+fiywalwCqk8Dnz53zAFjKSltB3rmWHso1uecLtQEcPtCijfhzcLXAxTQ== -matrix-widget-api@^0.1.0-beta.12: - version "0.1.0-beta.12" - resolved "https://registry.yarnpkg.com/matrix-widget-api/-/matrix-widget-api-0.1.0-beta.12.tgz#6cadeabde14f02949b7c3177434a4755942559b8" - integrity sha512-43xVAzLYzddYF73r6NK7NZ3geDLshQqCNAAcv0t5LFyFkKYGWDQG/cg8Vn8d37wm9WVBqYZUOXy9vBD4JcWVPA== +matrix-widget-api@^0.1.0-beta.13: + version "0.1.0-beta.13" + resolved "https://registry.yarnpkg.com/matrix-widget-api/-/matrix-widget-api-0.1.0-beta.13.tgz#ebddc83eaef39bbb87b621a02a35902e1a29b9ef" + integrity sha512-DJAvuX2E7gxc/a9rtJPDh17ba9xGIOAoBHcWirNTN3KGodzsrZ+Ns+M/BREFWMwGS5yEBZko5eq7uhXStEbnyQ== dependencies: "@types/events" "^3.0.0" events "^3.2.0" From f383c42be3c33f49ac60f9262d6ef76def232dc0 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 2 Feb 2021 17:19:18 +0000 Subject: [PATCH 10/16] Update SSO Facebook social branding to match guidelines --- res/css/views/elements/_SSOButtons.scss | 5 ----- res/img/element-icons/brands/facebook.svg | 9 +++++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/res/css/views/elements/_SSOButtons.scss b/res/css/views/elements/_SSOButtons.scss index add048efb0..e223a0a70f 100644 --- a/res/css/views/elements/_SSOButtons.scss +++ b/res/css/views/elements/_SSOButtons.scss @@ -73,11 +73,6 @@ limitations under the License. } } -.mx_SSOButton.mx_SSOButton_brand_facebook { - background-color: #3c5a99; - border-color: #3c5a99; - color: #ffffff; -} .mx_SSOButton.mx_SSOButton_brand_twitter { background-color: #47acdf; border-color: #47acdf; diff --git a/res/img/element-icons/brands/facebook.svg b/res/img/element-icons/brands/facebook.svg index 087ddacdff..2742785424 100644 --- a/res/img/element-icons/brands/facebook.svg +++ b/res/img/element-icons/brands/facebook.svg @@ -1,4 +1,9 @@ - - + + + + + + + From 842fe36c7e7ae524fe8ede8f80a2750db49d7fca Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 2 Feb 2021 17:28:52 +0000 Subject: [PATCH 11/16] Fix register exploding if the server is down or we just don't have flows --- src/components/structures/auth/Login.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/auth/Login.tsx b/src/components/structures/auth/Login.tsx index 606aeb44ab..a217f1b4d9 100644 --- a/src/components/structures/auth/Login.tsx +++ b/src/components/structures/auth/Login.tsx @@ -340,8 +340,8 @@ export default class LoginComponent extends React.PureComponent }; onTryRegisterClick = ev => { - const hasPasswordFlow = this.state.flows.find(flow => flow.type === "m.login.password"); - const ssoFlow = this.state.flows.find(flow => flow.type === "m.login.sso" || flow.type === "m.login.cas"); + const hasPasswordFlow = this.state.flows?.find(flow => flow.type === "m.login.password"); + const ssoFlow = this.state.flows?.find(flow => flow.type === "m.login.sso" || flow.type === "m.login.cas"); // If has no password flow but an SSO flow guess that the user wants to register with SSO. // TODO: instead hide the Register button if registration is disabled by checking with the server, // has no specific errCode currently and uses M_FORBIDDEN. From b83de3301be4ff096419c2f2672c58fe3c010119 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 2 Feb 2021 17:29:19 +0000 Subject: [PATCH 12/16] Update SSO Twitter social branding to match guidelines --- res/css/views/elements/_SSOButtons.scss | 6 ------ res/img/element-icons/brands/twitter.svg | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/res/css/views/elements/_SSOButtons.scss b/res/css/views/elements/_SSOButtons.scss index e223a0a70f..e02816780f 100644 --- a/res/css/views/elements/_SSOButtons.scss +++ b/res/css/views/elements/_SSOButtons.scss @@ -72,9 +72,3 @@ limitations under the License. } } } - -.mx_SSOButton.mx_SSOButton_brand_twitter { - background-color: #47acdf; - border-color: #47acdf; - color: #ffffff; -} diff --git a/res/img/element-icons/brands/twitter.svg b/res/img/element-icons/brands/twitter.svg index 4fc3d2f2a2..43eb825a59 100644 --- a/res/img/element-icons/brands/twitter.svg +++ b/res/img/element-icons/brands/twitter.svg @@ -1,3 +1,3 @@ - + From 4136a62be2fd1cac151220316ff2b62b396376c2 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 2 Feb 2021 17:48:37 +0000 Subject: [PATCH 13/16] Fix flair height after accent changes The accent changes in https://github.com/matrix-org/matrix-react-sdk/pull/5569 led to a regression in flair display where the bottom edge was clipped. Fixes https://github.com/vector-im/element-web/issues/16350 Regressed by https://github.com/matrix-org/matrix-react-sdk/pull/5569 --- res/css/views/rooms/_EventTile.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index 429ac7ed4b..acf3049804 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -74,7 +74,6 @@ $left-gutter: 64px; margin-left: 5px; display: inline-block; vertical-align: top; - height: 16px; overflow: hidden; user-select: none; From 41c18d0d249288d60283a740c18f23913d16ec95 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 3 Feb 2021 12:02:50 +0000 Subject: [PATCH 14/16] Upgrade matrix-js-sdk to 9.6.0 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f616e76c61..60c4212739 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "katex": "^0.12.0", "linkifyjs": "^2.1.9", "lodash": "^4.17.20", - "matrix-js-sdk": "9.6.0-rc.1", + "matrix-js-sdk": "9.6.0", "matrix-widget-api": "^0.1.0-beta.13", "minimist": "^1.2.5", "pako": "^2.0.3", diff --git a/yarn.lock b/yarn.lock index 88376bcad0..3febf0570f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5577,10 +5577,10 @@ mathml-tag-names@^2.1.3: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@9.6.0-rc.1: - version "9.6.0-rc.1" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.6.0-rc.1.tgz#f5dd325b9b5c5b3fdf5199351ab51ecab1b2113c" - integrity sha512-Da5C4uTm7LRfjyb9pM7dbmkwFVVYH8HdjRa7rpaRP9elHwptJmAeoKEzPU5HcPkFFNQbBy11Kq+58IgKcVpwKA== +matrix-js-sdk@9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.6.0.tgz#e3aee2f2a2c395aaa8a90a19023addee7af02099" + integrity sha512-zoNqB7z0C0QDncN7yD1K50c4C88VPofWaCQ0gNXqO/Ac1dr/xLF/46iNF9Y+dBwq7siBO9wEh20WFHMaRpeLOg== dependencies: "@babel/runtime" "^7.12.5" another-json "^0.2.0" From 379c485ff82b8e19e58c6eec130b2f7bb4ab19c4 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 3 Feb 2021 12:07:41 +0000 Subject: [PATCH 15/16] Prepare changelog for v3.13.0 --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18f2c1a421..5d1595396b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +Changes in [3.13.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.13.0) (2021-02-03) +===================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.13.0-rc.1...v3.13.0) + + * Upgrade to JS SDK 9.6.0 + * [Release] Fix flair height after accent changes + [\#5612](https://github.com/matrix-org/matrix-react-sdk/pull/5612) + * [Release] Iterate Social Logins work around edge cases and branding + [\#5610](https://github.com/matrix-org/matrix-react-sdk/pull/5610) + * [Release] Lock widget room ID when added + [\#5608](https://github.com/matrix-org/matrix-react-sdk/pull/5608) + * [Release] Better errors for SSO failures + [\#5606](https://github.com/matrix-org/matrix-react-sdk/pull/5606) + * [Release] Fix RoomView re-mounting breaking peeking + [\#5603](https://github.com/matrix-org/matrix-react-sdk/pull/5603) + Changes in [3.13.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.13.0-rc.1) (2021-01-29) =============================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.12.1...v3.13.0-rc.1) From 11f80be0f7d4d6b05e8d527f051b99b8ae9f2839 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 3 Feb 2021 12:07:42 +0000 Subject: [PATCH 16/16] v3.13.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 60c4212739..4e32409fb7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.13.0-rc.1", + "version": "3.13.0", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": {