From 833dcbac644911a845a91e3bef18ffc534461be2 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 19 Dec 2019 09:25:51 +0000 Subject: [PATCH 001/123] Rewire the Sticker button to be an Emoji Picker --- src/components/views/rooms/MessageComposer.js | 37 ++++++++++++++++++- .../views/rooms/SendMessageComposer.js | 14 +++++++ src/components/views/rooms/Stickerpicker.js | 1 + 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js index 580e3b0d81..00cb276923 100644 --- a/src/components/views/rooms/MessageComposer.js +++ b/src/components/views/rooms/MessageComposer.js @@ -22,10 +22,10 @@ import MatrixClientPeg from '../../../MatrixClientPeg'; import sdk from '../../../index'; import dis from '../../../dispatcher'; import RoomViewStore from '../../../stores/RoomViewStore'; -import Stickerpicker from './Stickerpicker'; import { makeRoomPermalink } from '../../../utils/permalinks/Permalinks'; import ContentMessages from '../../../ContentMessages'; import E2EIcon from './E2EIcon'; +import {aboveLeftOf, ContextMenu, ContextMenuButton, useContextMenu} from "../../structures/ContextMenu"; function ComposerAvatar(props) { const MemberStatusMessageAvatar = sdk.getComponent('avatars.MemberStatusMessageAvatar'); @@ -102,6 +102,32 @@ HangupButton.propTypes = { roomId: PropTypes.string.isRequired, }; +const EmojiButton = ({addEmoji}) => { + const [menuDisplayed, button, openMenu, closeMenu] = useContextMenu(); + + let contextMenu; + if (menuDisplayed) { + const buttonRect = button.current.getBoundingClientRect(); + const EmojiPicker = sdk.getComponent('emojipicker.EmojiPicker'); + contextMenu = + + ; + } + + return + + + + + { contextMenu } + ; +}; + class UploadButton extends React.Component { static propTypes = { roomId: PropTypes.string.isRequired, @@ -298,6 +324,13 @@ export default class MessageComposer extends React.Component { } } + addEmoji(emoji) { + dis.dispatch({ + action: "insert_emoji", + emoji, + }); + } + render() { const controls = [ this.state.me ? : null, @@ -321,7 +354,7 @@ export default class MessageComposer extends React.Component { room={this.props.room} placeholder={this.renderPlaceholderText()} permalinkCreator={this.props.permalinkCreator} />, - , + , , callInProgress ? : null, callInProgress ? null : , diff --git a/src/components/views/rooms/SendMessageComposer.js b/src/components/views/rooms/SendMessageComposer.js index af25155588..c2f79c72d7 100644 --- a/src/components/views/rooms/SendMessageComposer.js +++ b/src/components/views/rooms/SendMessageComposer.js @@ -317,6 +317,9 @@ export default class SendMessageComposer extends React.Component { case 'quote': this._insertQuotedMessage(payload.event); break; + case 'insert_emoji': + this._insertEmoji(payload.emoji); + break; } }; @@ -353,6 +356,17 @@ export default class SendMessageComposer extends React.Component { this._editorRef && this._editorRef.focus(); } + _insertEmoji = (emoji) => { + const {model} = this; + const {partCreator} = model; + const caret = this._editorRef.getCaret(); + const position = model.positionForOffset(caret.offset, caret.atNodeEnd); + model.transform(() => { + const addedLen = model.insert([partCreator.plain(emoji)], position); + return model.positionForOffset(caret.offset + addedLen, true); + }); + }; + _onPaste = (event) => { const {clipboardData} = event; if (clipboardData.files.length) { diff --git a/src/components/views/rooms/Stickerpicker.js b/src/components/views/rooms/Stickerpicker.js index 24f256e706..095a0dca31 100644 --- a/src/components/views/rooms/Stickerpicker.js +++ b/src/components/views/rooms/Stickerpicker.js @@ -36,6 +36,7 @@ const STICKERPICKER_Z_INDEX = 3500; // Key to store the widget's AppTile under in PersistedElement const PERSISTED_ELEMENT_KEY = "stickerPicker"; +// TODO figure out where to expose it now that the EmojiPicker has taken its place export default class Stickerpicker extends React.Component { static currentWidget; From e3d1cf8d84d57e438755fc264dd742b00e77f979 Mon Sep 17 00:00:00 2001 From: Marcel Date: Sun, 5 Apr 2020 20:55:26 +0200 Subject: [PATCH 002/123] Replace {} with null to be compliant with newer specs. While older also accepted null for the auth part of the registration request object Took 18 minutes --- src/components/structures/auth/Registration.js | 2 +- src/components/views/auth/InteractiveAuthEntryComponents.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js index c74f6ed6e3..dc22516cd8 100644 --- a/src/components/structures/auth/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -243,7 +243,7 @@ export default createReactClass({ }); }; try { - await this._makeRegisterRequest({}); + await this._makeRegisterRequest(null); // This should never succeed since we specified an empty // auth object. console.log("Expecting 401 from register request but got success!"); diff --git a/src/components/views/auth/InteractiveAuthEntryComponents.js b/src/components/views/auth/InteractiveAuthEntryComponents.js index 327451be17..bee99306a3 100644 --- a/src/components/views/auth/InteractiveAuthEntryComponents.js +++ b/src/components/views/auth/InteractiveAuthEntryComponents.js @@ -650,7 +650,7 @@ export class SSOAuthEntry extends React.Component { }; onConfirmClick = () => { - this.props.submitAuthDict({}); + this.props.submitAuthDict(null); }; render() { @@ -740,7 +740,7 @@ export const FallbackAuthEntry = createReactClass({ event.data === "authDone" && event.origin === this.props.matrixClient.getHomeserverUrl() ) { - this.props.submitAuthDict({}); + this.props.submitAuthDict(null); } }, From 9820400680003564b8538502b98227836c0ea723 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 8 Apr 2020 20:53:05 +0200 Subject: [PATCH 003/123] Update src/components/structures/auth/Registration.js Co-Authored-By: Travis Ralston --- src/components/structures/auth/Registration.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js index dc22516cd8..a84d779371 100644 --- a/src/components/structures/auth/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -244,8 +244,7 @@ export default createReactClass({ }; try { await this._makeRegisterRequest(null); - // This should never succeed since we specified an empty - // auth object. + // This should never succeed since we're doing UIA console.log("Expecting 401 from register request but got success!"); } catch (e) { if (e.httpStatus === 401) { From 69c1e117a3310e66d88023b16a7dcc7249f01b2d Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 8 Apr 2020 20:55:02 +0200 Subject: [PATCH 004/123] Fix submitAuthDict(null) being null in places where it actually should be auth: {} Took 16 minutes --- src/components/views/auth/InteractiveAuthEntryComponents.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/auth/InteractiveAuthEntryComponents.js b/src/components/views/auth/InteractiveAuthEntryComponents.js index bee99306a3..327451be17 100644 --- a/src/components/views/auth/InteractiveAuthEntryComponents.js +++ b/src/components/views/auth/InteractiveAuthEntryComponents.js @@ -650,7 +650,7 @@ export class SSOAuthEntry extends React.Component { }; onConfirmClick = () => { - this.props.submitAuthDict(null); + this.props.submitAuthDict({}); }; render() { @@ -740,7 +740,7 @@ export const FallbackAuthEntry = createReactClass({ event.data === "authDone" && event.origin === this.props.matrixClient.getHomeserverUrl() ) { - this.props.submitAuthDict(null); + this.props.submitAuthDict({}); } }, From 0e42a6ff851ae2fadbfe1ecc0d24991516d3aa74 Mon Sep 17 00:00:00 2001 From: Marcel Date: Fri, 10 Apr 2020 19:16:15 +0200 Subject: [PATCH 005/123] Send empty auth key value pair if doing FallbackStage Took 3 minutes --- src/components/views/auth/InteractiveAuthEntryComponents.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/auth/InteractiveAuthEntryComponents.js b/src/components/views/auth/InteractiveAuthEntryComponents.js index 327451be17..4222aa9255 100644 --- a/src/components/views/auth/InteractiveAuthEntryComponents.js +++ b/src/components/views/auth/InteractiveAuthEntryComponents.js @@ -740,7 +740,7 @@ export const FallbackAuthEntry = createReactClass({ event.data === "authDone" && event.origin === this.props.matrixClient.getHomeserverUrl() ) { - this.props.submitAuthDict({}); + this.props.submitAuthDict(null); } }, From 08fadb092c930cc25323bba29ec8f5979f4dd9e2 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 22 May 2020 21:43:15 +0100 Subject: [PATCH 006/123] Remove redundant component Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../settings/EnableNotificationsButton.js | 75 ------------------- 1 file changed, 75 deletions(-) delete mode 100644 src/components/views/settings/EnableNotificationsButton.js diff --git a/src/components/views/settings/EnableNotificationsButton.js b/src/components/views/settings/EnableNotificationsButton.js deleted file mode 100644 index e4b348dfbd..0000000000 --- a/src/components/views/settings/EnableNotificationsButton.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -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. -*/ - -import React from "react"; -import createReactClass from 'create-react-class'; -import Notifier from "../../../Notifier"; -import dis from "../../../dispatcher/dispatcher"; -import { _t } from '../../../languageHandler'; - -export default createReactClass({ - displayName: 'EnableNotificationsButton', - - componentDidMount: function() { - this.dispatcherRef = dis.register(this.onAction); - }, - - componentWillUnmount: function() { - dis.unregister(this.dispatcherRef); - }, - - onAction: function(payload) { - if (payload.action !== "notifier_enabled") { - return; - } - this.forceUpdate(); - }, - - enabled: function() { - return Notifier.isEnabled(); - }, - - onClick: function() { - const self = this; - if (!Notifier.supportsDesktopNotifications()) { - return; - } - if (!Notifier.isEnabled()) { - Notifier.setEnabled(true, function() { - self.forceUpdate(); - }); - } else { - Notifier.setEnabled(false); - } - this.forceUpdate(); - }, - - render: function() { - if (this.enabled()) { - return ( - - ); - } else { - return ( - - ); - } - }, -}); From a977b8c4ca12570919a1cf5deceaf71652648510 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 22 May 2020 21:55:43 +0100 Subject: [PATCH 007/123] Fix lifecycle to reset things before it starts them Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/Lifecycle.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Lifecycle.js b/src/Lifecycle.js index 22c5d48317..5fb54ede7f 100644 --- a/src/Lifecycle.js +++ b/src/Lifecycle.js @@ -575,10 +575,12 @@ async function startMatrixClient(startSyncing=true) { // to work). dis.dispatch({action: 'will_start_client'}, true); + // reset things first just in case + TypingStore.sharedInstance().reset(); + ToastStore.sharedInstance().reset(); + Notifier.start(); UserActivity.sharedInstance().start(); - TypingStore.sharedInstance().reset(); // just in case - ToastStore.sharedInstance().reset(); DMRoomMap.makeShared().start(); IntegrationManagers.sharedInstance().startWatching(); ActiveWidgetStore.start(); From 3732d1f5a5d0ad2fe22c73db924d612651967c79 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 22 May 2020 21:56:25 +0100 Subject: [PATCH 008/123] Migrate Desktop Notifications MatrixToolbar to a Toast Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/Notifier.js | 15 +++--- src/components/structures/LoggedInView.tsx | 7 +-- src/components/structures/MatrixChat.tsx | 6 --- src/components/views/globals/MatrixToolbar.js | 45 ----------------- src/toasts/DesktopNotificationsToast.ts | 50 +++++++++++++++++++ 5 files changed, 60 insertions(+), 63 deletions(-) delete mode 100644 src/components/views/globals/MatrixToolbar.js create mode 100644 src/toasts/DesktopNotificationsToast.ts diff --git a/src/Notifier.js b/src/Notifier.js index 2ffa92452b..cc804904e2 100644 --- a/src/Notifier.js +++ b/src/Notifier.js @@ -26,6 +26,10 @@ import * as sdk from './index'; import { _t } from './languageHandler'; import Modal from './Modal'; import SettingsStore, {SettingLevel} from "./settings/SettingsStore"; +import { + showToast as showNotificationsToast, + hideToast as hideNotificationsToast, +} from "./toasts/DesktopNotificationsToast"; /* * Dispatches: @@ -184,6 +188,10 @@ const Notifier = { MatrixClientPeg.get().on("sync", this.boundOnSyncStateChange); this.toolbarHidden = false; this.isSyncing = false; + + if (this.shouldShowToolbar()) { + showNotificationsToast(); + } }, stop: function() { @@ -278,12 +286,7 @@ const Notifier = { Analytics.trackEvent('Notifier', 'Set Toolbar Hidden', hidden); - // XXX: why are we dispatching this here? - // this is nothing to do with notifier_enabled - dis.dispatch({ - action: "notifier_enabled", - value: this.isEnabled(), - }); + hideNotificationsToast(); // update the info to localStorage for persistent settings if (persistent && global.localStorage) { diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index 148d10fe8d..0d3eda759e 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -68,7 +68,6 @@ interface IProps { showCookieBar: boolean; hasNewVersion: boolean; userHasGeneratedPassword: boolean; - showNotifierToolbar: boolean; page_type: string; autoJoin: boolean; thirdPartyInvite?: object; @@ -184,8 +183,7 @@ class LoggedInView extends React.PureComponent { if ( (prevProps.showCookieBar !== this.props.showCookieBar) || (prevProps.hasNewVersion !== this.props.hasNewVersion) || - (prevState.userHasGeneratedPassword !== this.state.userHasGeneratedPassword) || - (prevProps.showNotifierToolbar !== this.props.showNotifierToolbar) + (prevState.userHasGeneratedPassword !== this.state.userHasGeneratedPassword) ) { this.props.resizeNotifier.notifyBannersChanged(); } @@ -599,7 +597,6 @@ class LoggedInView extends React.PureComponent { const GroupView = sdk.getComponent('structures.GroupView'); const MyGroups = sdk.getComponent('structures.MyGroups'); const ToastContainer = sdk.getComponent('structures.ToastContainer'); - const MatrixToolbar = sdk.getComponent('globals.MatrixToolbar'); const CookieBar = sdk.getComponent('globals.CookieBar'); const NewVersionBar = sdk.getComponent('globals.NewVersionBar'); const UpdateCheckBar = sdk.getComponent('globals.UpdateCheckBar'); @@ -680,8 +677,6 @@ class LoggedInView extends React.PureComponent { topBar = ; } else if (this.state.userHasGeneratedPassword) { topBar = ; - } else if (this.props.showNotifierToolbar) { - topBar = ; } let bodyClasses = 'mx_MatrixChat'; diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index e6a56c683f..120497e5ef 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -184,7 +184,6 @@ interface IState { hideToSRUsers: boolean; syncError?: Error; resizeNotifier: ResizeNotifier; - showNotifierToolbar: boolean; serverConfig?: ValidatedServerConfig; ready: boolean; thirdPartyInvite?: object; @@ -238,7 +237,6 @@ export default class MatrixChat extends React.PureComponent { syncError: null, // If the current syncing status is ERROR, the error object, otherwise null. resizeNotifier: new ResizeNotifier(), - showNotifierToolbar: false, ready: false, }; @@ -686,9 +684,6 @@ export default class MatrixChat extends React.PureComponent { dis.dispatch({action: 'view_my_groups'}); } break; - case 'notifier_enabled': - this.setState({showNotifierToolbar: Notifier.shouldShowToolbar()}); - break; case 'hide_left_panel': this.setState({ collapseLhs: true, @@ -1381,7 +1376,6 @@ export default class MatrixChat extends React.PureComponent { dis.dispatch({action: 'focus_composer'}); this.setState({ ready: true, - showNotifierToolbar: Notifier.shouldShowToolbar(), }); }); cli.on('Call.incoming', function(call) { diff --git a/src/components/views/globals/MatrixToolbar.js b/src/components/views/globals/MatrixToolbar.js deleted file mode 100644 index 758e4d62aa..0000000000 --- a/src/components/views/globals/MatrixToolbar.js +++ /dev/null @@ -1,45 +0,0 @@ -/* -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. -*/ - -import React from 'react'; -import createReactClass from 'create-react-class'; -import { _t } from '../../../languageHandler'; -import Notifier from '../../../Notifier'; -import AccessibleButton from '../../../components/views/elements/AccessibleButton'; - -export default createReactClass({ - displayName: 'MatrixToolbar', - - hideToolbar: function() { - Notifier.setToolbarHidden(true); - }, - - onClick: function() { - Notifier.setEnabled(true); - }, - - render: function() { - return ( -
- -
- { _t('You are not receiving desktop notifications') } { _t('Enable them now') } -
- {_t('Close')} -
- ); - }, -}); diff --git a/src/toasts/DesktopNotificationsToast.ts b/src/toasts/DesktopNotificationsToast.ts new file mode 100644 index 0000000000..02f0730759 --- /dev/null +++ b/src/toasts/DesktopNotificationsToast.ts @@ -0,0 +1,50 @@ +/* +Copyright 2020 The Matrix.org Foundation C.I.C. + +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. +*/ + +import { _t } from "../languageHandler"; +import Notifier from "../Notifier"; +import GenericToast from "../components/views/toasts/GenericToast"; +import ToastStore from "../stores/ToastStore"; + +const onAccept = () => { + Notifier.setEnabled(true); +}; + +const onReject = () => { + Notifier.setToolbarHidden(true); +}; + +const TOAST_KEY = "desktopnotifications"; + +export const showToast = () => { + ToastStore.sharedInstance().addOrReplaceToast({ + key: TOAST_KEY, + title: _t("Notifications"), + props: { + description: _t("You are not receiving desktop notifications"), + acceptLabel: _t("Enable them now"), + onAccept, + rejectLabel: _t("Close"), + onReject, + }, + component: GenericToast, + priority: 20, + }); +}; + +export const hideToast = () => { + ToastStore.sharedInstance().dismissToast(TOAST_KEY); +}; From 89292ca47be3fc0a714024a708452452e9938ee6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 22 May 2020 22:03:16 +0100 Subject: [PATCH 009/123] Fix toast priority sorting to put the highest priority into slot[0] Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/stores/ToastStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/ToastStore.ts b/src/stores/ToastStore.ts index 4f6d2963c5..23317a0ad3 100644 --- a/src/stores/ToastStore.ts +++ b/src/stores/ToastStore.ts @@ -55,7 +55,7 @@ export default class ToastStore extends EventEmitter { const oldIndex = this.toasts.findIndex(t => t.key === newToast.key); if (oldIndex === -1) { let newIndex = this.toasts.length; - while (newIndex > 0 && this.toasts[newIndex - 1].priority > newToast.priority) --newIndex; + while (newIndex > 0 && this.toasts[newIndex - 1].priority < newToast.priority) --newIndex; this.toasts.splice(newIndex, 0, newToast); } else { this.toasts[oldIndex] = newToast; From c91f8c2631799d92cc582dbe6eebcdec3e0a2cb4 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 22 May 2020 22:04:21 +0100 Subject: [PATCH 010/123] Migrate Analytics Banner to a Toast Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/LoggedInView.tsx | 9 -- src/components/structures/MatrixChat.tsx | 28 ++---- src/components/views/globals/CookieBar.js | 103 --------------------- src/i18n/strings/en_EN.json | 14 +-- src/toasts/AnalyticsToast.tsx | 75 +++++++++++++++ 5 files changed, 92 insertions(+), 137 deletions(-) delete mode 100644 src/components/views/globals/CookieBar.js create mode 100644 src/toasts/AnalyticsToast.tsx diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index 0d3eda759e..88b64f0cbc 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -65,7 +65,6 @@ interface IProps { initialEventPixelOffset: number; leftDisabled: boolean; rightDisabled: boolean; - showCookieBar: boolean; hasNewVersion: boolean; userHasGeneratedPassword: boolean; page_type: string; @@ -181,7 +180,6 @@ class LoggedInView extends React.PureComponent { componentDidUpdate(prevProps, prevState) { // attempt to guess when a banner was opened or closed if ( - (prevProps.showCookieBar !== this.props.showCookieBar) || (prevProps.hasNewVersion !== this.props.hasNewVersion) || (prevState.userHasGeneratedPassword !== this.state.userHasGeneratedPassword) ) { @@ -597,7 +595,6 @@ class LoggedInView extends React.PureComponent { const GroupView = sdk.getComponent('structures.GroupView'); const MyGroups = sdk.getComponent('structures.MyGroups'); const ToastContainer = sdk.getComponent('structures.ToastContainer'); - const CookieBar = sdk.getComponent('globals.CookieBar'); const NewVersionBar = sdk.getComponent('globals.NewVersionBar'); const UpdateCheckBar = sdk.getComponent('globals.UpdateCheckBar'); const PasswordNagBar = sdk.getComponent('globals.PasswordNagBar'); @@ -663,12 +660,6 @@ class LoggedInView extends React.PureComponent { adminContact={usageLimitEvent.getContent().admin_contact} limitType={usageLimitEvent.getContent().limit_type} />; - } else if (this.props.showCookieBar && - this.props.config.piwik && - navigator.doNotTrack !== "1" - ) { - const policyUrl = this.props.config.piwik.policyUrl || null; - topBar = ; } else if (this.props.hasNewVersion) { topBar = { newVersionReleaseNotes: null, checkingForUpdate: null, - showCookieBar: false, - hideToSRUsers: false, syncError: null, // If the current syncing status is ERROR, the error object, otherwise null. @@ -337,12 +338,6 @@ export default class MatrixChat extends React.PureComponent { }); } - if (SettingsStore.getValue("showCookieBar")) { - this.setState({ - showCookieBar: true, - }); - } - if (SettingsStore.getValue("analyticsOptIn")) { Analytics.enable(); } @@ -756,19 +751,13 @@ export default class MatrixChat extends React.PureComponent { case 'accept_cookies': SettingsStore.setValue("analyticsOptIn", null, SettingLevel.DEVICE, true); SettingsStore.setValue("showCookieBar", null, SettingLevel.DEVICE, false); - - this.setState({ - showCookieBar: false, - }); + hideAnalyticsToast(); Analytics.enable(); break; case 'reject_cookies': SettingsStore.setValue("analyticsOptIn", null, SettingLevel.DEVICE, false); SettingsStore.setValue("showCookieBar", null, SettingLevel.DEVICE, false); - - this.setState({ - showCookieBar: false, - }); + hideAnalyticsToast(); break; } }; @@ -1246,6 +1235,10 @@ export default class MatrixChat extends React.PureComponent { } StorageManager.tryPersistStorage(); + + if (SettingsStore.getValue("showCookieBar") && this.props.config.piwik && navigator.doNotTrack !== "1") { + showAnalyticsToast(this.props.config.piwik && this.props.config.piwik.policyUrl); + } } private showScreenAfterLogin() { @@ -2031,7 +2024,6 @@ export default class MatrixChat extends React.PureComponent { onCloseAllSettings={this.onCloseAllSettings} onRegistered={this.onRegistered} currentRoomId={this.state.currentRoomId} - showCookieBar={this.state.showCookieBar} /> ); } else { diff --git a/src/components/views/globals/CookieBar.js b/src/components/views/globals/CookieBar.js deleted file mode 100644 index bf264686d0..0000000000 --- a/src/components/views/globals/CookieBar.js +++ /dev/null @@ -1,103 +0,0 @@ -/* -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. -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. -*/ - -import React from 'react'; -import PropTypes from 'prop-types'; -import dis from '../../../dispatcher/dispatcher'; -import { _t } from '../../../languageHandler'; -import * as sdk from '../../../index'; -import Analytics from '../../../Analytics'; - -export default class CookieBar extends React.Component { - static propTypes = { - policyUrl: PropTypes.string, - } - - constructor() { - super(); - } - - onUsageDataClicked(e) { - e.stopPropagation(); - e.preventDefault(); - Analytics.showDetailsModal(); - } - - onAccept() { - dis.dispatch({ - action: 'accept_cookies', - }); - } - - onReject() { - dis.dispatch({ - action: 'reject_cookies', - }); - } - - render() { - const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); - const toolbarClasses = "mx_MatrixToolbar"; - return ( -
- -
- { this.props.policyUrl ? _t( - "Please help improve Riot.im by sending anonymous usage data. " + - "This will use a cookie " + - "(please see our Cookie Policy).", - {}, - { - 'UsageDataLink': (sub) => - { sub } - , - // XXX: We need to link to the page that explains our cookies - 'PolicyLink': (sub) => - { sub } - - , - }, - ) : _t( - "Please help improve Riot.im by sending anonymous usage data. " + - "This will use a cookie.", - {}, - { - 'UsageDataLink': (sub) => - { sub } - , - }, - ) } -
- - { _t("Yes, I want to help!") } - - - {_t('Close')} - -
- ); - } -} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 8ac05bf429..a79ee97109 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -391,10 +391,17 @@ "Common names and surnames are easy to guess": "Common names and surnames are easy to guess", "Straight rows of keys are easy to guess": "Straight rows of keys are easy to guess", "Short keyboard patterns are easy to guess": "Short keyboard patterns are easy to guess", + "Notifications": "Notifications", + "Send anonymous usage data which helps us improve Riot. This will use a cookie.": "Send anonymous usage data which helps us improve Riot. This will use a cookie.", + "I want to help": "I want to help", + "No": "No", "Review where you’re logged in": "Review where you’re logged in", "Verify all your sessions to ensure your account & messages are safe": "Verify all your sessions to ensure your account & messages are safe", "Review": "Review", "Later": "Later", + "You are not receiving desktop notifications": "You are not receiving desktop notifications", + "Enable them now": "Enable them now", + "Close": "Close", "Set up encryption": "Set up encryption", "Encryption upgrade available": "Encryption upgrade available", "Verify this session": "Verify this session", @@ -643,8 +650,6 @@ "Last seen": "Last seen", "Failed to set display name": "Failed to set display name", "Individually verify each session used by a user to mark it as trusted, not trusting cross-signed devices.": "Individually verify each session used by a user to mark it as trusted, not trusting cross-signed devices.", - "Disable Notifications": "Disable Notifications", - "Enable Notifications": "Enable Notifications", "Securely cache encrypted messages locally for them to appear in search results, using ": "Securely cache encrypted messages locally for them to appear in search results, using ", " to store messages from ": " to store messages from ", "rooms.": "rooms.", @@ -815,7 +820,6 @@ "Ban list rules - %(roomName)s": "Ban list rules - %(roomName)s", "Server rules": "Server rules", "User rules": "User rules", - "Close": "Close", "You have not ignored anyone.": "You have not ignored anyone.", "You are currently ignoring:": "You are currently ignoring:", "You are not subscribed to any lists": "You are not subscribed to any lists", @@ -836,7 +840,6 @@ "If this isn't what you want, please use a different tool to ignore users.": "If this isn't what you want, please use a different tool to ignore users.", "Room ID or alias of ban list": "Room ID or alias of ban list", "Subscribe": "Subscribe", - "Notifications": "Notifications", "Start automatically after system login": "Start automatically after system login", "Always show the window menu bar": "Always show the window menu bar", "Show tray icon and minimize window to it on close": "Show tray icon and minimize window to it on close", @@ -1287,7 +1290,6 @@ "Verify by emoji": "Verify by emoji", "Almost there! Is your other session showing the same shield?": "Almost there! Is your other session showing the same shield?", "Almost there! Is %(displayName)s showing the same shield?": "Almost there! Is %(displayName)s showing the same shield?", - "No": "No", "Yes": "Yes", "Verify all users in a room to ensure it's secure.": "Verify all users in a room to ensure it's secure.", "In encrypted rooms, verify all users to ensure it’s secure.": "In encrypted rooms, verify all users to ensure it’s secure.", @@ -1384,8 +1386,6 @@ "Please help improve Riot.im by sending anonymous usage data. This will use a cookie (please see our Cookie Policy).": "Please help improve Riot.im by sending anonymous usage data. This will use a cookie (please see our Cookie Policy).", "Please help improve Riot.im by sending anonymous usage data. This will use a cookie.": "Please help improve Riot.im by sending anonymous usage data. This will use a cookie.", "Yes, I want to help!": "Yes, I want to help!", - "You are not receiving desktop notifications": "You are not receiving desktop notifications", - "Enable them now": "Enable them now", "What's New": "What's New", "Update": "Update", "What's new?": "What's new?", diff --git a/src/toasts/AnalyticsToast.tsx b/src/toasts/AnalyticsToast.tsx new file mode 100644 index 0000000000..5b53a903fe --- /dev/null +++ b/src/toasts/AnalyticsToast.tsx @@ -0,0 +1,75 @@ +/* +Copyright 2020 The Matrix.org Foundation C.I.C. + +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. +*/ + +import React from "react"; + +import { _t } from "../languageHandler"; +import dis from "../dispatcher/dispatcher"; +import Analytics from "../Analytics"; +import AccessibleButton from "../components/views/elements/AccessibleButton"; +import GenericToast from "../components/views/toasts/GenericToast"; +import ToastStore from "../stores/ToastStore"; + +const onAccept = () => { + dis.dispatch({ + action: 'accept_cookies', + }); +}; + +const onReject = () => { + dis.dispatch({ + action: "reject_cookies", + }); +}; + +const onUsageDataClicked = () => { + Analytics.showDetailsModal(); +}; + +const TOAST_KEY = "analytics"; + +export const showToast = (policyUrl?: string) => { + ToastStore.sharedInstance().addOrReplaceToast({ + key: TOAST_KEY, + title: _t("Notifications"), + props: { + description: _t( + "Send anonymous usage data which helps us improve Riot. " + + "This will use a cookie.", + {}, + { + "UsageDataLink": (sub) => ( + { sub } + ), + // XXX: We need to link to the page that explains our cookies + "PolicyLink": (sub) => policyUrl ? ( + { sub } + ) : sub, + }, + ), + acceptLabel: _t("I want to help"), + onAccept, + rejectLabel: _t("No"), + onReject, + }, + component: GenericToast, + priority: 10, + }); +}; + +export const hideToast = () => { + ToastStore.sharedInstance().dismissToast(TOAST_KEY); +}; From 5d0040b8b36d1474db807748d1191844b424a569 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 22 May 2020 22:15:22 +0100 Subject: [PATCH 011/123] Migrate Password Nag Bar Banner to a Toast Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/LoggedInView.tsx | 22 ++++---- .../views/globals/PasswordNagBar.js | 53 ------------------- src/toasts/SetPasswordToast.ts | 47 ++++++++++++++++ 3 files changed, 58 insertions(+), 64 deletions(-) delete mode 100644 src/components/views/globals/PasswordNagBar.js create mode 100644 src/toasts/SetPasswordToast.ts diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index 88b64f0cbc..131e6a3867 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -43,6 +43,11 @@ import ResizeNotifier from "../../utils/ResizeNotifier"; import PlatformPeg from "../../PlatformPeg"; import { RoomListStoreTempProxy } from "../../stores/room-list/RoomListStoreTempProxy"; import { DefaultTagID } from "../../stores/room-list/models"; +import { + showToast as showSetPasswordToast, + hideToast as hideSetPasswordToast +} from "../../toasts/SetPasswordToast"; + // We need to fetch each pinned message individually (if we don't already have it) // so each pinned message may trigger a request. Limit the number per room for sanity. // NB. this is just for server notices rather than pinned messages in general. @@ -66,7 +71,6 @@ interface IProps { leftDisabled: boolean; rightDisabled: boolean; hasNewVersion: boolean; - userHasGeneratedPassword: boolean; page_type: string; autoJoin: boolean; thirdPartyInvite?: object; @@ -96,7 +100,6 @@ interface IState { syncErrorData: any; useCompactLayout: boolean; serverNoticeEvents: MatrixEvent[]; - userHasGeneratedPassword: boolean; } /** @@ -139,7 +142,6 @@ class LoggedInView extends React.PureComponent { this.state = { mouseDown: undefined, syncErrorData: undefined, - userHasGeneratedPassword: false, // use compact timeline view useCompactLayout: SettingsStore.getValue('useCompactLayout'), // any currently active server notice events @@ -180,8 +182,7 @@ class LoggedInView extends React.PureComponent { componentDidUpdate(prevProps, prevState) { // attempt to guess when a banner was opened or closed if ( - (prevProps.hasNewVersion !== this.props.hasNewVersion) || - (prevState.userHasGeneratedPassword !== this.state.userHasGeneratedPassword) + (prevProps.hasNewVersion !== this.props.hasNewVersion) ) { this.props.resizeNotifier.notifyBannersChanged(); } @@ -216,9 +217,11 @@ class LoggedInView extends React.PureComponent { }; _setStateFromSessionStore = () => { - this.setState({ - userHasGeneratedPassword: Boolean(this._sessionStore.getCachedPassword()), - }); + if (this._sessionStore.getCachedPassword()) { + showSetPasswordToast(); + } else { + hideSetPasswordToast(); + } }; _createResizer() { @@ -597,7 +600,6 @@ class LoggedInView extends React.PureComponent { const ToastContainer = sdk.getComponent('structures.ToastContainer'); const NewVersionBar = sdk.getComponent('globals.NewVersionBar'); const UpdateCheckBar = sdk.getComponent('globals.UpdateCheckBar'); - const PasswordNagBar = sdk.getComponent('globals.PasswordNagBar'); const ServerLimitBar = sdk.getComponent('globals.ServerLimitBar'); let pageElement; @@ -666,8 +668,6 @@ class LoggedInView extends React.PureComponent { />; } else if (this.props.checkingForUpdate) { topBar = ; - } else if (this.state.userHasGeneratedPassword) { - topBar = ; } let bodyClasses = 'mx_MatrixChat'; diff --git a/src/components/views/globals/PasswordNagBar.js b/src/components/views/globals/PasswordNagBar.js deleted file mode 100644 index 74735ca5ea..0000000000 --- a/src/components/views/globals/PasswordNagBar.js +++ /dev/null @@ -1,53 +0,0 @@ -/* -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. -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. -*/ - -import React from 'react'; -import createReactClass from 'create-react-class'; -import * as sdk from '../../../index'; -import Modal from '../../../Modal'; -import { _t } from '../../../languageHandler'; - -export default createReactClass({ - onUpdateClicked: function() { - const SetPasswordDialog = sdk.getComponent('dialogs.SetPasswordDialog'); - Modal.createTrackedDialog('Set Password Dialog', 'Password Nag Bar', SetPasswordDialog); - }, - - render: function() { - const toolbarClasses = "mx_MatrixToolbar mx_MatrixToolbar_clickable"; - return ( -
- -
- { _t( - "To return to your account in future you need to set a password", - {}, - { 'u': (sub) => { sub } }, - ) } -
- -
- ); - }, -}); diff --git a/src/toasts/SetPasswordToast.ts b/src/toasts/SetPasswordToast.ts new file mode 100644 index 0000000000..88cc317978 --- /dev/null +++ b/src/toasts/SetPasswordToast.ts @@ -0,0 +1,47 @@ +/* +Copyright 2020 The Matrix.org Foundation C.I.C. + +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. +*/ + +import { _t } from "../languageHandler"; +import Modal from "../Modal"; +import SetPasswordDialog from "../components/views/dialogs/SetPasswordDialog"; +import GenericToast from "../components/views/toasts/GenericToast"; +import ToastStore from "../stores/ToastStore"; + +const onAccept = () => { + Modal.createTrackedDialog('Set Password Dialog', 'Password Nag Bar', SetPasswordDialog); +}; + +const TOAST_KEY = "setpassword"; + +export const showToast = () => { + ToastStore.sharedInstance().addOrReplaceToast({ + key: TOAST_KEY, + title: _t("Set password"), + props: { + description: _t("To return to your account in future you need to set a password"), + acceptLabel: _t("Set Password"), + onAccept, + rejectLabel: _t("Later"), + onReject: hideToast, // it'll return on reload + }, + component: GenericToast, + priority: 60, + }); +}; + +export const hideToast = () => { + ToastStore.sharedInstance().dismissToast(TOAST_KEY); +}; From ccf9e6512341bb7395b1eba3841b0ce475379da5 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 22 May 2020 22:27:19 +0100 Subject: [PATCH 012/123] Migrate Server Limit Bar Banner to a Toast Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/LoggedInView.tsx | 56 ++++++----- .../views/globals/ServerLimitBar.js | 99 ------------------- src/toasts/ServerLimitToast.tsx | 50 ++++++++++ 3 files changed, 80 insertions(+), 125 deletions(-) delete mode 100644 src/components/views/globals/ServerLimitBar.js create mode 100644 src/toasts/ServerLimitToast.tsx diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index 131e6a3867..edb2482aa3 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -47,6 +47,10 @@ import { showToast as showSetPasswordToast, hideToast as hideSetPasswordToast } from "../../toasts/SetPasswordToast"; +import { + showToast as showServerLimitToast, + hideToast as hideServerLimitToast +} from "../../toasts/ServerLimitToast"; // We need to fetch each pinned message individually (if we don't already have it) // so each pinned message may trigger a request. Limit the number per room for sanity. @@ -99,7 +103,6 @@ interface IState { }; syncErrorData: any; useCompactLayout: boolean; - serverNoticeEvents: MatrixEvent[]; } /** @@ -144,8 +147,6 @@ class LoggedInView extends React.PureComponent { syncErrorData: undefined, // use compact timeline view useCompactLayout: SettingsStore.getValue('useCompactLayout'), - // any currently active server notice events - serverNoticeEvents: [], }; // stash the MatrixClient in case we log out before we are unmounted @@ -293,6 +294,8 @@ class LoggedInView extends React.PureComponent { if (oldSyncState === 'PREPARED' && syncState === 'SYNCING') { this._updateServerNoticeEvents(); + } else { + this._calculateServerLimitToast(data); } }; @@ -303,11 +306,24 @@ class LoggedInView extends React.PureComponent { } }; + _calculateServerLimitToast(syncErrorData, usageLimitEventContent?) { + const error = syncErrorData && syncErrorData.error && syncErrorData.error.errcode === "M_RESOURCE_LIMIT_EXCEEDED"; + if (error) { + usageLimitEventContent = syncErrorData.error.data; + } + + if (usageLimitEventContent) { + showServerLimitToast(usageLimitEventContent.limit_type, usageLimitEventContent.admin_contact, error); + } else { + hideServerLimitToast(); + } + } + _updateServerNoticeEvents = async () => { const roomLists = RoomListStoreTempProxy.getRoomLists(); if (!roomLists[DefaultTagID.ServerNotice]) return []; - const pinnedEvents = []; + const events = []; for (const room of roomLists[DefaultTagID.ServerNotice]) { const pinStateEvent = room.currentState.getStateEvents("m.room.pinned_events", ""); @@ -317,12 +333,18 @@ class LoggedInView extends React.PureComponent { for (const eventId of pinnedEventIds) { const timeline = await this._matrixClient.getEventTimeline(room.getUnfilteredTimelineSet(), eventId, 0); const event = timeline.getEvents().find(ev => ev.getId() === eventId); - if (event) pinnedEvents.push(event); + if (event) events.push(event); } } - this.setState({ - serverNoticeEvents: pinnedEvents, + + const usageLimitEvent = events.find((e) => { + return ( + e && e.getType() === 'm.room.message' && + e.getContent()['server_notice_type'] === 'm.server_notice.usage_limit_reached' + ); }); + + this._calculateServerLimitToast(this.state.syncErrorData, usageLimitEvent && usageLimitEvent.getContent()); }; _onPaste = (ev) => { @@ -600,7 +622,6 @@ class LoggedInView extends React.PureComponent { const ToastContainer = sdk.getComponent('structures.ToastContainer'); const NewVersionBar = sdk.getComponent('globals.NewVersionBar'); const UpdateCheckBar = sdk.getComponent('globals.UpdateCheckBar'); - const ServerLimitBar = sdk.getComponent('globals.ServerLimitBar'); let pageElement; @@ -644,25 +665,8 @@ class LoggedInView extends React.PureComponent { break; } - const usageLimitEvent = this.state.serverNoticeEvents.find((e) => { - return ( - e && e.getType() === 'm.room.message' && - e.getContent()['server_notice_type'] === 'm.server_notice.usage_limit_reached' - ); - }); - let topBar; - if (this.state.syncErrorData && this.state.syncErrorData.error.errcode === 'M_RESOURCE_LIMIT_EXCEEDED') { - topBar = ; - } else if (usageLimitEvent) { - topBar = ; - } else if (this.props.hasNewVersion) { + if (this.props.hasNewVersion) { topBar = ; diff --git a/src/components/views/globals/ServerLimitBar.js b/src/components/views/globals/ServerLimitBar.js deleted file mode 100644 index 7d414a2826..0000000000 --- a/src/components/views/globals/ServerLimitBar.js +++ /dev/null @@ -1,99 +0,0 @@ -/* -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. -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. -*/ - -import React from 'react'; -import PropTypes from 'prop-types'; -import createReactClass from 'create-react-class'; -import classNames from 'classnames'; -import { _td } from '../../../languageHandler'; -import { messageForResourceLimitError } from '../../../utils/ErrorUtils'; - -export default createReactClass({ - propTypes: { - // 'hard' if the logged in user has been locked out, 'soft' if they haven't - kind: PropTypes.string, - adminContact: PropTypes.string, - // The type of limit that has been hit. - limitType: PropTypes.string.isRequired, - }, - - getDefaultProps: function() { - return { - kind: 'hard', - }; - }, - - render: function() { - const toolbarClasses = { - 'mx_MatrixToolbar': true, - }; - - let adminContact; - let limitError; - if (this.props.kind === 'hard') { - toolbarClasses['mx_MatrixToolbar_error'] = true; - - adminContact = messageForResourceLimitError( - this.props.limitType, - this.props.adminContact, - { - '': _td("Please contact your service administrator to continue using the service."), - }, - ); - limitError = messageForResourceLimitError( - this.props.limitType, - this.props.adminContact, - { - 'monthly_active_user': _td("This homeserver has hit its Monthly Active User limit."), - '': _td("This homeserver has exceeded one of its resource limits."), - }, - ); - } else { - toolbarClasses['mx_MatrixToolbar_info'] = true; - adminContact = messageForResourceLimitError( - this.props.limitType, - this.props.adminContact, - { - '': _td("Please contact your service administrator to get this limit increased."), - }, - ); - limitError = messageForResourceLimitError( - this.props.limitType, - this.props.adminContact, - { - 'monthly_active_user': _td( - "This homeserver has hit its Monthly Active User limit so " + - "some users will not be able to log in.", - ), - '': _td( - "This homeserver has exceeded one of its resource limits so " + - "some users will not be able to log in.", - ), - }, - {'b': sub => {sub}}, - ); - } - return ( -
-
- {limitError} - {' '} - {adminContact} -
-
- ); - }, -}); diff --git a/src/toasts/ServerLimitToast.tsx b/src/toasts/ServerLimitToast.tsx new file mode 100644 index 0000000000..f2de9e3499 --- /dev/null +++ b/src/toasts/ServerLimitToast.tsx @@ -0,0 +1,50 @@ +/* +Copyright 2020 The Matrix.org Foundation C.I.C. + +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. +*/ + +import React from "react"; + +import { _t, _td } from "../languageHandler"; +import GenericToast from "../components/views/toasts/GenericToast"; +import ToastStore from "../stores/ToastStore"; +import {messageForResourceLimitError} from "../utils/ErrorUtils"; + +const TOAST_KEY = "serverlimit"; + +export const showToast = (limitType: string, adminContact?: string, syncError?: boolean) => { + const errorText = messageForResourceLimitError(limitType, adminContact, { + 'monthly_active_user': _td("Your homeserver has exceeded its user limit."), + '': _td("Your homeserver has exceeded one of its resource limits."), + }); + const contactText = messageForResourceLimitError(limitType, adminContact, { + '': _td("Contact your server admin."), + }); + + ToastStore.sharedInstance().addOrReplaceToast({ + key: TOAST_KEY, + title: _t("Notifications"), + props: { + description: {errorText} {contactText}, + acceptLabel: _t("Ok"), + onAccept: hideToast, + }, + component: GenericToast, + priority: 20, + }); +}; + +export const hideToast = () => { + ToastStore.sharedInstance().dismissToast(TOAST_KEY); +}; From 29cfb47a83f5fc016f941a8387efb8f5a3e7463f Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 22 May 2020 22:29:09 +0100 Subject: [PATCH 013/123] fix copy Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/toasts/AnalyticsToast.tsx | 2 +- src/toasts/ServerLimitToast.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/toasts/AnalyticsToast.tsx b/src/toasts/AnalyticsToast.tsx index 5b53a903fe..b186a65d9d 100644 --- a/src/toasts/AnalyticsToast.tsx +++ b/src/toasts/AnalyticsToast.tsx @@ -44,7 +44,7 @@ const TOAST_KEY = "analytics"; export const showToast = (policyUrl?: string) => { ToastStore.sharedInstance().addOrReplaceToast({ key: TOAST_KEY, - title: _t("Notifications"), + title: _t("Help us improve Riot"), props: { description: _t( "Send anonymous usage data which helps us improve Riot. " + diff --git a/src/toasts/ServerLimitToast.tsx b/src/toasts/ServerLimitToast.tsx index f2de9e3499..d35140be3d 100644 --- a/src/toasts/ServerLimitToast.tsx +++ b/src/toasts/ServerLimitToast.tsx @@ -34,14 +34,14 @@ export const showToast = (limitType: string, adminContact?: string, syncError?: ToastStore.sharedInstance().addOrReplaceToast({ key: TOAST_KEY, - title: _t("Notifications"), + title: _t("Warning"), props: { description: {errorText} {contactText}, acceptLabel: _t("Ok"), onAccept: hideToast, }, component: GenericToast, - priority: 20, + priority: 70, }); }; From 9f060d113259d3cf22d5e9ee4f6a98eb91c0d5d7 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 22 May 2020 22:34:32 +0100 Subject: [PATCH 014/123] i18n Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/i18n/strings/en_EN.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index a79ee97109..72c19587c8 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -391,7 +391,7 @@ "Common names and surnames are easy to guess": "Common names and surnames are easy to guess", "Straight rows of keys are easy to guess": "Straight rows of keys are easy to guess", "Short keyboard patterns are easy to guess": "Short keyboard patterns are easy to guess", - "Notifications": "Notifications", + "Help us improve Riot": "Help us improve Riot", "Send anonymous usage data which helps us improve Riot. This will use a cookie.": "Send anonymous usage data which helps us improve Riot. This will use a cookie.", "I want to help": "I want to help", "No": "No", @@ -399,9 +399,18 @@ "Verify all your sessions to ensure your account & messages are safe": "Verify all your sessions to ensure your account & messages are safe", "Review": "Review", "Later": "Later", + "Notifications": "Notifications", "You are not receiving desktop notifications": "You are not receiving desktop notifications", "Enable them now": "Enable them now", "Close": "Close", + "Your homeserver has exceeded its user limit.": "Your homeserver has exceeded its user limit.", + "Your homeserver has exceeded one of its resource limits.": "Your homeserver has exceeded one of its resource limits.", + "Contact your server admin.": "Contact your server admin.", + "Warning": "Warning", + "Ok": "Ok", + "Set password": "Set password", + "To return to your account in future you need to set a password": "To return to your account in future you need to set a password", + "Set Password": "Set Password", "Set up encryption": "Set up encryption", "Encryption upgrade available": "Encryption upgrade available", "Verify this session": "Verify this session", @@ -781,7 +790,6 @@ "Account management": "Account management", "Deactivating your account is a permanent action - be careful!": "Deactivating your account is a permanent action - be careful!", "Deactivate Account": "Deactivate Account", - "Warning": "Warning", "General": "General", "Discovery": "Discovery", "Deactivate account": "Deactivate account", @@ -1383,18 +1391,10 @@ "Something went wrong when trying to get your communities.": "Something went wrong when trying to get your communities.", "Display your community flair in rooms configured to show it.": "Display your community flair in rooms configured to show it.", "You're not currently a member of any communities.": "You're not currently a member of any communities.", - "Please help improve Riot.im by sending anonymous usage data. This will use a cookie (please see our Cookie Policy).": "Please help improve Riot.im by sending anonymous usage data. This will use a cookie (please see our Cookie Policy).", - "Please help improve Riot.im by sending anonymous usage data. This will use a cookie.": "Please help improve Riot.im by sending anonymous usage data. This will use a cookie.", - "Yes, I want to help!": "Yes, I want to help!", "What's New": "What's New", "Update": "Update", "What's new?": "What's new?", "A new version of Riot is available.": "A new version of Riot is available.", - "To return to your account in future you need to set a password": "To return to your account in future you need to set a password", - "Set Password": "Set Password", - "Please contact your service administrator to get this limit increased.": "Please contact your service administrator to get this limit increased.", - "This homeserver has hit its Monthly Active User limit so some users will not be able to log in.": "This homeserver has hit its Monthly Active User limit so some users will not be able to log in.", - "This homeserver has exceeded one of its resource limits so some users will not be able to log in.": "This homeserver has exceeded one of its resource limits so some users will not be able to log in.", "Error encountered (%(errorDetail)s).": "Error encountered (%(errorDetail)s).", "Checking for an update...": "Checking for an update...", "No update available.": "No update available.", From 891ba1bbe3c34bf5651846d425c07d969fec7cb7 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 22 May 2020 23:08:45 +0100 Subject: [PATCH 015/123] Replace New Version Bar with a Toast discards the `new_version` dispatch Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- res/css/views/globals/_MatrixToolbar.scss | 4 - src/components/structures/LoggedInView.tsx | 11 +- src/components/structures/MatrixChat.tsx | 21 ---- src/components/views/globals/NewVersionBar.js | 108 ------------------ src/i18n/strings/en_EN.json | 10 +- src/toasts/UpdateToast.tsx | 90 +++++++++++++++ 6 files changed, 99 insertions(+), 145 deletions(-) delete mode 100644 src/components/views/globals/NewVersionBar.js create mode 100644 src/toasts/UpdateToast.tsx diff --git a/res/css/views/globals/_MatrixToolbar.scss b/res/css/views/globals/_MatrixToolbar.scss index 5fdf572f99..07b92a7235 100644 --- a/res/css/views/globals/_MatrixToolbar.scss +++ b/res/css/views/globals/_MatrixToolbar.scss @@ -67,7 +67,3 @@ limitations under the License. .mx_MatrixToolbar_action { margin-right: 16px; } - -.mx_MatrixToolbar_changelog { - white-space: pre; -} diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index edb2482aa3..2a17233ec6 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -74,7 +74,6 @@ interface IProps { initialEventPixelOffset: number; leftDisabled: boolean; rightDisabled: boolean; - hasNewVersion: boolean; page_type: string; autoJoin: boolean; thirdPartyInvite?: object; @@ -96,6 +95,7 @@ interface IProps { newVersion?: string; newVersionReleaseNotes?: string; } + interface IState { mouseDown?: { x: number; @@ -183,7 +183,7 @@ class LoggedInView extends React.PureComponent { componentDidUpdate(prevProps, prevState) { // attempt to guess when a banner was opened or closed if ( - (prevProps.hasNewVersion !== this.props.hasNewVersion) + (prevProps.checkingForUpdate !== this.props.checkingForUpdate) ) { this.props.resizeNotifier.notifyBannersChanged(); } @@ -620,7 +620,6 @@ class LoggedInView extends React.PureComponent { const GroupView = sdk.getComponent('structures.GroupView'); const MyGroups = sdk.getComponent('structures.MyGroups'); const ToastContainer = sdk.getComponent('structures.ToastContainer'); - const NewVersionBar = sdk.getComponent('globals.NewVersionBar'); const UpdateCheckBar = sdk.getComponent('globals.UpdateCheckBar'); let pageElement; @@ -666,11 +665,7 @@ class LoggedInView extends React.PureComponent { } let topBar; - if (this.props.hasNewVersion) { - topBar = ; - } else if (this.props.checkingForUpdate) { + if (this.props.checkingForUpdate) { topBar = ; } diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index c69911fe04..f4d31708fe 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -173,10 +173,6 @@ interface IState { leftDisabled: boolean; middleDisabled: boolean; // the right panel's disabled state is tracked in its store. - version?: string; - newVersion?: string; - hasNewVersion: boolean; - newVersionReleaseNotes?: string; checkingForUpdate?: string; // updateCheckStatusEnum // Parameters used in the registration dance with the IS register_client_secret?: string; @@ -230,7 +226,6 @@ export default class MatrixChat extends React.PureComponent { leftDisabled: false, middleDisabled: false, - hasNewVersion: false, newVersionReleaseNotes: null, checkingForUpdate: null, @@ -726,12 +721,6 @@ export default class MatrixChat extends React.PureComponent { case 'client_started': this.onClientStarted(); break; - case 'new_version': - this.onVersion( - payload.currentVersion, payload.newVersion, - payload.releaseNotes, - ); - break; case 'check_updates': this.setState({ checkingForUpdate: payload.value }); break; @@ -1820,16 +1809,6 @@ export default class MatrixChat extends React.PureComponent { this.showScreen("settings"); }; - onVersion(current: string, latest: string, releaseNotes?: string) { - this.setState({ - version: current, - newVersion: latest, - hasNewVersion: current !== latest, - newVersionReleaseNotes: releaseNotes, - checkingForUpdate: null, - }); - } - onSendEvent(roomId: string, event: MatrixEvent) { const cli = MatrixClientPeg.get(); if (!cli) { diff --git a/src/components/views/globals/NewVersionBar.js b/src/components/views/globals/NewVersionBar.js deleted file mode 100644 index dedccdc6b6..0000000000 --- a/src/components/views/globals/NewVersionBar.js +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright 2015, 2016 OpenMarket Ltd -Copyright 2019 Michael Telatynski <7t3chguy@gmail.com> - -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. -*/ - -import React from 'react'; -import PropTypes from 'prop-types'; -import createReactClass from 'create-react-class'; -import * as sdk from '../../../index'; -import Modal from '../../../Modal'; -import PlatformPeg from '../../../PlatformPeg'; -import { _t } from '../../../languageHandler'; - -/** - * Check a version string is compatible with the Changelog - * dialog ([vectorversion]-react-[react-sdk-version]-js-[js-sdk-version]) - */ -function checkVersion(ver) { - const parts = ver.split('-'); - return parts.length == 5 && parts[1] == 'react' && parts[3] == 'js'; -} - -export default createReactClass({ - propTypes: { - version: PropTypes.string.isRequired, - newVersion: PropTypes.string.isRequired, - releaseNotes: PropTypes.string, - }, - - displayReleaseNotes: function(releaseNotes) { - const QuestionDialog = sdk.getComponent('dialogs.QuestionDialog'); - Modal.createTrackedDialog('Display release notes', '', QuestionDialog, { - title: _t("What's New"), - description:
{releaseNotes}
, - button: _t("Update"), - onFinished: (update) => { - if (update && PlatformPeg.get()) { - PlatformPeg.get().installUpdate(); - } - }, - }); - }, - - displayChangelog: function() { - const ChangelogDialog = sdk.getComponent('dialogs.ChangelogDialog'); - Modal.createTrackedDialog('Display Changelog', '', ChangelogDialog, { - version: this.props.version, - newVersion: this.props.newVersion, - onFinished: (update) => { - if (update && PlatformPeg.get()) { - PlatformPeg.get().installUpdate(); - } - }, - }); - }, - - onUpdateClicked: function() { - PlatformPeg.get().installUpdate(); - }, - - render: function() { - let action_button; - // If we have release notes to display, we display them. Otherwise, - // we display the Changelog Dialog which takes two versions and - // automatically tells you what's changed (provided the versions - // are in the right format) - if (this.props.releaseNotes) { - action_button = ( - - ); - } else if (checkVersion(this.props.version) && checkVersion(this.props.newVersion)) { - action_button = ( - - ); - } else if (PlatformPeg.get()) { - action_button = ( - - ); - } - return ( -
- -
- {_t("A new version of Riot is available.")} -
- {action_button} -
- ); - }, -}); diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 72c19587c8..0170aee17a 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -421,6 +421,12 @@ "Other users may not trust it": "Other users may not trust it", "New login. Was this you?": "New login. Was this you?", "Verify the new login accessing your account: %(name)s": "Verify the new login accessing your account: %(name)s", + "What's New": "What's New", + "Update": "Update", + "What's new?": "What's new?", + "Restart": "Restart", + "Upgrade your Riot": "Upgrade your Riot", + "A new version of Riot is available!": "A new version of Riot is available!", "There was an error joining the room": "There was an error joining the room", "Sorry, your homeserver is too old to participate in this room.": "Sorry, your homeserver is too old to participate in this room.", "Please contact your homeserver administrator.": "Please contact your homeserver administrator.", @@ -1391,10 +1397,6 @@ "Something went wrong when trying to get your communities.": "Something went wrong when trying to get your communities.", "Display your community flair in rooms configured to show it.": "Display your community flair in rooms configured to show it.", "You're not currently a member of any communities.": "You're not currently a member of any communities.", - "What's New": "What's New", - "Update": "Update", - "What's new?": "What's new?", - "A new version of Riot is available.": "A new version of Riot is available.", "Error encountered (%(errorDetail)s).": "Error encountered (%(errorDetail)s).", "Checking for an update...": "Checking for an update...", "No update available.": "No update available.", diff --git a/src/toasts/UpdateToast.tsx b/src/toasts/UpdateToast.tsx new file mode 100644 index 0000000000..3d4b55a4ff --- /dev/null +++ b/src/toasts/UpdateToast.tsx @@ -0,0 +1,90 @@ +/* +Copyright 2020 The Matrix.org Foundation C.I.C. + +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. +*/ + +import React from "react"; + +import { _t } from "../languageHandler"; +import GenericToast from "../components/views/toasts/GenericToast"; +import ToastStore from "../stores/ToastStore"; +import QuestionDialog from "../components/views/dialogs/QuestionDialog"; +import ChangelogDialog from "../components/views/dialogs/ChangelogDialog"; +import PlatformPeg from "../PlatformPeg"; +import Modal from "../Modal"; + +const TOAST_KEY = "update"; + +/* + * Check a version string is compatible with the Changelog + * dialog ([riot-version]-react-[react-sdk-version]-js-[js-sdk-version]) + */ +function checkVersion(ver) { + const parts = ver.split('-'); + return parts.length === 5 && parts[1] === 'react' && parts[3] === 'js'; +} + +function installUpdate() { + PlatformPeg.get().installUpdate(); +} + +export const showToast = (version: string, newVersion: string, releaseNotes?: string) => { + let onAccept; + let acceptLabel = _t("What's new?"); + if (releaseNotes) { + onAccept = () => { + Modal.createTrackedDialog('Display release notes', '', QuestionDialog, { + title: _t("What's New"), + description:
{releaseNotes}
, + button: _t("Update"), + onFinished: (update) => { + if (update && PlatformPeg.get()) { + PlatformPeg.get().installUpdate(); + } + }, + }); + }; + } else if (checkVersion(version) && checkVersion(newVersion)) { + onAccept = () => { + Modal.createTrackedDialog('Display Changelog', '', ChangelogDialog, { + version, + newVersion, + onFinished: (update) => { + if (update && PlatformPeg.get()) { + PlatformPeg.get().installUpdate(); + } + }, + }); + }; + } else { + onAccept = installUpdate; + acceptLabel = _t("Restart"); + } + + ToastStore.sharedInstance().addOrReplaceToast({ + key: TOAST_KEY, + title: _t("Upgrade your Riot"), + props: { + description: _t("A new version of Riot is available!"), + acceptLabel, + onAccept, + }, + component: GenericToast, + priority: 20, + }); +}; + +export const hideToast = () => { + ToastStore.sharedInstance().dismissToast(TOAST_KEY); +}; From 41934268087fa0b9be828f1714eb4a5e3ab6f28a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 22 May 2020 23:14:33 +0100 Subject: [PATCH 016/123] delint Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/LoggedInView.tsx | 3 --- src/components/structures/MatrixChat.tsx | 1 - 2 files changed, 4 deletions(-) diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index 2a17233ec6..df21768da5 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -91,9 +91,6 @@ interface IProps { currentUserId?: string; currentGroupId?: string; currentGroupIsNew?: boolean; - version?: string; - newVersion?: string; - newVersionReleaseNotes?: string; } interface IState { diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index f4d31708fe..e6db42af1d 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -226,7 +226,6 @@ export default class MatrixChat extends React.PureComponent { leftDisabled: false, middleDisabled: false, - newVersionReleaseNotes: null, checkingForUpdate: null, hideToSRUsers: false, From 3d2b56aecd38ea399f2666b688c4007438384411 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 22 May 2020 23:23:23 +0100 Subject: [PATCH 017/123] i18n Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- 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 0170aee17a..97ada284b0 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -421,9 +421,9 @@ "Other users may not trust it": "Other users may not trust it", "New login. Was this you?": "New login. Was this you?", "Verify the new login accessing your account: %(name)s": "Verify the new login accessing your account: %(name)s", + "What's new?": "What's new?", "What's New": "What's New", "Update": "Update", - "What's new?": "What's new?", "Restart": "Restart", "Upgrade your Riot": "Upgrade your Riot", "A new version of Riot is available!": "A new version of Riot is available!", From 066dd4b61140b14db91d52ae63f8b59caa32c861 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 23 May 2020 08:48:28 +0100 Subject: [PATCH 018/123] Update Modular hosting link Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/auth/ModularServerConfig.js | 3 ++- src/components/views/auth/ServerTypeSelector.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/views/auth/ModularServerConfig.js b/src/components/views/auth/ModularServerConfig.js index 1216202a23..591c30ee7c 100644 --- a/src/components/views/auth/ModularServerConfig.js +++ b/src/components/views/auth/ModularServerConfig.js @@ -23,7 +23,8 @@ import AutoDiscoveryUtils from "../../../utils/AutoDiscoveryUtils"; import * as ServerType from '../../views/auth/ServerTypeSelector'; import ServerConfig from "./ServerConfig"; -const MODULAR_URL = 'https://modular.im/?utm_source=riot-web&utm_medium=web&utm_campaign=riot-web-authentication'; +const MODULAR_URL = 'https://modular.im/services/matrix-hosting-riot' + + '?utm_source=riot-web&utm_medium=web&utm_campaign=riot-web-authentication'; // TODO: TravisR - Can this extend ServerConfig for most things? diff --git a/src/components/views/auth/ServerTypeSelector.js b/src/components/views/auth/ServerTypeSelector.js index fe29b7f76c..a8a1dda968 100644 --- a/src/components/views/auth/ServerTypeSelector.js +++ b/src/components/views/auth/ServerTypeSelector.js @@ -22,7 +22,8 @@ import classnames from 'classnames'; import {ValidatedServerConfig} from "../../../utils/AutoDiscoveryUtils"; import {makeType} from "../../../utils/TypeUtils"; -const MODULAR_URL = 'https://modular.im/?utm_source=riot-web&utm_medium=web&utm_campaign=riot-web-authentication'; +const MODULAR_URL = 'https://modular.im/services/matrix-hosting-riot' + + '?utm_source=riot-web&utm_medium=web&utm_campaign=riot-web-authentication'; export const FREE = 'Free'; export const PREMIUM = 'Premium'; From d7f8fdec52a3adf8d488349d7922462560a45311 Mon Sep 17 00:00:00 2001 From: MamasLT Date: Tue, 26 May 2020 10:02:15 +0000 Subject: [PATCH 019/123] Translated using Weblate (Lithuanian) Currently translated at 64.3% (1492 of 2322 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/lt/ --- src/i18n/strings/lt.json | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/i18n/strings/lt.json b/src/i18n/strings/lt.json index d74589c553..3ba5cde9a8 100644 --- a/src/i18n/strings/lt.json +++ b/src/i18n/strings/lt.json @@ -57,7 +57,7 @@ "Please set a password!": "Prašau įrašykite slaptažodį!", "powered by Matrix": "veikia su Matrix", "You have successfully set a password!": "Jūs sėkmingai įrašėte slaptažodį!", - "Favourite": "Svarbūs", + "Favourite": "Favoritai", "All Rooms": "Visi pokalbių kambariai", "Explore Room State": "Peržiūrėti kambario būseną", "Source URL": "Šaltinio URL adresas", @@ -137,7 +137,7 @@ "Messages in group chats": "Žinutės grupės pokalbiuose", "Yesterday": "Vakar", "Error encountered (%(errorDetail)s).": "Susidurta su klaida (%(errorDetail)s).", - "Low Priority": "Nesvarbūs", + "Low Priority": "Žemo prioriteto", "Riot does not know how to join a room on this network": "Riot nežino kaip prisijungti prie kambario šiame tinkle", "Set Password": "Nustatyti slaptažodį", "An error occurred whilst saving your email notification preferences.": "Išsaugant pranešimų el. paštu nuostatas, įvyko klaida.", @@ -155,7 +155,7 @@ "Add rooms to this community": "Įtraukti kambarius į šią bendruomenę", "Pin Message": "Prisegti žinutę", "Failed to change settings": "Nepavyko pakeisti nustatymų", - "Leave": "Atsijungti", + "Leave": "Išeiti", "View Community": "Peržiūrėti bendruomenes", "Developer Tools": "Programuotojo įrankiai", "Unhide Preview": "Rodyti paržiūrą", @@ -896,7 +896,7 @@ "Explore": "Žvalgyti", "Filter": "Filtruoti", "Filter rooms…": "Filtruoti kambarius…", - "This room is not public. You will not be able to rejoin without an invite.": "Šis kambarys nėra viešas. Jūs negalėsite prie jo vėl prisijungti be pakvietimo.", + "This room is not public. You will not be able to rejoin without an invite.": "Šis kambarys nėra viešas. Jūs negalėsite vėl prie jo prisijungti be pakvietimo.", "Are you sure you want to leave the room '%(roomName)s'?": "Ar tikrai norite išeiti iš kambario %(roomName)s?", "%(creator)s created and configured the room.": "%(creator)s sukūrė ir sukonfigūravo kambarį.", "Riot failed to get the public room list.": "Riot nepavyko gauti viešų kambarių sąrašo.", @@ -1528,5 +1528,13 @@ "Select room from the room list": "Pasirinkite kambarį iš kambarių sąrašo", "Collapse room list section": "Sutraukti kambarių sąrašo skyrių", "Expand room list section": "Išplėsti kambarių sąrašo skyrių", - "Clear room list filter field": "Išvalyti kambarių sąrašo filtro lauką" + "Clear room list filter field": "Išvalyti kambarių sąrašo filtro lauką", + "Community IDs cannot be empty.": "Bendruomenių ID negali būti tušti.", + "Failed to reject invitation": "Nepavyko atmesti pakvietimo", + "Failed to leave room": "Nepavyko išeiti iš kambario", + "Can't leave Server Notices room": "Negalima išeiti iš Serverio Pranešimų kambario", + "This room is used for important messages from the Homeserver, so you cannot leave it.": "Šis kambarys yra naudojamas svarbioms žinutėms iš serverio, todėl jūs negalite jo palikti.", + "Terms and Conditions": "Taisyklės ir Sąlygos", + "Self-verification request": "Savipatvirtinimo užklausa", + "Logout": "Atsijungti" } From 1b8a7a33a43ad6477c183d7e6ef98d888e359c1f Mon Sep 17 00:00:00 2001 From: Szimszon Date: Tue, 26 May 2020 11:12:14 +0000 Subject: [PATCH 020/123] Translated using Weblate (Hungarian) Currently translated at 99.2% (2304 of 2322 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/hu/ --- src/i18n/strings/hu.json | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/hu.json b/src/i18n/strings/hu.json index 17254a77db..98a1514685 100644 --- a/src/i18n/strings/hu.json +++ b/src/i18n/strings/hu.json @@ -2424,5 +2424,18 @@ "Click the button below to confirm setting up encryption.": "Az alábbi gomb megnyomásával erősítsd meg, hogy megadod a titkosítási beállításokat.", "Dismiss read marker and jump to bottom": "Az olvasottak jel eltűntetése és ugrás a végére", "Jump to oldest unread message": "A legrégebbi olvasatlan üzenetre ugrás", - "Upload a file": "Fájl feltöltése" + "Upload a file": "Fájl feltöltése", + "Room name or address": "A szoba neve vagy címe", + "Joins room with given address": "Megadott címmel csatlakozik a szobához", + "Unrecognised room address:": "Ismeretlen szoba cím:", + "Font scaling": "Betű nagyítás", + "Use the improved room list (in development - refresh to apply changes)": "Fejlesztett szobalista használata (fejlesztés alatt - frissíts a változások életbe léptetéséhez)", + "Use IRC layout": "IRC kinézet használata", + "Font size": "Betűméret", + "Custom font size": "Egyedit betűméret", + "IRC display name width": "IRC megjelenítési név szélessége", + "Size must be a number": "A méretnek számnak kell lennie", + "Custom font size can only be between %(min)s pt and %(max)s pt": "Az egyedi betűméret csak %(min)s pont és %(max)s pont között lehet", + "Use between %(min)s pt and %(max)s pt": "Csak %(min)s pont és %(max)s pont közötti értéket használj", + "Appearance": "Megjelenítés" } From 60174815660e607cae5e1616050f9266249427e2 Mon Sep 17 00:00:00 2001 From: MamasLT Date: Tue, 26 May 2020 11:43:56 +0000 Subject: [PATCH 021/123] Translated using Weblate (Lithuanian) Currently translated at 64.4% (1495 of 2322 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/lt/ --- src/i18n/strings/lt.json | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/i18n/strings/lt.json b/src/i18n/strings/lt.json index 3ba5cde9a8..f028c89fc1 100644 --- a/src/i18n/strings/lt.json +++ b/src/i18n/strings/lt.json @@ -874,7 +874,7 @@ "Do you want to chat with %(user)s?": "Ar jūs norite kalbėtis su %(user)s?", " wants to chat": " nori kalbėtis", "Start chatting": "Pradėti kalbėtis", - "Do you want to join %(roomName)s?": "Ar jūs norite prisijungti prie %(roomName)s?", + "Do you want to join %(roomName)s?": "Ar jūs norite prisijungti prie %(roomName)s kanalo?", " invited you": " jus pakvietė", "You're previewing %(roomName)s. Want to join it?": "Jūs peržiūrite %(roomName)s. Norite prie jo prisijungti?", "%(roomName)s can't be previewed. Do you want to join it?": "%(roomName)s negali būti peržiūrėtas. Ar jūs norite prie jo prisijungti?", @@ -957,10 +957,10 @@ "%(severalUsers)sleft and rejoined %(count)s times|one": "%(severalUsers)s išėjo ir vėl prisijungė", "%(oneUser)sleft and rejoined %(count)s times|other": "%(oneUser)s išėjo ir vėl prisijungė %(count)s kartų(-us)", "%(oneUser)sleft and rejoined %(count)s times|one": "%(oneUser)s išėjo ir vėl prisijungė", - "%(severalUsers)srejected their invitations %(count)s times|other": "%(severalUsers)s atmetė jų kvietimus %(count)s kartų(-us)", - "%(severalUsers)srejected their invitations %(count)s times|one": "%(severalUsers)s atmetė jų kvietimus", - "%(oneUser)srejected their invitation %(count)s times|other": "%(oneUser)s atmetė jų kvietimą %(count)s kartų(-us)", - "%(oneUser)srejected their invitation %(count)s times|one": "%(oneUser)s atmetė jų kvietimą", + "%(severalUsers)srejected their invitations %(count)s times|other": "%(severalUsers)s atmetė pakvietimus %(count)s kartų(-us)", + "%(severalUsers)srejected their invitations %(count)s times|one": "%(severalUsers)s atmetė pakvietimus", + "%(oneUser)srejected their invitation %(count)s times|other": "%(oneUser)s atmetė pakvietimą %(count)s kartų(-us)", + "%(oneUser)srejected their invitation %(count)s times|one": "%(oneUser)s atmetė pakvietimą", "%(severalUsers)shad their invitations withdrawn %(count)s times|other": "%(severalUsers)s atšaukė savo pakvietimus %(count)s kartų(-us)", "%(severalUsers)shad their invitations withdrawn %(count)s times|one": "%(severalUsers)s atšaukė savo pakvietimus", "%(oneUser)shad their invitation withdrawn %(count)s times|other": "%(oneUser)s atšaukė savo pakvietimą %(count)s kartų(-us)", @@ -1101,7 +1101,7 @@ "Send a message…": "Siųsti žinutę…", "Never lose encrypted messages": "Niekada nepraraskite šifruotų žinučių", "Messages in this room are secured with end-to-end encryption. Only you and the recipient(s) have the keys to read these messages.": "Žinutės šiame kambaryje yra apsaugotos visapusiu šifravimu. Tik jūs ir gavėjas(-ai) turite raktus šioms žinutėms perskaityti.", - "Securely back up your keys to avoid losing them. Learn more.": "Saugiai sukurkite jūsų raktų atsargines kopijas, kad išvengtumėte jų praradimo. Sužinoti daugiau.", + "Securely back up your keys to avoid losing them. Learn more.": "Saugiai sukurkite jūsų raktų atsarginę kopiją, kad išvengtumėte jų praradimo. Sužinoti daugiau.", "Not now": "Ne dabar", "Don't ask me again": "Daugiau neklausti", "Send as message": "Siųsti kaip žinutę", @@ -1249,7 +1249,7 @@ "Send report": "Siųsti pranešimą", "Unknown sessions": "Nežinomi seansai", "Verify other session": "Patvirtinti kitą seansą", - "Are you sure you want to reject the invitation?": "Ar tikrai norite atšaukti pakvietimą?", + "Are you sure you want to reject the invitation?": "Ar tikrai norite atmesti pakvietimą?", "Share Permalink": "Dalintis nuoroda", "Report Content": "Pranešti", "Nice, strong password!": "Puiku, stiprus slaptažodis!", @@ -1536,5 +1536,8 @@ "This room is used for important messages from the Homeserver, so you cannot leave it.": "Šis kambarys yra naudojamas svarbioms žinutėms iš serverio, todėl jūs negalite jo palikti.", "Terms and Conditions": "Taisyklės ir Sąlygos", "Self-verification request": "Savipatvirtinimo užklausa", - "Logout": "Atsijungti" + "Logout": "Atsijungti", + "Reject & Ignore user": "Atmesti ir ignoruoti vartotoją", + "Reject invitation": "Atmesti pakvietimą", + "Unable to reject invite": "Nepavyko atmesti pakvietimo" } From fb73bac4cf7c847d088be2f02414c82c4eeee041 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 26 May 2020 13:53:28 +0100 Subject: [PATCH 022/123] Update UpdateToast's priority to 30 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/toasts/UpdateToast.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/toasts/UpdateToast.tsx b/src/toasts/UpdateToast.tsx index 3d4b55a4ff..55c128e86a 100644 --- a/src/toasts/UpdateToast.tsx +++ b/src/toasts/UpdateToast.tsx @@ -81,7 +81,7 @@ export const showToast = (version: string, newVersion: string, releaseNotes?: st onAccept, }, component: GenericToast, - priority: 20, + priority: 30, }); }; From c2ccac0d7679da437f93d72b8764e55dd17323c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanislav=20Luke=C5=A1?= Date: Tue, 26 May 2020 13:23:34 +0000 Subject: [PATCH 023/123] Translated using Weblate (Czech) Currently translated at 93.8% (2163 of 2306 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/cs/ --- src/i18n/strings/cs.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/cs.json b/src/i18n/strings/cs.json index e5568d7bfb..cce304bddb 100644 --- a/src/i18n/strings/cs.json +++ b/src/i18n/strings/cs.json @@ -2294,5 +2294,8 @@ "Sends a message to the given user": "Pošle zprávu danému uživateli", "Waiting for your other session to verify…": "Čekáme na ověření od vaší druhé relace…", "Verify all your sessions to ensure your account & messages are safe": "Ověřte všechny své relace, abyste zaručili, že jsou vaše zprávy a účet bezpečné", - "Verify the new login accessing your account: %(name)s": "Ověřte nové přihlášení na váš účet: %(name)s" + "Verify the new login accessing your account: %(name)s": "Ověřte nové přihlášení na váš účet: %(name)s", + "Room name or address": "Jméno nebo adresa místnosti", + "Joins room with given address": "Přidat se do místnosti s danou adresou", + "Unrecognised room address:": "Nerozpoznaná adresa místnosti:" } From f51c93ba6829e2b7d7b75400b152ba4de484a921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanislav=20Luke=C5=A1?= Date: Tue, 26 May 2020 13:28:30 +0000 Subject: [PATCH 024/123] Translated using Weblate (Czech) Currently translated at 94.4% (2177 of 2306 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/cs/ --- src/i18n/strings/cs.json | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/cs.json b/src/i18n/strings/cs.json index cce304bddb..0b50bd669a 100644 --- a/src/i18n/strings/cs.json +++ b/src/i18n/strings/cs.json @@ -2297,5 +2297,19 @@ "Verify the new login accessing your account: %(name)s": "Ověřte nové přihlášení na váš účet: %(name)s", "Room name or address": "Jméno nebo adresa místnosti", "Joins room with given address": "Přidat se do místnosti s danou adresou", - "Unrecognised room address:": "Nerozpoznaná adresa místnosti:" + "Unrecognised room address:": "Nerozpoznaná adresa místnosti:", + "Use IRC layout": "Používat rozložení IRC", + "Font size": "Velikost písma", + "Custom font size": "Vlastní velikost písma", + "IRC display name width": "šířka zobrazovného IRC jména", + "unexpected type": "neočekávaný typ", + "Session backup key:": "Klíč k záloze relace:", + "Confirm deleting these sessions by using Single Sign On to prove your identity.|other": "Pomocí Jednotného přihlášení potvrdit odstranění těchto relací.", + "Confirm deleting these sessions by using Single Sign On to prove your identity.|one": "Pomocí Jednotného přihlášení potvrdit odstranění této relace.", + "Size must be a number": "Velikost musí být číslo", + "Custom font size can only be between %(min)s pt and %(max)s pt": "Vlastní velikost písma může být pouze mezi %(min)s pt a %(max)s pt", + "Use between %(min)s pt and %(max)s pt": "Použijte velikost mezi %(min)s pt a %(max)s pt", + "Appearance": "Vzhled", + "Please verify the room ID or address and try again.": "Ověřte prosím, že ID místnosti je správné a zkuste to znovu.", + "Room ID or address of ban list": "ID nebo adresa seznamu zablokovaných" } From fcbd197e7df2c7f32b98c3cf4c704f4d2f90e979 Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Tue, 26 May 2020 15:56:16 +0100 Subject: [PATCH 025/123] Fix file list regression --- res/css/structures/_NotificationPanel.scss | 4 ++++ src/components/structures/MessagePanel.js | 22 ++++------------------ src/components/structures/RoomView.js | 21 ++++++++++++++++++++- src/components/structures/TimelinePanel.js | 4 ++++ 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/res/css/structures/_NotificationPanel.scss b/res/css/structures/_NotificationPanel.scss index 44205b1f01..561ab1446f 100644 --- a/res/css/structures/_NotificationPanel.scss +++ b/res/css/structures/_NotificationPanel.scss @@ -63,6 +63,10 @@ limitations under the License. padding-left: 32px; padding-top: 8px; position: relative; + + a { + display: flex; + } } .mx_NotificationPanel .mx_EventTile_roomName a, diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index 93e4668f66..ef738db2fd 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -108,6 +108,9 @@ export default class MessagePanel extends React.Component { // whether to show reactions for an event showReactions: PropTypes.bool, + + // whether to use the irc layout + useIRCLayout: PropTypes.bool, }; // Force props to be loaded for useIRCLayout @@ -119,7 +122,6 @@ export default class MessagePanel extends React.Component { // display 'ghost' read markers that are animating away ghostReadMarkers: [], showTypingNotifications: SettingsStore.getValue("showTypingNotifications"), - useIRCLayout: this.useIRCLayout(SettingsStore.getValue("feature_irc_ui")), }; // opaque readreceipt info for each userId; used by ReadReceiptMarker @@ -172,8 +174,6 @@ export default class MessagePanel extends React.Component { this._showTypingNotificationsWatcherRef = SettingsStore.watchSetting("showTypingNotifications", null, this.onShowTypingNotificationsChange); - - this._layoutWatcherRef = SettingsStore.watchSetting("feature_irc_ui", null, this.onLayoutChange); } componentDidMount() { @@ -183,7 +183,6 @@ export default class MessagePanel extends React.Component { componentWillUnmount() { this._isMounted = false; SettingsStore.unwatchSetting(this._showTypingNotificationsWatcherRef); - SettingsStore.unwatchSetting(this._layoutWatcherRef); } componentDidUpdate(prevProps, prevState) { @@ -202,17 +201,6 @@ export default class MessagePanel extends React.Component { }); }; - onLayoutChange = () => { - this.setState({ - useIRCLayout: this.useIRCLayout(SettingsStore.getValue("feature_irc_ui")), - }); - } - - useIRCLayout(ircLayoutSelected) { - // if room is null we are not in a normal room list - return ircLayoutSelected && this.props.room; - } - /* get the DOM node representing the given event */ getNodeForEventId(eventId) { if (!this.eventNodes) { @@ -614,7 +602,7 @@ export default class MessagePanel extends React.Component { isSelectedEvent={highlight} getRelationsForEvent={this.props.getRelationsForEvent} showReactions={this.props.showReactions} - useIRCLayout={this.state.useIRCLayout} + useIRCLayout={this.props.useIRCLayout} /> , @@ -797,8 +785,6 @@ export default class MessagePanel extends React.Component { this.props.className, { "mx_MessagePanel_alwaysShowTimestamps": this.props.alwaysShowTimestamps, - "mx_IRCLayout": this.state.useIRCLayout, - "mx_GroupLayout": !this.state.useIRCLayout, }, ); diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 635597db74..b9daac17b4 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -164,6 +164,7 @@ export default createReactClass({ canReact: false, canReply: false, + useIRCLayout: SettingsStore.getValue("feature_irc_ui"), }; }, @@ -193,6 +194,8 @@ export default createReactClass({ this._roomView = createRef(); this._searchResultsPanel = createRef(); + + this._layoutWatcherRef = SettingsStore.watchSetting("feature_irc_ui", null, this.onLayoutChange); }, _onReadReceiptsChange: function() { @@ -532,6 +535,14 @@ export default createReactClass({ // no need to do this as Dir & Settings are now overlays. It just burnt CPU. // console.log("Tinter.tint from RoomView.unmount"); // Tinter.tint(); // reset colourscheme + + SettingsStore.unwatchSetting(this._layoutWatcherRef); + }, + + onLayoutChange: function() { + this.setState({ + useIRCLayout: SettingsStore.getValue("feature_irc_ui"), + }); }, _onRightPanelStoreUpdate: function() { @@ -1980,6 +1991,13 @@ export default createReactClass({ highlightedEventId = this.state.initialEventId; } + const messagePanelClassNames = classNames( + "mx_RoomView_messagePanel", + { + "mx_IRCLayout": this.state.useIRCLayout, + "mx_GroupLayout": !this.state.useIRCLayout, + }); + // console.info("ShowUrlPreview for %s is %s", this.state.room.roomId, this.state.showUrlPreview); const messagePanel = ( ); let topUnreadMessagesBar = null; diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index da1369c45f..95dc42fcee 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -112,6 +112,9 @@ const TimelinePanel = createReactClass({ // whether to show reactions for an event showReactions: PropTypes.bool, + + // whether to use the irc layout + useIRCLayout: PropTypes.bool, }, statics: { @@ -1447,6 +1450,7 @@ const TimelinePanel = createReactClass({ getRelationsForEvent={this.getRelationsForEvent} editState={this.state.editState} showReactions={this.props.showReactions} + useIRCLayout={this.props.useIRCLayout} /> ); }, From 906da4eb1c86212f81a659cf03b6bb1f04b7b227 Mon Sep 17 00:00:00 2001 From: MamasLT Date: Tue, 26 May 2020 16:46:52 +0000 Subject: [PATCH 026/123] Translated using Weblate (Lithuanian) Currently translated at 64.5% (1488 of 2306 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/lt/ --- src/i18n/strings/lt.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/i18n/strings/lt.json b/src/i18n/strings/lt.json index f028c89fc1..b4afcaea26 100644 --- a/src/i18n/strings/lt.json +++ b/src/i18n/strings/lt.json @@ -1097,7 +1097,7 @@ "Later": "Vėliau", "Verify yourself & others to keep your chats safe": "Patvirtinkite save ir kitus, kad jūsų pokalbiai būtų saugūs", "Go back": "Grįžti", - "This room is end-to-end encrypted": "Šis kambarys užšifruotas visapusiu šifravimu", + "This room is end-to-end encrypted": "Šis kambarys visapusiškai užšifruotas", "Send a message…": "Siųsti žinutę…", "Never lose encrypted messages": "Niekada nepraraskite šifruotų žinučių", "Messages in this room are secured with end-to-end encryption. Only you and the recipient(s) have the keys to read these messages.": "Žinutės šiame kambaryje yra apsaugotos visapusiu šifravimu. Tik jūs ir gavėjas(-ai) turite raktus šioms žinutėms perskaityti.", @@ -1539,5 +1539,10 @@ "Logout": "Atsijungti", "Reject & Ignore user": "Atmesti ir ignoruoti vartotoją", "Reject invitation": "Atmesti pakvietimą", - "Unable to reject invite": "Nepavyko atmesti pakvietimo" + "Unable to reject invite": "Nepavyko atmesti pakvietimo", + "Whether you're using Riot as an installed Progressive Web App": "Nesvarbu, ar naudojate Riot kaip įdiegtą progresyviąją žiniatinklio programą", + "Your user agent": "Jūsų vartotojo agentas", + "The information being sent to us to help make Riot better includes:": "Informacija, siunčiama mums siekiant pagerinti Riot, yra:", + "Invite only": "Tik pakviestiems", + "You can only join it with a working invite.": "Jūs galite prisijungti tik su veikiančiu pakvietimu." } From bca58bed02cb14ac9bdfcb1079f9219994e61dec Mon Sep 17 00:00:00 2001 From: Imre Kristoffer Eilertsen Date: Tue, 26 May 2020 19:44:14 +0000 Subject: [PATCH 027/123] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegi?= =?UTF-8?q?an=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 56.5% (1304 of 2306 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/nb_NO/ --- src/i18n/strings/nb_NO.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/nb_NO.json b/src/i18n/strings/nb_NO.json index 59182a0249..8554e3d86b 100644 --- a/src/i18n/strings/nb_NO.json +++ b/src/i18n/strings/nb_NO.json @@ -1342,5 +1342,7 @@ "Enter a recovery passphrase...": "Skriv inn en gjenopprettingspassfrase …", "Please enter your recovery passphrase a second time to confirm.": "Skriv inn gjenopprettingspassfrasen din en andre gang for å bekrefte.", "Repeat your recovery passphrase...": "Gjenta gjenopprettingspassfrasen din …", - "Other users may not trust it": "Andre brukere kan kanskje mistro den" + "Other users may not trust it": "Andre brukere kan kanskje mistro den", + " reacted with %(content)s": " reagerte med %(content)s", + "reacted with %(shortName)s": " reagerte med %(shortName)s" } From 005b1fa08048fc90d140d15f6f51169597d60ae2 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Wed, 27 May 2020 03:24:21 +0000 Subject: [PATCH 028/123] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (2306 of 2306 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/zh_Hant/ --- src/i18n/strings/zh_Hant.json | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/zh_Hant.json b/src/i18n/strings/zh_Hant.json index 9495c01db7..f00dc8adfb 100644 --- a/src/i18n/strings/zh_Hant.json +++ b/src/i18n/strings/zh_Hant.json @@ -2445,5 +2445,27 @@ "Custom font size can only be between %(min)s pt and %(max)s pt": "自訂字型大小僅能為 %(min)s 點至 %(max)s 點間", "Use between %(min)s pt and %(max)s pt": "使用 %(min)s 點至 %(max)s 點間", "Appearance": "外觀", - "Use the improved room list (in development - refresh to apply changes)": "使用改進的聊天室清單(開發中 - 重新整理以套用變更)" + "Use the improved room list (in development - refresh to apply changes)": "使用改進的聊天室清單(開發中 - 重新整理以套用變更)", + "Room name or address": "聊天室名稱或地址", + "Joins room with given address": "以給定的地址加入聊天室", + "Unrecognised room address:": "無法識別的聊天室地址:", + "Please verify the room ID or address and try again.": "請驗證聊天室 ID 或地址並再試一次。", + "Room ID or address of ban list": "聊天室 ID 或地址的封鎖清單", + "To link to this room, please add an address.": "要連結到此聊天室,請新增地址。", + "Error creating address": "建立地址錯誤", + "There was an error creating that address. It may not be allowed by the server or a temporary failure occurred.": "建立該地址時發生錯誤。伺服器可能不允許這麼做,或是有暫時性的問題。", + "You don't have permission to delete the address.": "您沒有刪除地址的權限。", + "There was an error removing that address. It may no longer exist or a temporary error occurred.": "移除地址時發生錯誤。它可能已不存在或是有暫時性的問題。", + "Error removing address": "移除地址時發生錯誤", + "Categories": "分類", + "Room address": "聊天室地址", + "Please provide a room address": "請提供聊天室地址", + "This address is available to use": "此地址可用", + "This address is already in use": "此地址已被使用", + "Set a room address to easily share your room with other people.": "設定聊天室地址以輕鬆地與其他夥伴分享。", + "You've previously used a newer version of Riot with this session. To use this version again with end to end encryption, you will need to sign out and back in again.": "您先前在此工作階段中使用了較新版本的 Riot。要再次與此版本一同使用端到端加密,您必須先登出再登入。", + "Address (optional)": "地址(選擇性)", + "Delete the room address %(alias)s and remove %(name)s from the directory?": "刪除聊天室地址 %(alias)s 並從目錄移除 %(name)s?", + "delete the address.": "刪除地址。", + "Use a different passphrase?": "使用不同的通關密語?" } From e79d29b6a3cdffe17cd77172ef4b2972018857a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20C?= Date: Wed, 27 May 2020 06:47:00 +0000 Subject: [PATCH 029/123] Translated using Weblate (French) Currently translated at 100.0% (2306 of 2306 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/fr/ --- src/i18n/strings/fr.json | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/fr.json b/src/i18n/strings/fr.json index 66bb97118f..3791c534db 100644 --- a/src/i18n/strings/fr.json +++ b/src/i18n/strings/fr.json @@ -2446,5 +2446,27 @@ "Custom font size can only be between %(min)s pt and %(max)s pt": "La taille de police personnalisée doit être comprise entre %(min)s pt et %(max)s pt", "Use between %(min)s pt and %(max)s pt": "Utiliser entre %(min)s pt et %(max)s pt", "Appearance": "Apparence", - "Use the improved room list (in development - refresh to apply changes)": "Utiliser la liste de salons améliorée (en développement − actualisez pour appliquer les changements)" + "Use the improved room list (in development - refresh to apply changes)": "Utiliser la liste de salons améliorée (en développement − actualisez pour appliquer les changements)", + "Room name or address": "Nom ou adresse du salon", + "Joins room with given address": "Rejoint le salon à l’adresse donnée", + "Unrecognised room address:": "Adresse de salon non reconnue :", + "Please verify the room ID or address and try again.": "Vérifiez l’identifiant ou l’adresse du salon et réessayez.", + "Room ID or address of ban list": "Identifiant du salon ou adresse de la liste de bannissement", + "To link to this room, please add an address.": "Pour créer un lien vers ce salon, ajoutez une adresse.", + "Error creating address": "Erreur lors de la création de l’adresse", + "There was an error creating that address. It may not be allowed by the server or a temporary failure occurred.": "Une erreur est survenue lors de la création de l’adresse. Ce n’est peut-être pas autorisé par le serveur ou une erreur temporaire est survenue.", + "You don't have permission to delete the address.": "Vous n’avez pas la permission de supprimer cette adresse.", + "There was an error removing that address. It may no longer exist or a temporary error occurred.": "Une erreur est survenue lors de la suppression de cette adresse. Elle n’existe peut-être plus ou une erreur temporaire est survenue.", + "Error removing address": "Erreur lors de la suppression de l’adresse", + "Categories": "Catégories", + "Room address": "Adresse du salon", + "Please provide a room address": "Veuillez fournir une adresse de salon", + "This address is available to use": "Cette adresse est disponible", + "This address is already in use": "Cette adresse est déjà utilisée", + "Set a room address to easily share your room with other people.": "Définissez une adresse de salon pour le partager facilement avec d’autres personnes.", + "You've previously used a newer version of Riot with this session. To use this version again with end to end encryption, you will need to sign out and back in again.": "Vous avez précédemment utilisé une version plus récente de Riot avec cette session. Pour réutiliser cette version avec le chiffrement de bout en bout, vous devrez vous déconnecter et vous reconnecter.", + "Address (optional)": "Adresse (optionnel)", + "Delete the room address %(alias)s and remove %(name)s from the directory?": "Supprimer l’adresse du salon %(alias)s et supprimer %(name)s du répertoire ?", + "delete the address.": "supprimer l’adresse.", + "Use a different passphrase?": "Utiliser une phrase secrète différente ?" } From f4651bf898c331ced38e24c17fc53dfaa09f6313 Mon Sep 17 00:00:00 2001 From: XoseM Date: Wed, 27 May 2020 04:19:23 +0000 Subject: [PATCH 030/123] Translated using Weblate (Galician) Currently translated at 46.8% (1080 of 2306 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/gl/ --- src/i18n/strings/gl.json | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/gl.json b/src/i18n/strings/gl.json index 99d68ca943..3e8f721ac4 100644 --- a/src/i18n/strings/gl.json +++ b/src/i18n/strings/gl.json @@ -1085,5 +1085,35 @@ "Explore rooms": "Explorar salas", "General failure": "Fallo xeral", "This homeserver does not support login using email address.": "Este servidor non soporta a conexión usando enderezos de email.", - "Clear room list filter field": "Baleirar o campo do filtro de salas" + "Clear room list filter field": "Baleirar o campo do filtro de salas", + "Room name or address": "Nome da sala ou enderezo", + "Joins room with given address": "Unirse a sala co enderezo dado", + "Unrecognised room address:": "Non se recoñece o enderezo da sala:", + "%(senderName)s set the main address for this room to %(address)s.": "%(senderName)s estableceu o enderezo principal da sala %(address)s.", + "%(senderName)s removed the main address for this room.": "%(senderName)s eliminiou o enderezo principal desta sala.", + "%(senderName)s added the alternative addresses %(addresses)s for this room.|other": "%(senderName)s engadiu os enderezos alternativos %(addresses)s para esta sala.", + "%(senderName)s added the alternative addresses %(addresses)s for this room.|one": "%(senderName)s engadiu o enderezo alternativo %(addresses)s para esta sala.", + "%(senderName)s removed the alternative addresses %(addresses)s for this room.|other": "%(senderName)s eliminou os enderezos alternativos %(addresses)s desta sala.", + "%(senderName)s removed the alternative addresses %(addresses)s for this room.|one": "%(senderName)s eliminou o enderezo alternativo %(addresses)s desta sala.", + "%(senderName)s changed the alternative addresses for this room.": "%(senderName)s cambiou os enderezos alternativos desta sala.", + "%(senderName)s changed the main and alternative addresses for this room.": "%(senderName)s cambiou o enderezo principal e alternativo para esta sala.", + "%(senderName)s changed the addresses for this room.": "%(senderName)s cambiou o enderezo desta sala.", + "%(senderName)s placed a voice call.": "%(senderName)s fixo unha chamada de voz.", + "%(senderName)s placed a voice call. (not supported by this browser)": "%(senderName)s fixo unha chamada de voz. (non soportado neste navegador)", + "%(senderName)s placed a video call.": "%(senderName)s fixo unha chamada de vídeo.", + "%(senderName)s placed a video call. (not supported by this browser)": "%(senderName)s fixo unha chamada de vídeo. (non soportado por este navegador)", + "%(senderName)s revoked the invitation for %(targetDisplayName)s to join the room.": "%(senderName)s revogou o convite para que %(targetDisplayName)s se una a esta sala.", + "%(senderName)s removed the rule banning users matching %(glob)s": "%(senderName)s eliminou a regra que bloqueaba usuarias con %(glob)s", + "%(senderName)s removed the rule banning rooms matching %(glob)s": "%(senderName)s eliminou a regra que bloquea salas con %(glob)s", + "%(senderName)s removed the rule banning servers matching %(glob)s": "%(senderName)s eliminou a regra que bloquea servidores con %(glob)s", + "%(senderName)s removed a ban rule matching %(glob)s": "%(senderName)s eliminou a regra de bloqueo con %(glob)s", + "%(senderName)s updated an invalid ban rule": "%(senderName)s actualizou unha regra de bloqueo non válida", + "%(senderName)s updated the rule banning users matching %(glob)s for %(reason)s": "%(senderName)s actualizou a regra que bloquea usuarias con %(glob)s por %(reason)s", + "Show info about bridges in room settings": "Mostrar info sobre pontes nos axustes da sala", + "Room Addresses": "Enderezos da sala", + "There was an error updating the room's alternative addresses. It may not be allowed by the server or a temporary failure occurred.": "Algo fallou ao actualizar os enderezos alternativos da sala. É posible que o servidor non o permita ou acontecese un fallo temporal.", + "Published addresses can be used by anyone on any server to join your room. To publish an address, it needs to be set as a local address first.": "Os enderezos publicados poden ser usados por calquera persoa ou servidor para unirse a sala. Para publicar un enderezo, primeiro debe establecerse como enderezo local.", + "Set addresses for this room so users can find this room through your homeserver (%(localDomain)s)": "Establecer enderezos para a sala para que poida ser atopada no teu servidor local (%(localDomain)s)", + "Room Settings - %(roomName)s": "Axustes da sala - %(roomName)s", + "Delete the room address %(alias)s and remove %(name)s from the directory?": "Eliminar o enderezo da sala %(alias)s e eliminar %(name)s do directorio?" } From 3f6774560e1b642cc52d89a7b3086a7482ee8fe3 Mon Sep 17 00:00:00 2001 From: call_xz Date: Wed, 27 May 2020 02:53:31 +0000 Subject: [PATCH 031/123] Translated using Weblate (Japanese) Currently translated at 56.9% (1312 of 2306 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/ja/ --- src/i18n/strings/ja.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/i18n/strings/ja.json b/src/i18n/strings/ja.json index 95cd093111..0961765d47 100644 --- a/src/i18n/strings/ja.json +++ b/src/i18n/strings/ja.json @@ -554,7 +554,7 @@ "Download %(text)s": "%(text)s をダウンロード", "Invalid file%(extra)s": "無効なファイル %(extra)s", "Error decrypting image": "イメージの復号化エラー", - "Error decrypting video": "動画の復号化エラー", + "Error decrypting video": "動画の復号エラー", "%(senderDisplayName)s changed the avatar for %(roomName)s": "%(senderDisplayName)s が %(roomName)s のアバターを変更しました", "%(senderDisplayName)s removed the room avatar.": "%(senderDisplayName)s がルームアバターを削除しました。", "%(senderDisplayName)s changed the room avatar to ": "%(senderDisplayName)s はルームアバターをに変更しました", @@ -1158,7 +1158,7 @@ "Error updating flair": "バッジの更新でエラーが発生しました。", "There was an error updating the flair for this room. The server may not allow it or a temporary error occurred.": "この部屋のバッジの更新でエラーが発生しました。サーバーが許可していないか、一時的なエラーが発生しました。", "Edited at %(date)s. Click to view edits.": "%(date)sに編集。クリックして編集を表示。", - "edited": "編集済", + "edited": "編集済み", "I don't want my encrypted messages": "暗号化されたメッセージは必要ありません", "Manually export keys": "手動でキーをエクスポート", "You'll lose access to your encrypted messages": "暗号化されたメッセージにアクセスできなくなります", @@ -1371,5 +1371,11 @@ "Riot URL": "Riot URL", "Room ID": "部屋 ID", "Maximize apps": "アプリを最大化する", - "More options": "更なるオプション" + "More options": "更なるオプション", + "Manually verify all remote sessions": "すべてのリモートセッションを手動で検証する", + "Individually verify each session used by a user to mark it as trusted, not trusting cross-signed devices.": "クロス署名されたデバイスを信頼せず、信頼済みとしてマークするためにユーザーが使用する各セッションを個別に検証します。", + "This session is backing up your keys. ": "このセッションでは鍵をバックアップしています。 ", + "Show all": "すべて表示", + "Message deleted": "メッセージが削除されました", + "Message deleted by %(name)s": "%(name)s によってメッセージが削除されました" } From a2a950e00e9bc06670ec8e9c580d517c18172705 Mon Sep 17 00:00:00 2001 From: yuuki-san Date: Wed, 27 May 2020 09:17:24 +0000 Subject: [PATCH 032/123] Translated using Weblate (Slovak) Currently translated at 66.7% (1537 of 2306 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/sk/ --- src/i18n/strings/sk.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/sk.json b/src/i18n/strings/sk.json index 6473dad0cf..5350b69fed 100644 --- a/src/i18n/strings/sk.json +++ b/src/i18n/strings/sk.json @@ -1664,5 +1664,15 @@ "If you can't scan the code above, verify by comparing unique emoji.": "Pokiaľ nemôžete kód vyššie skenovať, overte sa porovnaním jedinečnej kombinácie emoji.", "Verify by comparing unique emoji.": "Overenie porovnaním jedinečnej kombinácie emoji", "Verify by emoji": "Overte pomocou emoji", - "Compare emoji": "Porovnajte emoji" + "Compare emoji": "Porovnajte emoji", + "Verify all your sessions to ensure your account & messages are safe": "Overte všetky vaše relácie, aby ste si boli istý, že sú vaše správy a účet bezpečné", + "Review": "Prehliadnuť", + "Later": "Neskôr", + "Upgrade": "Upgradovať", + "Verify": "Overiť", + "Verify yourself & others to keep your chats safe": "Overte seba a ostatných, aby vaše komunikácie boli bezpečné", + "Other users may not trust it": "Ostatný používatelia jej nemusia veriť", + "Verify the new login accessing your account: %(name)s": "Overte nové prihlásenie na váš účet: %(name)s", + "From %(deviceName)s (%(deviceId)s)": "Od %(deviceName)s (%(deviceId)s)", + "This bridge was provisioned by .": "Tento most poskytuje ." } From 254ed4b1b60c1bf8964a67febf2761a22773802b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 11:33:42 +0100 Subject: [PATCH 033/123] Add debug lined to figure out e2e test failure Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/stores/ToastStore.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stores/ToastStore.ts b/src/stores/ToastStore.ts index e963ecd736..a26c5e0794 100644 --- a/src/stores/ToastStore.ts +++ b/src/stores/ToastStore.ts @@ -56,6 +56,7 @@ export default class ToastStore extends EventEmitter { * @param {object} newToast The new toast */ addOrReplaceToast>(newToast: IToast) { + console.log("DEBUG addOrReplaceToast", newToast.key, JSON.stringify(newToast)); const oldIndex = this.toasts.findIndex(t => t.key === newToast.key); if (oldIndex === -1) { let newIndex = this.toasts.length; @@ -68,6 +69,7 @@ export default class ToastStore extends EventEmitter { } dismissToast(key) { + console.log("DEBUG dismissToast", key); const length = this.toasts.length; this.toasts = this.toasts.filter(t => t.key !== key); if (length !== this.toasts.length) { From 3dade4e759bc4d01af126e1f3a5d64c4057b1d20 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 11:48:48 +0100 Subject: [PATCH 034/123] tweak Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/stores/ToastStore.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/stores/ToastStore.ts b/src/stores/ToastStore.ts index a26c5e0794..2f5a1f74b0 100644 --- a/src/stores/ToastStore.ts +++ b/src/stores/ToastStore.ts @@ -70,13 +70,15 @@ export default class ToastStore extends EventEmitter { dismissToast(key) { console.log("DEBUG dismissToast", key); + if (this.toasts[0] && this.toasts[0].key === key) { + this.countSeen++; + } + const length = this.toasts.length; this.toasts = this.toasts.filter(t => t.key !== key); if (length !== this.toasts.length) { if (this.toasts.length === 0) { this.countSeen = 0; - } else { - this.countSeen++; } this.emit('update'); From efa47f1a8e948e2920aa640cccfad94caa9942b5 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 12:02:51 +0100 Subject: [PATCH 035/123] Change out debug Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/MatrixChat.tsx | 1 + src/stores/ToastStore.ts | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index f2d7e81d85..f8c96ee393 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -624,6 +624,7 @@ export default class MatrixChat extends React.PureComponent { break; } case 'view_room_directory': { + console.log("DEBUG view_room_directory"); const RoomDirectory = sdk.getComponent("structures.RoomDirectory"); Modal.createTrackedDialog('Room directory', '', RoomDirectory, {}, 'mx_RoomDirectory_dialogWrapper', false, true); diff --git a/src/stores/ToastStore.ts b/src/stores/ToastStore.ts index 2f5a1f74b0..55c48c3937 100644 --- a/src/stores/ToastStore.ts +++ b/src/stores/ToastStore.ts @@ -56,7 +56,6 @@ export default class ToastStore extends EventEmitter { * @param {object} newToast The new toast */ addOrReplaceToast>(newToast: IToast) { - console.log("DEBUG addOrReplaceToast", newToast.key, JSON.stringify(newToast)); const oldIndex = this.toasts.findIndex(t => t.key === newToast.key); if (oldIndex === -1) { let newIndex = this.toasts.length; @@ -69,7 +68,6 @@ export default class ToastStore extends EventEmitter { } dismissToast(key) { - console.log("DEBUG dismissToast", key); if (this.toasts[0] && this.toasts[0].key === key) { this.countSeen++; } From 48de17457663867359b511344210d5d962200d29 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 12:20:20 +0100 Subject: [PATCH 036/123] remove debug Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/MatrixChat.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index f8c96ee393..f2d7e81d85 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -624,7 +624,6 @@ export default class MatrixChat extends React.PureComponent { break; } case 'view_room_directory': { - console.log("DEBUG view_room_directory"); const RoomDirectory = sdk.getComponent("structures.RoomDirectory"); Modal.createTrackedDialog('Room directory', '', RoomDirectory, {}, 'mx_RoomDirectory_dialogWrapper', false, true); From b7c688d3282d5156c74f9ac50e0780908c895965 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 12:40:38 +0100 Subject: [PATCH 037/123] test e2e tests workaround Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/end-to-end-tests/src/usecases/join.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/end-to-end-tests/src/usecases/join.js b/test/end-to-end-tests/src/usecases/join.js index 655c0be686..10a48bd71c 100644 --- a/test/end-to-end-tests/src/usecases/join.js +++ b/test/end-to-end-tests/src/usecases/join.js @@ -19,6 +19,15 @@ const {openRoomDirectory} = require('./create-room'); module.exports = async function join(session, roomName) { session.log.step(`joins room "${roomName}"`); + while (true) { + try { + const toastDismissButton = await session.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger'); + await toastDismissButton.click(); + } catch (e) { + break; + } + } + await openRoomDirectory(session); const roomInput = await session.query('.mx_DirectorySearchBox input'); await session.replaceInputText(roomInput, roomName); From 7b6d49c416f63576fcdf3be088b80cc2b87bde71 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 12:57:45 +0100 Subject: [PATCH 038/123] e2e test toasts Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/end-to-end-tests/src/scenario.js | 2 + test/end-to-end-tests/src/scenarios/toast.js | 23 ++++++++++ test/end-to-end-tests/src/usecases/join.js | 9 ---- test/end-to-end-tests/src/usecases/toasts.js | 45 ++++++++++++++++++++ 4 files changed, 70 insertions(+), 9 deletions(-) create mode 100644 test/end-to-end-tests/src/scenarios/toast.js create mode 100644 test/end-to-end-tests/src/usecases/toasts.js diff --git a/test/end-to-end-tests/src/scenario.js b/test/end-to-end-tests/src/scenario.js index f575fb392e..2191d630ac 100644 --- a/test/end-to-end-tests/src/scenario.js +++ b/test/end-to-end-tests/src/scenario.js @@ -17,6 +17,7 @@ limitations under the License. const {range} = require('./util'); const signup = require('./usecases/signup'); +const toastScenarios = require('./scenarios/toast'); const roomDirectoryScenarios = require('./scenarios/directory'); const lazyLoadingScenarios = require('./scenarios/lazy-loading'); const e2eEncryptionScenarios = require('./scenarios/e2e-encryption'); @@ -37,6 +38,7 @@ module.exports = async function scenario(createSession, restCreator) { const alice = await createUser("alice"); const bob = await createUser("bob"); + await toastScenarios(alice, bob); await roomDirectoryScenarios(alice, bob); await e2eEncryptionScenarios(alice, bob); console.log("create REST users:"); diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js new file mode 100644 index 0000000000..91c6ed750f --- /dev/null +++ b/test/end-to-end-tests/src/scenarios/toast.js @@ -0,0 +1,23 @@ +/* +Copyright 2020 The Matrix.org Foundation C.I.C. + +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. +*/ + +const {acceptToast} = require("../usecases/toasts"); + +module.exports = async function toastScenarios(alice, bob) { + console.log(" checking and clearing all toasts:"); + await acceptToast(alice, "Help us improve Riot"); + await acceptToast(bob, "Help us improve Riot"); +}; diff --git a/test/end-to-end-tests/src/usecases/join.js b/test/end-to-end-tests/src/usecases/join.js index 10a48bd71c..655c0be686 100644 --- a/test/end-to-end-tests/src/usecases/join.js +++ b/test/end-to-end-tests/src/usecases/join.js @@ -19,15 +19,6 @@ const {openRoomDirectory} = require('./create-room'); module.exports = async function join(session, roomName) { session.log.step(`joins room "${roomName}"`); - while (true) { - try { - const toastDismissButton = await session.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger'); - await toastDismissButton.click(); - } catch (e) { - break; - } - } - await openRoomDirectory(session); const roomInput = await session.query('.mx_DirectorySearchBox input'); await session.replaceInputText(roomInput, roomName); diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js new file mode 100644 index 0000000000..663484ce6e --- /dev/null +++ b/test/end-to-end-tests/src/usecases/toasts.js @@ -0,0 +1,45 @@ +/* +Copyright 2020 The Matrix.org Foundation C.I.C. + +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. +*/ + +const assert = require('assert'); + +async function assertToast(session, expectedTitle) { + const h2Element = await session.query('.mx_Toast_title h2'); + const toastTitle = await session.innerText(h2Element); + assert(toastTitle, expectedTitle); +} + +async function acceptToast(session, expectedTitle) { + const foundToast = await assertToast(session, expectedTitle); + if (!foundToast) { + throw new Error("could not find expected toast"); + } + + const btn = await session.query('.mx_Toast_buttons .mx_AccessibleButton_kind_primary'); + await btn.click(); +} + +async function rejectToast(session, expectedTitle) { + const foundToast = await assertToast(session, expectedTitle); + if (!foundToast) { + throw new Error("could not find expected toast"); + } + + const btn = await session.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger'); + await btn.click(); +} + +module.exports = {assertToast, acceptToast, rejectToast}; From d9552c7f5c4296ee92258614c261cb3d01352d4f Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 13:10:28 +0100 Subject: [PATCH 039/123] e2e test toasts v2 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/end-to-end-tests/src/scenarios/toast.js | 12 ++++++++++-- test/end-to-end-tests/src/usecases/toasts.js | 12 ++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js index 91c6ed750f..9a0594cc31 100644 --- a/test/end-to-end-tests/src/scenarios/toast.js +++ b/test/end-to-end-tests/src/scenarios/toast.js @@ -14,10 +14,18 @@ See the License for the specific language governing permissions and limitations under the License. */ -const {acceptToast} = require("../usecases/toasts"); +const {acceptToast, rejectToast} = require("../usecases/toasts"); module.exports = async function toastScenarios(alice, bob) { console.log(" checking and clearing all toasts:"); + + alice.log.startGroup(`clears toasts`); + await acceptToast(alice, "Notifications"); await acceptToast(alice, "Help us improve Riot"); - await acceptToast(bob, "Help us improve Riot"); + alice.log.endGroup(); + + bob.log.startGroup(`clears toasts`); + await rejectToast(bob, "Notifications"); + await rejectToast(bob, "Help us improve Riot"); + bob.log.endGroup(); }; diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js index 663484ce6e..991d3cc39c 100644 --- a/test/end-to-end-tests/src/usecases/toasts.js +++ b/test/end-to-end-tests/src/usecases/toasts.js @@ -23,21 +23,13 @@ async function assertToast(session, expectedTitle) { } async function acceptToast(session, expectedTitle) { - const foundToast = await assertToast(session, expectedTitle); - if (!foundToast) { - throw new Error("could not find expected toast"); - } - + await assertToast(session, expectedTitle); const btn = await session.query('.mx_Toast_buttons .mx_AccessibleButton_kind_primary'); await btn.click(); } async function rejectToast(session, expectedTitle) { - const foundToast = await assertToast(session, expectedTitle); - if (!foundToast) { - throw new Error("could not find expected toast"); - } - + await assertToast(session, expectedTitle); const btn = await session.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger'); await btn.click(); } From 37c875b8635107eb966a692141deed915d14669e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 13:23:49 +0100 Subject: [PATCH 040/123] improve end to end tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/end-to-end-tests/src/scenarios/toast.js | 10 ++++++++-- test/end-to-end-tests/src/usecases/toasts.js | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js index 9a0594cc31..b5b7fa4494 100644 --- a/test/end-to-end-tests/src/scenarios/toast.js +++ b/test/end-to-end-tests/src/scenarios/toast.js @@ -14,18 +14,24 @@ See the License for the specific language governing permissions and limitations under the License. */ -const {acceptToast, rejectToast} = require("../usecases/toasts"); +const {assertNoToasts, acceptToast, rejectToast} = require("../usecases/toasts"); module.exports = async function toastScenarios(alice, bob) { - console.log(" checking and clearing all toasts:"); + console.log(" checking and clearing toasts:"); alice.log.startGroup(`clears toasts`); + alice.log.step(`accepts desktop notifications toast`); await acceptToast(alice, "Notifications"); + alice.log.step(`accepts analytics toast`); await acceptToast(alice, "Help us improve Riot"); + await assertNoToasts(alice); alice.log.endGroup(); bob.log.startGroup(`clears toasts`); + alice.log.step(`reject desktop notifications toast`); await rejectToast(bob, "Notifications"); + alice.log.step(`reject analytics toast`); await rejectToast(bob, "Help us improve Riot"); + await assertNoToasts(bob); bob.log.endGroup(); }; diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js index 991d3cc39c..636714d66b 100644 --- a/test/end-to-end-tests/src/usecases/toasts.js +++ b/test/end-to-end-tests/src/usecases/toasts.js @@ -16,6 +16,11 @@ limitations under the License. const assert = require('assert'); +async function assertNoToasts(session) { + const toast = await session.query('.mx_Toast_toast'); + assert(!toast, 'toast found when none expected'); +} + async function assertToast(session, expectedTitle) { const h2Element = await session.query('.mx_Toast_title h2'); const toastTitle = await session.innerText(h2Element); @@ -34,4 +39,4 @@ async function rejectToast(session, expectedTitle) { await btn.click(); } -module.exports = {assertToast, acceptToast, rejectToast}; +module.exports = {assertNoToasts, assertToast, acceptToast, rejectToast}; From faaca43a75f5281ceb335ef1e9514836c0d8c396 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 13:35:15 +0100 Subject: [PATCH 041/123] more loggin' Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/end-to-end-tests/src/scenarios/toast.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js index b5b7fa4494..ee3f2954f3 100644 --- a/test/end-to-end-tests/src/scenarios/toast.js +++ b/test/end-to-end-tests/src/scenarios/toast.js @@ -20,18 +20,32 @@ module.exports = async function toastScenarios(alice, bob) { console.log(" checking and clearing toasts:"); alice.log.startGroup(`clears toasts`); + alice.log.step(`accepts desktop notifications toast`); await acceptToast(alice, "Notifications"); + alice.log.done(); + alice.log.step(`accepts analytics toast`); await acceptToast(alice, "Help us improve Riot"); + alice.log.done(); + + alice.log.step(`checks no remaining toasts`); await assertNoToasts(alice); + alice.log.done(); alice.log.endGroup(); bob.log.startGroup(`clears toasts`); - alice.log.step(`reject desktop notifications toast`); + + bob.log.step(`reject desktop notifications toast`); await rejectToast(bob, "Notifications"); - alice.log.step(`reject analytics toast`); + bob.log.done(); + + bob.log.step(`reject analytics toast`); await rejectToast(bob, "Help us improve Riot"); + bob.log.done(); + + bob.log.step(`checks no remaining toasts`); await assertNoToasts(bob); + bob.log.done(); bob.log.endGroup(); }; From 841ce74ac2fde0201b1b698a0b096fd5f5158467 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 13:39:00 +0100 Subject: [PATCH 042/123] Fix assert vs assert.equal Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/end-to-end-tests/src/usecases/dialog.js | 2 +- test/end-to-end-tests/src/usecases/toasts.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/end-to-end-tests/src/usecases/dialog.js b/test/end-to-end-tests/src/usecases/dialog.js index d4ae97dff9..15ac50bb18 100644 --- a/test/end-to-end-tests/src/usecases/dialog.js +++ b/test/end-to-end-tests/src/usecases/dialog.js @@ -20,7 +20,7 @@ const assert = require('assert'); async function assertDialog(session, expectedTitle) { const titleElement = await session.query(".mx_Dialog .mx_Dialog_title"); const dialogHeader = await session.innerText(titleElement); - assert(dialogHeader, expectedTitle); + assert.equal(dialogHeader, expectedTitle); } async function acceptDialog(session, expectedTitle) { diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js index 636714d66b..a82c910eea 100644 --- a/test/end-to-end-tests/src/usecases/toasts.js +++ b/test/end-to-end-tests/src/usecases/toasts.js @@ -24,7 +24,7 @@ async function assertNoToasts(session) { async function assertToast(session, expectedTitle) { const h2Element = await session.query('.mx_Toast_title h2'); const toastTitle = await session.innerText(h2Element); - assert(toastTitle, expectedTitle); + assert.equal(toastTitle, expectedTitle); } async function acceptToast(session, expectedTitle) { From 627b5685887d02ed31f8c1fbecc45f48d8edbbbe Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 13:48:20 +0100 Subject: [PATCH 043/123] check if it is a race Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/end-to-end-tests/src/scenarios/toast.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js index ee3f2954f3..980ee4b33f 100644 --- a/test/end-to-end-tests/src/scenarios/toast.js +++ b/test/end-to-end-tests/src/scenarios/toast.js @@ -29,6 +29,7 @@ module.exports = async function toastScenarios(alice, bob) { await acceptToast(alice, "Help us improve Riot"); alice.log.done(); + await alice.delay(300); alice.log.step(`checks no remaining toasts`); await assertNoToasts(alice); alice.log.done(); @@ -44,6 +45,7 @@ module.exports = async function toastScenarios(alice, bob) { await rejectToast(bob, "Help us improve Riot"); bob.log.done(); + await bob.delay(300); bob.log.step(`checks no remaining toasts`); await assertNoToasts(bob); bob.log.done(); From 61066b0c4c915285f2bb0e5bf8c123cadbcab1f6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 14:27:09 +0100 Subject: [PATCH 044/123] test it again Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/end-to-end-tests/src/scenarios/toast.js | 22 ++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js index 980ee4b33f..34b979f09a 100644 --- a/test/end-to-end-tests/src/scenarios/toast.js +++ b/test/end-to-end-tests/src/scenarios/toast.js @@ -20,7 +20,6 @@ module.exports = async function toastScenarios(alice, bob) { console.log(" checking and clearing toasts:"); alice.log.startGroup(`clears toasts`); - alice.log.step(`accepts desktop notifications toast`); await acceptToast(alice, "Notifications"); alice.log.done(); @@ -29,14 +28,21 @@ module.exports = async function toastScenarios(alice, bob) { await acceptToast(alice, "Help us improve Riot"); alice.log.done(); - await alice.delay(300); + while (true) { + try { + const toastDismissButton = await alice.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger'); + await toastDismissButton.click(); + } catch (e) { + break; + } + } + alice.log.step(`checks no remaining toasts`); await assertNoToasts(alice); alice.log.done(); alice.log.endGroup(); bob.log.startGroup(`clears toasts`); - bob.log.step(`reject desktop notifications toast`); await rejectToast(bob, "Notifications"); bob.log.done(); @@ -45,7 +51,15 @@ module.exports = async function toastScenarios(alice, bob) { await rejectToast(bob, "Help us improve Riot"); bob.log.done(); - await bob.delay(300); + while (true) { + try { + const toastDismissButton = await bob.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger'); + await toastDismissButton.click(); + } catch (e) { + break; + } + } + bob.log.step(`checks no remaining toasts`); await assertNoToasts(bob); bob.log.done(); From 91811581bc9412d48842a7341c8f3c33a5623170 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 14:35:59 +0100 Subject: [PATCH 045/123] fix assertNoToasts Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/end-to-end-tests/src/usecases/toasts.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js index a82c910eea..2e88677e4b 100644 --- a/test/end-to-end-tests/src/usecases/toasts.js +++ b/test/end-to-end-tests/src/usecases/toasts.js @@ -17,8 +17,12 @@ limitations under the License. const assert = require('assert'); async function assertNoToasts(session) { - const toast = await session.query('.mx_Toast_toast'); - assert(!toast, 'toast found when none expected'); + try { + await session.query('.mx_Toast_toast'); + } catch (e) { + return; + } + throw new Error('toast found when none expected'); } async function assertToast(session, expectedTitle) { From f3dfdbe74644f974b855a8d494ecbc4d205fd93b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 14:36:44 +0100 Subject: [PATCH 046/123] debug Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/end-to-end-tests/src/scenarios/toast.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js index 34b979f09a..f528e993c3 100644 --- a/test/end-to-end-tests/src/scenarios/toast.js +++ b/test/end-to-end-tests/src/scenarios/toast.js @@ -30,6 +30,9 @@ module.exports = async function toastScenarios(alice, bob) { while (true) { try { + const h2Element = await alice.query('.mx_Toast_title h2'); + const toastTitle = await alice.innerText(h2Element); + console.log("DEBUG closing", toastTitle); const toastDismissButton = await alice.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger'); await toastDismissButton.click(); } catch (e) { @@ -53,6 +56,9 @@ module.exports = async function toastScenarios(alice, bob) { while (true) { try { + const h2Element = await bob.query('.mx_Toast_title h2'); + const toastTitle = await bob.innerText(h2Element); + console.log("DEBUG closing", toastTitle); const toastDismissButton = await bob.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger'); await toastDismissButton.click(); } catch (e) { From 63ac1cb4ab583de0eb2869be09f6fc76877f0f37 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 14:56:24 +0100 Subject: [PATCH 047/123] debug some more Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/end-to-end-tests/src/scenarios/toast.js | 28 ++++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js index f528e993c3..97b5caa14f 100644 --- a/test/end-to-end-tests/src/scenarios/toast.js +++ b/test/end-to-end-tests/src/scenarios/toast.js @@ -20,13 +20,13 @@ module.exports = async function toastScenarios(alice, bob) { console.log(" checking and clearing toasts:"); alice.log.startGroup(`clears toasts`); - alice.log.step(`accepts desktop notifications toast`); - await acceptToast(alice, "Notifications"); - alice.log.done(); - - alice.log.step(`accepts analytics toast`); - await acceptToast(alice, "Help us improve Riot"); - alice.log.done(); + // alice.log.step(`accepts desktop notifications toast`); + // await acceptToast(alice, "Notifications"); + // alice.log.done(); + // + // alice.log.step(`accepts analytics toast`); + // await acceptToast(alice, "Help us improve Riot"); + // alice.log.done(); while (true) { try { @@ -46,13 +46,13 @@ module.exports = async function toastScenarios(alice, bob) { alice.log.endGroup(); bob.log.startGroup(`clears toasts`); - bob.log.step(`reject desktop notifications toast`); - await rejectToast(bob, "Notifications"); - bob.log.done(); - - bob.log.step(`reject analytics toast`); - await rejectToast(bob, "Help us improve Riot"); - bob.log.done(); + // bob.log.step(`reject desktop notifications toast`); + // await rejectToast(bob, "Notifications"); + // bob.log.done(); + // + // bob.log.step(`reject analytics toast`); + // await rejectToast(bob, "Help us improve Riot"); + // bob.log.done(); while (true) { try { From cb07fa53f4282ebfe8f12d63f93bba8344f62b9e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 15:05:40 +0100 Subject: [PATCH 048/123] test Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/end-to-end-tests/src/scenarios/toast.js | 48 +++++--------------- 1 file changed, 12 insertions(+), 36 deletions(-) diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js index 97b5caa14f..02496f398d 100644 --- a/test/end-to-end-tests/src/scenarios/toast.js +++ b/test/end-to-end-tests/src/scenarios/toast.js @@ -20,25 +20,13 @@ module.exports = async function toastScenarios(alice, bob) { console.log(" checking and clearing toasts:"); alice.log.startGroup(`clears toasts`); - // alice.log.step(`accepts desktop notifications toast`); - // await acceptToast(alice, "Notifications"); - // alice.log.done(); - // - // alice.log.step(`accepts analytics toast`); - // await acceptToast(alice, "Help us improve Riot"); - // alice.log.done(); + alice.log.step(`accepts desktop notifications toast`); + await acceptToast(alice, "Notifications"); + alice.log.done(); - while (true) { - try { - const h2Element = await alice.query('.mx_Toast_title h2'); - const toastTitle = await alice.innerText(h2Element); - console.log("DEBUG closing", toastTitle); - const toastDismissButton = await alice.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger'); - await toastDismissButton.click(); - } catch (e) { - break; - } - } + alice.log.step(`rejects analytics toast`); + await rejectToast(alice, "Help us improve Riot"); + alice.log.done(); alice.log.step(`checks no remaining toasts`); await assertNoToasts(alice); @@ -46,25 +34,13 @@ module.exports = async function toastScenarios(alice, bob) { alice.log.endGroup(); bob.log.startGroup(`clears toasts`); - // bob.log.step(`reject desktop notifications toast`); - // await rejectToast(bob, "Notifications"); - // bob.log.done(); - // - // bob.log.step(`reject analytics toast`); - // await rejectToast(bob, "Help us improve Riot"); - // bob.log.done(); + bob.log.step(`reject desktop notifications toast`); + await rejectToast(bob, "Notifications"); + bob.log.done(); - while (true) { - try { - const h2Element = await bob.query('.mx_Toast_title h2'); - const toastTitle = await bob.innerText(h2Element); - console.log("DEBUG closing", toastTitle); - const toastDismissButton = await bob.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger'); - await toastDismissButton.click(); - } catch (e) { - break; - } - } + bob.log.step(`reject analytics toast`); + await rejectToast(bob, "Help us improve Riot"); + bob.log.done(); bob.log.step(`checks no remaining toasts`); await assertNoToasts(bob); From e35c9d5bbf5eec8e55a6485b275559ef39d7625f Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 15:18:43 +0100 Subject: [PATCH 049/123] more testing Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/toasts/AnalyticsToast.tsx | 2 + test/end-to-end-tests/src/scenarios/toast.js | 48 +++++++++++++++----- test/end-to-end-tests/src/usecases/toasts.js | 5 +- 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/src/toasts/AnalyticsToast.tsx b/src/toasts/AnalyticsToast.tsx index b186a65d9d..7cd59222dd 100644 --- a/src/toasts/AnalyticsToast.tsx +++ b/src/toasts/AnalyticsToast.tsx @@ -24,12 +24,14 @@ import GenericToast from "../components/views/toasts/GenericToast"; import ToastStore from "../stores/ToastStore"; const onAccept = () => { + console.log("DEBUG onAccept AnalyticsToast"); dis.dispatch({ action: 'accept_cookies', }); }; const onReject = () => { + console.log("DEBUG onReject AnalyticsToast"); dis.dispatch({ action: "reject_cookies", }); diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js index 02496f398d..97b5caa14f 100644 --- a/test/end-to-end-tests/src/scenarios/toast.js +++ b/test/end-to-end-tests/src/scenarios/toast.js @@ -20,13 +20,25 @@ module.exports = async function toastScenarios(alice, bob) { console.log(" checking and clearing toasts:"); alice.log.startGroup(`clears toasts`); - alice.log.step(`accepts desktop notifications toast`); - await acceptToast(alice, "Notifications"); - alice.log.done(); + // alice.log.step(`accepts desktop notifications toast`); + // await acceptToast(alice, "Notifications"); + // alice.log.done(); + // + // alice.log.step(`accepts analytics toast`); + // await acceptToast(alice, "Help us improve Riot"); + // alice.log.done(); - alice.log.step(`rejects analytics toast`); - await rejectToast(alice, "Help us improve Riot"); - alice.log.done(); + while (true) { + try { + const h2Element = await alice.query('.mx_Toast_title h2'); + const toastTitle = await alice.innerText(h2Element); + console.log("DEBUG closing", toastTitle); + const toastDismissButton = await alice.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger'); + await toastDismissButton.click(); + } catch (e) { + break; + } + } alice.log.step(`checks no remaining toasts`); await assertNoToasts(alice); @@ -34,13 +46,25 @@ module.exports = async function toastScenarios(alice, bob) { alice.log.endGroup(); bob.log.startGroup(`clears toasts`); - bob.log.step(`reject desktop notifications toast`); - await rejectToast(bob, "Notifications"); - bob.log.done(); + // bob.log.step(`reject desktop notifications toast`); + // await rejectToast(bob, "Notifications"); + // bob.log.done(); + // + // bob.log.step(`reject analytics toast`); + // await rejectToast(bob, "Help us improve Riot"); + // bob.log.done(); - bob.log.step(`reject analytics toast`); - await rejectToast(bob, "Help us improve Riot"); - bob.log.done(); + while (true) { + try { + const h2Element = await bob.query('.mx_Toast_title h2'); + const toastTitle = await bob.innerText(h2Element); + console.log("DEBUG closing", toastTitle); + const toastDismissButton = await bob.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger'); + await toastDismissButton.click(); + } catch (e) { + break; + } + } bob.log.step(`checks no remaining toasts`); await assertNoToasts(bob); diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js index 2e88677e4b..75142ed08f 100644 --- a/test/end-to-end-tests/src/usecases/toasts.js +++ b/test/end-to-end-tests/src/usecases/toasts.js @@ -22,7 +22,10 @@ async function assertNoToasts(session) { } catch (e) { return; } - throw new Error('toast found when none expected'); + + const h2Element = await session.query('.mx_Toast_title h2'); + const toastTitle = await session.innerText(h2Element); + throw new Error(`"${toastTitle}" toast found when none expected`); } async function assertToast(session, expectedTitle) { From 7486338efaa31e9e2657a5458e86388c2a9e5536 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 16:51:04 +0100 Subject: [PATCH 050/123] Fix.the.tests. Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/end-to-end-tests/src/scenarios/toast.js | 48 +++++--------------- test/end-to-end-tests/src/session.js | 4 +- test/end-to-end-tests/src/usecases/toasts.js | 9 ++-- 3 files changed, 18 insertions(+), 43 deletions(-) diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js index 97b5caa14f..1206ef40b0 100644 --- a/test/end-to-end-tests/src/scenarios/toast.js +++ b/test/end-to-end-tests/src/scenarios/toast.js @@ -20,25 +20,13 @@ module.exports = async function toastScenarios(alice, bob) { console.log(" checking and clearing toasts:"); alice.log.startGroup(`clears toasts`); - // alice.log.step(`accepts desktop notifications toast`); - // await acceptToast(alice, "Notifications"); - // alice.log.done(); - // - // alice.log.step(`accepts analytics toast`); - // await acceptToast(alice, "Help us improve Riot"); - // alice.log.done(); + alice.log.step(`reject desktop notifications toast`); + await rejectToast(alice, "Notifications"); + alice.log.done(); - while (true) { - try { - const h2Element = await alice.query('.mx_Toast_title h2'); - const toastTitle = await alice.innerText(h2Element); - console.log("DEBUG closing", toastTitle); - const toastDismissButton = await alice.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger'); - await toastDismissButton.click(); - } catch (e) { - break; - } - } + alice.log.step(`accepts analytics toast`); + await acceptToast(alice, "Help us improve Riot"); + alice.log.done(); alice.log.step(`checks no remaining toasts`); await assertNoToasts(alice); @@ -46,25 +34,13 @@ module.exports = async function toastScenarios(alice, bob) { alice.log.endGroup(); bob.log.startGroup(`clears toasts`); - // bob.log.step(`reject desktop notifications toast`); - // await rejectToast(bob, "Notifications"); - // bob.log.done(); - // - // bob.log.step(`reject analytics toast`); - // await rejectToast(bob, "Help us improve Riot"); - // bob.log.done(); + bob.log.step(`reject desktop notifications toast`); + await rejectToast(bob, "Notifications"); + bob.log.done(); - while (true) { - try { - const h2Element = await bob.query('.mx_Toast_title h2'); - const toastTitle = await bob.innerText(h2Element); - console.log("DEBUG closing", toastTitle); - const toastDismissButton = await bob.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger'); - await toastDismissButton.click(); - } catch (e) { - break; - } - } + bob.log.step(`reject analytics toast`); + await rejectToast(bob, "Help us improve Riot"); + bob.log.done(); bob.log.step(`checks no remaining toasts`); await assertNoToasts(bob); diff --git a/test/end-to-end-tests/src/session.js b/test/end-to-end-tests/src/session.js index 55c2ed440c..907ee2fb8e 100644 --- a/test/end-to-end-tests/src/session.js +++ b/test/end-to-end-tests/src/session.js @@ -122,8 +122,8 @@ module.exports = class RiotSession { await input.type(text); } - query(selector, timeout = DEFAULT_TIMEOUT) { - return this.page.waitForSelector(selector, {visible: true, timeout}); + query(selector, timeout = DEFAULT_TIMEOUT, hidden = false) { + return this.page.waitForSelector(selector, {visible: true, timeout, hidden}); } async queryAll(selector) { diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js index 75142ed08f..204ed2b983 100644 --- a/test/end-to-end-tests/src/usecases/toasts.js +++ b/test/end-to-end-tests/src/usecases/toasts.js @@ -18,14 +18,13 @@ const assert = require('assert'); async function assertNoToasts(session) { try { - await session.query('.mx_Toast_toast'); + await session.query('.mx_Toast_toast', 1000, true); } catch (e) { - return; + const h2Element = await session.query('.mx_Toast_title h2', 1000); + const toastTitle = await session.innerText(h2Element); + throw new Error(`"${toastTitle}" toast found when none expected`); } - const h2Element = await session.query('.mx_Toast_title h2'); - const toastTitle = await session.innerText(h2Element); - throw new Error(`"${toastTitle}" toast found when none expected`); } async function assertToast(session, expectedTitle) { From 71108fcf393e4648d1dfc1fd17e0b50c8423ed12 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 27 May 2020 17:02:32 +0100 Subject: [PATCH 051/123] delint Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/end-to-end-tests/src/usecases/toasts.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js index 204ed2b983..db78352f2b 100644 --- a/test/end-to-end-tests/src/usecases/toasts.js +++ b/test/end-to-end-tests/src/usecases/toasts.js @@ -24,7 +24,6 @@ async function assertNoToasts(session) { const toastTitle = await session.innerText(h2Element); throw new Error(`"${toastTitle}" toast found when none expected`); } - } async function assertToast(session, expectedTitle) { From 8b23eb1db330f58817065dda5f04070e177a0844 Mon Sep 17 00:00:00 2001 From: XoseM Date: Wed, 27 May 2020 14:51:00 +0000 Subject: [PATCH 052/123] Translated using Weblate (Galician) Currently translated at 49.1% (1129 of 2299 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/gl/ --- src/i18n/strings/gl.json | 55 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/gl.json b/src/i18n/strings/gl.json index 3e8f721ac4..d15cb56707 100644 --- a/src/i18n/strings/gl.json +++ b/src/i18n/strings/gl.json @@ -1115,5 +1115,58 @@ "Published addresses can be used by anyone on any server to join your room. To publish an address, it needs to be set as a local address first.": "Os enderezos publicados poden ser usados por calquera persoa ou servidor para unirse a sala. Para publicar un enderezo, primeiro debe establecerse como enderezo local.", "Set addresses for this room so users can find this room through your homeserver (%(localDomain)s)": "Establecer enderezos para a sala para que poida ser atopada no teu servidor local (%(localDomain)s)", "Room Settings - %(roomName)s": "Axustes da sala - %(roomName)s", - "Delete the room address %(alias)s and remove %(name)s from the directory?": "Eliminar o enderezo da sala %(alias)s e eliminar %(name)s do directorio?" + "Delete the room address %(alias)s and remove %(name)s from the directory?": "Eliminar o enderezo da sala %(alias)s e eliminar %(name)s do directorio?", + "%(senderName)s updated the rule banning rooms matching %(glob)s for %(reason)s": "%(senderName)s actualizou a regra de bloqueo de salas con %(glob)s por %(reason)s", + "%(senderName)s updated the rule banning servers matching %(glob)s for %(reason)s": "%(senderName)s actualizou a regra de bloqueo de servidores con %(glob)s por %(reason)s", + "%(senderName)s updated a ban rule matching %(glob)s for %(reason)s": "%(senderName)s actualizou a regra de bloqueo con %(glob)s por %(reason)s", + "%(senderName)s created a rule banning users matching %(glob)s for %(reason)s": "%(senderName)s creou unha regra de bloqueo de usuarias con %(glob)s por %(reason)s", + "You signed in to a new session without verifying it:": "Conectácheste nunha nova sesión sen verificala:", + "Verify your other session using one of the options below.": "Verifica a túa outra sesión usando unha das opcións inferiores.", + "%(name)s (%(userId)s) signed in to a new session without verifying it:": "%(name)s (%(userId)s) conectouse a unha nova sesión sen verificala:", + "Ask this user to verify their session, or manually verify it below.": "Pídelle a usuaria que verifique a súa sesión, ou verificaa manualmente aquí.", + "Not Trusted": "Non confiable", + "Manually Verify by Text": "Verificar manualmente por texto", + "Interactively verify by Emoji": "Verificar interactivamente por Emoji", + "Done": "Feito", + "%(displayName)s is typing …": "%(displayName)s está escribindo…", + "%(names)s and %(count)s others are typing …|other": "%(names)s e outras %(count)s están escribindo…", + "%(names)s and %(count)s others are typing …|one": "%(names)s e outra están escribindo…", + "%(names)s and %(lastPerson)s are typing …": "%(names)s e %(lastPerson)s están escribindo…", + "Cannot reach homeserver": "Non se acadou o servidor", + "Ensure you have a stable internet connection, or get in touch with the server admin": "Asegúrate de que tes boa conexión a internet, ou contacta coa administración do servidor", + "Your Riot is misconfigured": "O teu Riot está mal configurado", + "Ask your Riot admin to check your config for incorrect or duplicate entries.": "Pídelle a administración do teu Riot que comprobe a configuración para entradas duplicadas ou incorrectas.", + "Cannot reach identity server": "Non se acadou o servidor de identidade", + "You can register, but some features will be unavailable until the identity server is back online. If you keep seeing this warning, check your configuration or contact a server admin.": "Podes rexistrarte, pero algunhas características non estarán dispoñibles ata que o servidor de identidade volte a conectarse. Se segues a ver este aviso, comproba os axustes ou contacta coa administración.", + "You can reset your password, but some features will be unavailable until the identity server is back online. If you keep seeing this warning, check your configuration or contact a server admin.": "Podes restablecer o contrasinal, pero algunhas características non estarán dispoñibles ata que o servidor de identidade se conecte. Se segues a ver este aviso comproba os axustes ou contacta coa administración.", + "You can log in, but some features will be unavailable until the identity server is back online. If you keep seeing this warning, check your configuration or contact a server admin.": "Podes conectarte, pero algunhas características non estarán dispoñibles ata que o servidor de identidade volte a conectarse. Se segues a ver este aviso, comproba os axustes ou contacta coa administración.", + "No homeserver URL provided": "Non se estableceu URL do servidor", + "Unexpected error resolving homeserver configuration": "Houbo un fallo ao acceder a configuración do servidor", + "Unexpected error resolving identity server configuration": "Houbo un fallo ao acceder a configuración do servidor de identidade", + "The message you are trying to send is too large.": "A mensaxe a enviar é demasiado grande.", + "Unable to connect to Homeserver. Retrying...": "Non se conectou co Servidor. Reintentando...", + "a few seconds ago": "fai uns segundos", + "about a minute ago": "fai un minuto", + "%(num)s minutes ago": "fai %(num)s minutos", + "about an hour ago": "fai unha hora", + "%(num)s hours ago": "fai %(num)s horas", + "about a day ago": "onte", + "%(num)s days ago": "fai %(num)s días", + "a few seconds from now": "hai só uns segundos", + "about a minute from now": "haberá un minuto", + "%(num)s minutes from now": "fará %(num)s minutos", + "about an hour from now": "fará unha hora", + "%(num)s hours from now": "fará %(num)s horas", + "about a day from now": "foi onte", + "%(num)s days from now": "fará %(num)s días", + "%(name)s (%(userId)s)": "%(name)s (%(userId)s)", + "Unrecognised address": "Enderezo non recoñecible", + "You do not have permission to invite people to this room.": "Non tes permiso para convidar a xente a esta sala.", + "User %(userId)s is already in the room": "A usuaria %(userId)s xa está na sala", + "User %(user_id)s does not exist": "A usuaria %(user_id)s non existe", + "User %(user_id)s may or may not exist": "A usuaria %(user_id)s podería non existir", + "The user must be unbanned before they can be invited.": "A usuria debe ser desbloqueada antes de poder convidala.", + "Messages in this room are end-to-end encrypted.": "As mensaxes desta sala están cifradas de extremo-a-extremo.", + "Messages in this room are not end-to-end encrypted.": "As mensaxes desta sala non están cifradas de extremo-a-extremo.", + "Messages in this room are end-to-end encrypted. Learn more & verify this user in their user profile.": "As mensaxes desta sala están cifradas de extremo-a-extremo. No perfil da usuaria tes máis info e podes verificala." } From 6c323a1991a841fa2a5169e91701e836538979b2 Mon Sep 17 00:00:00 2001 From: random Date: Wed, 27 May 2020 13:26:32 +0000 Subject: [PATCH 053/123] Translated using Weblate (Italian) Currently translated at 100.0% (2299 of 2299 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/it/ --- src/i18n/strings/it.json | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/it.json b/src/i18n/strings/it.json index 7f6d3bf1e2..441e57395c 100644 --- a/src/i18n/strings/it.json +++ b/src/i18n/strings/it.json @@ -2441,5 +2441,27 @@ "Custom font size can only be between %(min)s pt and %(max)s pt": "La dimensione del carattere personalizzata può solo essere tra %(min)s pt e %(max)s pt", "Use between %(min)s pt and %(max)s pt": "Usa tra %(min)s pt e %(max)s pt", "Appearance": "Aspetto", - "Use the improved room list (in development - refresh to apply changes)": "Usa l'elenco stanze migliorato (in sviluppo - ricarica per applicare le modifiche)" + "Use the improved room list (in development - refresh to apply changes)": "Usa l'elenco stanze migliorato (in sviluppo - ricarica per applicare le modifiche)", + "Room name or address": "Nome stanza o indirizzo", + "Joins room with given address": "Accede alla stanza con l'indirizzo dato", + "Unrecognised room address:": "Indirizzo stanza non riconosciuto:", + "Please verify the room ID or address and try again.": "Verifica l'ID o l'indirizzo della stanza e riprova.", + "Room ID or address of ban list": "ID o indirizzo stanza della lista ban", + "To link to this room, please add an address.": "Per collegare a questa stanza, aggiungi un indirizzo.", + "Error creating address": "Errore creazione indirizzo", + "There was an error creating that address. It may not be allowed by the server or a temporary failure occurred.": "Si è verificato un errore creando l'indirizzo. Potrebbe non essere permesso dal server o un problema temporaneo.", + "You don't have permission to delete the address.": "Non hai l'autorizzazione per eliminare l'indirizzo.", + "There was an error removing that address. It may no longer exist or a temporary error occurred.": "Si è verificato un errore rimuovendo l'indirizzo. Potrebbe non esistere più o essere un problema temporaneo.", + "Error removing address": "Errore rimozione indirizzo", + "Categories": "Categorie", + "Room address": "Indirizzo stanza", + "Please provide a room address": "Inserisci un indirizzo della stanza", + "This address is available to use": "Questo indirizzo è disponibile per l'uso", + "This address is already in use": "Questo indirizzo è già in uso", + "Set a room address to easily share your room with other people.": "Imposta un indirizzo della stanza per condividerla facilmente con le altre persone.", + "You've previously used a newer version of Riot with this session. To use this version again with end to end encryption, you will need to sign out and back in again.": "Hai precedentemente usato una versione più recente di Riot con questa sessione. Per usare ancora questa versione con la cifratura end to end, dovrai disconnetterti e riaccedere.", + "Address (optional)": "Indirizzo (facoltativo)", + "Delete the room address %(alias)s and remove %(name)s from the directory?": "Eliminare l'indirizzo della stanza %(alias)s e rimuovere %(name)s dalla cartella?", + "delete the address.": "elimina l'indirizzo.", + "Use a different passphrase?": "Usare una password diversa?" } From 687cc4e77a5f5346d7e04c6345bfd9ea8b21509d Mon Sep 17 00:00:00 2001 From: MamasLT Date: Wed, 27 May 2020 10:08:23 +0000 Subject: [PATCH 054/123] Translated using Weblate (Lithuanian) Currently translated at 64.6% (1486 of 2299 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/lt/ --- src/i18n/strings/lt.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/lt.json b/src/i18n/strings/lt.json index b4afcaea26..1c2d6ba98e 100644 --- a/src/i18n/strings/lt.json +++ b/src/i18n/strings/lt.json @@ -697,7 +697,7 @@ "Algorithm: ": "Algoritmas: ", "Don't ask again": "Daugiau nebeklausti", "Set up": "Nustatyti", - "Publish this room to the public in %(domain)s's room directory?": "Paskelbti šį kambarį į viešąjį %(domain)s kambarių katalogą?", + "Publish this room to the public in %(domain)s's room directory?": "Paskelbti šį kambarį viešai %(domain)s kambarių kataloge?", "Start authentication": "Pradėti tapatybės nustatymą", "Failed to load group members": "Nepavyko įkelti grupės dalyvių", "Manage Integrations": "Valdyti integracijas", From 4726ebaf9df5fe9b80bca78202169601f84eba9c Mon Sep 17 00:00:00 2001 From: yuuki-san Date: Wed, 27 May 2020 09:26:50 +0000 Subject: [PATCH 055/123] Translated using Weblate (Slovak) Currently translated at 68.7% (1580 of 2299 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/sk/ --- src/i18n/strings/sk.json | 67 +++++++++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 7 deletions(-) diff --git a/src/i18n/strings/sk.json b/src/i18n/strings/sk.json index 5350b69fed..25ffab8526 100644 --- a/src/i18n/strings/sk.json +++ b/src/i18n/strings/sk.json @@ -1107,7 +1107,7 @@ "You've successfully verified this user.": "Úspešne ste overili tohoto používateľa.", "Secure messages with this user are end-to-end encrypted and not able to be read by third parties.": "Zabezpečené správi s týmto používateľom sú E2E šifrované, čo znamená, že čítanie tretími stranami nie je možné.", "Got It": "Rozumiem", - "Verify this user by confirming the following emoji appear on their screen.": "Overte tohto používateľa tak, že zistíte, či sa na jeho obrazovke objaví nasledujúci emoji.", + "Verify this user by confirming the following emoji appear on their screen.": "Overte tohto používateľa tak, že zistíte, či sa na jeho obrazovke objavia nasledujúce emoji.", "Verify this user by confirming the following number appears on their screen.": "Overte tohoto používateľa tým, že zistíte, či sa na jeho obrazovke objaví nasledujúce číslo.", "Unable to find a supported verification method.": "Nie je možné nájsť podporovanú metódu overenia.", "Dog": "Hlava psa", @@ -1536,13 +1536,13 @@ "Set up encryption": "Nastaviť šifrovanie", "Review where you’re logged in": "Zobraziť, kde ste prihlásený", "New login. Was this you?": "Nové pihlásenie. Ste to vy?", - "%(name)s is requesting verification": "%(name) žiada o overenie", + "%(name)s is requesting verification": "%(name)s žiada o overenie", "Sign In or Create Account": "Prihlásiť sa alebo vytvoriť nový účet", "Use your account or create a new one to continue.": "Použite váš existujúci účet alebo si vytvorte nový, aby ste mohli pokračovať.", "Create Account": "Vytvoriť účet", "Sign In": "Prihlásiť sa", "Sends a message as html, without interpreting it as markdown": "Pošlite správu ako HTML, bez interpretácie v Markdowne", - "Failed to set topic": "Nastavenie témy zlyhalo", + "Failed to set topic": "Nepodarilo sa nastaviť tému", "Command failed": "Príkaz zlyhal", "Could not find user in room": "Nepodarilo sa nájsť používateľa v miestnosti", "Please supply a widget URL or embed code": "Prosím, zadajte URL widgetu alebo vložte kód", @@ -1554,7 +1554,7 @@ "Incorrect recovery passphrase": "Nesprávne (dlhé) heslo pre obnovu zálohy", "Backup could not be decrypted with this recovery passphrase: please verify that you entered the correct recovery passphrase.": "Záloha nemohla byť rozšifrovaná pomocou tohto (dlhého) helsa na obnovu zálohy: prosím, overte, či ste zadali správne (dlhé) helso na obnovu zálohy.", "WARNING: KEY VERIFICATION FAILED! The signing key for %(userId)s and session %(deviceId)s is \"%(fprint)s\" which does not match the provided key \"%(fingerprint)s\". This could mean your communications are being intercepted!": "VAROVANIE: OVERENIE KĽÚČOV ZLYHALO! Podpisovaný kľúč používateľa %(userId)s a relácia %(deviceId)s je \"%(fprint)s\" čo nezodpovedá zadanému kľúču \"%(fingerprint)s\". Môže to znamenať, že vaša komunikácia je infiltrovaná!", - "The signing key you provided matches the signing key you received from %(userId)s's session %(deviceId)s. Session marked as verified.": "Zadaný podpísaný kľúč sa zhoduje s podpísaným kľúčom od relácie %(deviceId)s používateľa %(userId)s. Relácia je označená ako overená.", + "The signing key you provided matches the signing key you received from %(userId)s's session %(deviceId)s. Session marked as verified.": "Zadaný podpisovací kľúč sa zhoduje s podpisovacím kľúčom od relácie %(deviceId)s používateľa %(userId)s. Relácia je označená ako overená.", "Displays information about a user": "Zobrazuje informácie o používateľovi", "Send a bug report with logs": "Zaslať chybové hlásenie so záznamami", "Opens chat with the given user": "Otvorí konverzáciu s daným používateľom", @@ -1565,7 +1565,7 @@ "%(senderName)s removed the alternative addresses %(addresses)s for this room.|other": "%(senderName)s odstránil/a alternatívne adresy %(addresses)s pre túto miestnosť.", "%(senderName)s removed the alternative addresses %(addresses)s for this room.|one": "%(senderName)s odstránil/a alternatívnu adresu %(addresses)s pre túto miestnosť.", "%(senderName)s changed the alternative addresses for this room.": "%(senderName)s zmenil/a alternatívne adresy pre túto miestnosť.", - "%(senderName)s changed the main and alternative addresses for this room.": "%(senderName)s zmenil hlavnú a alternatívne adresy pre túto miestnosť.", + "%(senderName)s changed the main and alternative addresses for this room.": "%(senderName)s zmenil/a hlavnú a alternatívnu/e adresy pre túto miestnosť.", "%(senderName)s changed the addresses for this room.": "%(senderName)s zmenil/a adresy pre túto miestnosť.", "You signed in to a new session without verifying it:": "Prihlásili ste sa do novej relácie bez jej overenia:", "Verify your other session using one of the options below.": "Overte svoje ostatné relácie pomocou jednej z nižšie uvedených možností.", @@ -1580,7 +1580,7 @@ "about an hour ago": "približne pred hodinou", "about a day ago": "približne deň dozadu", "a few seconds from now": "o pár sekúnd", - "about a minute from now": "približne o minutu", + "about a minute from now": "približne o minútu", "about an hour from now": "približne o hodinu", "about a day from now": "približne o deň", "Support adding custom themes": "Umožniť pridávať vlastný vzhľad", @@ -1674,5 +1674,58 @@ "Other users may not trust it": "Ostatný používatelia jej nemusia veriť", "Verify the new login accessing your account: %(name)s": "Overte nové prihlásenie na váš účet: %(name)s", "From %(deviceName)s (%(deviceId)s)": "Od %(deviceName)s (%(deviceId)s)", - "This bridge was provisioned by .": "Tento most poskytuje ." + "This bridge was provisioned by .": "Tento most poskytuje .", + "Room name or address": "Meno alebo adresa miestnosti", + "Joins room with given address": "Pridať sa do miestnosti s danou adresou", + "Unrecognised room address:": "Nerozpoznaná adresa miestnosti:", + "Use the improved room list (in development - refresh to apply changes)": "Použiť vylepšený zoznam miestností (vo vývoji - znovunačítajte stránku pre aplikovanie zmien)", + "This bridge is managed by .": "Tento most spravuje .", + "Workspace: %(networkName)s": "Pracovisko: %(networkName)s", + "Channel: %(channelName)s": "Kanál: %(channelName)s", + "Show less": "Zobraziť menej", + "Show more": "Zobraziť viac", + "Changing password will currently reset any end-to-end encryption keys on all sessions, making encrypted chat history unreadable, unless you first export your room keys and re-import them afterwards. In future this will be improved.": "Zmena hesla reštartuje všetky šifrovacie kľúče pre všetky vaše relácie. Šifrované správy sa stanú nečitateľnými, pokiaľ najprv nevyexportujete vaše kľúče a po zmene ich nenaimportujete. V budúcnosti sa tento proces zjednoduší.", + "well formed": "dobre sformulované", + "unexpected type": "neočakávaný typ", + "in memory": "v pamäti", + "Self signing private key:": "Samo-podpísané súkromné kľúče:", + "cached locally": "cachenuté lokálne", + "not found locally": "nenájdené lokálne", + "User signing private key:": "Používateľom-podpísané súkromné kľúče:", + "Session backup key:": "Kľúč na zálohu relácie:", + "Homeserver feature support:": "Funkcie podporované domovským serverom:", + "exists": "existuje", + "Your homeserver does not support session management.": "Váš domovský server nepodporuje správu relácií.", + "Unable to load session list": "Nemožno načítať zoznam relácií", + "Confirm deleting these sessions by using Single Sign On to prove your identity.|other": "Potvrďte odstránenie týchto relácií použitím Jednotného prihlásenia na overenie vašej identity.", + "Confirm deleting these sessions by using Single Sign On to prove your identity.|one": "Potvrďte odstránenie tejto relácie použitím Jednotného prihlásenia na overenie vašej identity.", + "Confirm deleting these sessions": "Potvrdiť odstránenie týchto relácií", + "Click the button below to confirm deleting these sessions.|other": "Stlačením tlačítka potvrdíte zmazanie týchto relácií.", + "Click the button below to confirm deleting these sessions.|one": "Stlačením tlačítka potvrdíte zmazanie tejto relácie.", + "Delete sessions|other": "Zmazať relácie", + "Delete sessions|one": "Zmazať reláciu", + "Delete %(count)s sessions|one": "Zmazať %(count)s reláciu", + "Manage": "Spravovať", + "Securely cache encrypted messages locally for them to appear in search results.": "Bezpečne cachovať šifrované správy lokálne, aby sa mohli zobraziť vo vyhľadávaní.", + "Enable": "Povoliť", + "Riot is missing some components required for securely caching encrypted messages locally. If you'd like to experiment with this feature, build a custom Riot Desktop with search components added.": "Riotu chýbajú niektoré komponenty potrebné na bezpečné cachovanie šifrovaných správ lokálne. Pokiaľ chcete experimentovať s touto funkciou, spravte si svoj vlastný Riot Desktop s pridanými vyhľadávacími komponentami.", + "Riot can't securely cache encrypted messages locally while running in a web browser. Use Riot Desktop for encrypted messages to appear in search results.": "Riotu nemôže bezpečne cachovať šifrované správy lokálne keď beží v prehliadači. Použite Riot Desktop, aby sa šifrované správy zobrazili vo vyhľadávaní.", + "This session is backing up your keys. ": "Táto relácia zálohuje vaše kľúče. ", + "This session is not backing up your keys, but you do have an existing backup you can restore from and add to going forward.": "Táto relácia nezálohuje vaše kľúče, ale už máte jednu existujúcu zálohu z ktorej sa môžete obnoviť a postupne pridávať.", + "Connect this session to key backup before signing out to avoid losing any keys that may only be on this session.": "Pred odhlásením pripojte túto reláciu k zálohe kľúčov, aby ste predišli strate kľúčov, ktoré môžu byť len v tejto relácií.", + "Connect this session to Key Backup": "Pripojiť túto reláciu k Zálohe kľúčov", + "Backup has a signature from unknown session with ID %(deviceId)s": "Záloha je podpísaná z neznámej relácie s ID %(deviceId)s", + "Backup has a valid signature from this session": "Záloha má platný podpis z tejto relácie", + "Backup has an invalid signature from this session": "Záloha má neplatný podpis z tejto relácie", + "Backup has a valid signature from verified session ": "Záloha má platný podpis z overenej relácie ", + "Backup has a valid signature from unverified session ": "Záloha má platný podpis z neoverenej relácie ", + "Backup has an invalid signature from verified session ": "Záloha má neplatný podpis z overenej relácie ", + "Backup has an invalid signature from unverified session ": "Záloha má neplatný podpis z neoverenej relácie ", + "Backup is not signed by any of your sessions": "Záloha nemá podpis zo žiadnej vašej relácie", + "This backup is trusted because it has been restored on this session": "Táto záloha je dôveryhodná, lebo už bola načítaná v tejto relácií", + "Your keys are not being backed up from this session.": "Vaše kľúče nie sú zálohované z tejto relácie.", + "Enable desktop notifications for this session": "Povoliť desktopové notifikácie pre túto reláciu", + "Enable audible notifications for this session": "Povoliť zvukové notifikácie pre túto reláciu", + "Size must be a number": "Veľkosť musí byť číslo", + "Custom font size can only be between %(min)s pt and %(max)s pt": "Vlastná veľkosť písma môže byť len v rozmedzí %(min)s pt až %(max)s pt" } From 9e2d80b8c8382951424181bade0fb23446a80e77 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 27 May 2020 13:16:49 -0600 Subject: [PATCH 056/123] Update documentation and auth dict submissions --- src/components/structures/auth/Registration.js | 3 +-- src/components/views/auth/InteractiveAuthEntryComponents.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js index e8938da5c1..6349614d72 100644 --- a/src/components/structures/auth/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -248,8 +248,7 @@ export default createReactClass({ // need to. if (!this.state.doingUIAuth) { await this._makeRegisterRequest(null); - // This should never succeed since we specified an empty - // auth object. + // This should never succeed since we specified no auth object. console.log("Expecting 401 from register request but got success!"); } } catch (e) { diff --git a/src/components/views/auth/InteractiveAuthEntryComponents.js b/src/components/views/auth/InteractiveAuthEntryComponents.js index e404f15d28..655452fcee 100644 --- a/src/components/views/auth/InteractiveAuthEntryComponents.js +++ b/src/components/views/auth/InteractiveAuthEntryComponents.js @@ -740,7 +740,7 @@ export const FallbackAuthEntry = createReactClass({ event.data === "authDone" && event.origin === this.props.matrixClient.getHomeserverUrl() ) { - this.props.submitAuthDict(null); + this.props.submitAuthDict({}); } }, From 73c35ff80e0a1d9a6323cbdd49df5a7fe4f83cbc Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Thu, 28 May 2020 00:05:45 -0400 Subject: [PATCH 057/123] set the client's pickle key if the platform can store one --- src/BasePlatform.js | 31 +++++++++++++++++++++++++++++++ src/Lifecycle.js | 15 ++++++++++++--- src/MatrixClientPeg.js | 1 + 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/src/BasePlatform.js b/src/BasePlatform.js index 8a950dc2e3..f4fa43cb10 100644 --- a/src/BasePlatform.js +++ b/src/BasePlatform.js @@ -190,4 +190,35 @@ export default class BasePlatform { onKeyDown(ev: KeyboardEvent): boolean { return false; // no shortcuts implemented } + + /** + * Get a previously stored pickle key. The pickle key is used for + * encrypting libolm objects. + * @param {string} userId the user ID for the user that the pickle key is for. + * @param {string} userId the device ID that the pickle key is for. + * @returns {string|null} the previously stored pickle key, or null if no + * pickle key has been stored. + */ + async getPickleKey(userId: string, deviceId: string): string | null { + return null; + } + + /** + * Create and store a pickle key for encrypting libolm objects. + * @param {string} userId the user ID for the user that the pickle key is for. + * @param {string} userId the device ID that the pickle key is for. + * @returns {string|null} the pickle key, or null if the platform does not + * support storing pickle keys. + */ + async createPickleKey(userId: string, deviceId: string): string | null { + return null; + } + + /** + * Delete a previously stored pickle key from storage. + * @param {string} userId the user ID for the user that the pickle key is for. + * @param {string} userId the device ID that the pickle key is for. + */ + async destroyPickleKey(userId: string, deviceId: string) { + } } diff --git a/src/Lifecycle.js b/src/Lifecycle.js index 1baa6c8e0c..598624293b 100644 --- a/src/Lifecycle.js +++ b/src/Lifecycle.js @@ -298,6 +298,8 @@ async function _restoreFromLocalStorage(opts) { return false; } + const pickleKey = await PlatformPeg.get().getPickleKey(userId, deviceId); + console.log(`Restoring session for ${userId}`); await _doSetLoggedIn({ userId: userId, @@ -306,6 +308,7 @@ async function _restoreFromLocalStorage(opts) { homeserverUrl: hsUrl, identityServerUrl: isUrl, guest: isGuest, + pickleKey: pickleKey, }, false); return true; } else { @@ -348,9 +351,13 @@ async function _handleLoadSessionFailure(e) { * * @returns {Promise} promise which resolves to the new MatrixClient once it has been started */ -export function setLoggedIn(credentials) { +export async function setLoggedIn(credentials) { stopMatrixClient(); - return _doSetLoggedIn(credentials, true); + const pickleKey = credentials.userId && credentials.deviceId + ? await PlatformPeg.get().createPickleKey(credentials.userId, credentials.deviceId) + : null; + + return _doSetLoggedIn(Object.assign({}, credentials, {pickleKey}), true); } /** @@ -516,7 +523,9 @@ export function logout() { } _isLoggingOut = true; - MatrixClientPeg.get().logout().then(onLoggedOut, + const client = MatrixClientPeg.get(); + PlatformPeg.get().destroyPickleKey(client.getUserId(), client.getDeviceId()); + client.logout().then(onLoggedOut, (err) => { // Just throwing an error here is going to be very unhelpful // if you're trying to log out because your server's down and diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index 21f05b9759..af43705227 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -218,6 +218,7 @@ class _MatrixClientPeg { accessToken: creds.accessToken, userId: creds.userId, deviceId: creds.deviceId, + pickleKey: creds.pickleKey, timelineSupport: true, forceTURN: !SettingsStore.getValue('webRtcAllowPeerToPeer', false), fallbackICEServerAllowed: !!SettingsStore.getValue('fallbackICEServerAllowed'), From 81922231ed638764083610889b7ffafc3a7467ad Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Thu, 28 May 2020 13:55:07 +0100 Subject: [PATCH 058/123] Move Appearance tab to ts --- src/components/structures/MatrixChat.tsx | 4 +- src/components/views/elements/Field.tsx | 2 +- ...gsTab.js => AppearanceUserSettingsTab.tsx} | 133 ++++++++++------- src/dispatcher/actions.ts | 5 + .../payloads/RecheckThemePayload.ts | 27 ++++ .../watchers/FontWatcher.ts} | 36 +++-- src/settings/watchers/ThemeWatcher.ts | 138 ++++++++++++++++++ src/settings/watchers/Watcher.ts | 20 +++ src/theme.js | 110 +------------- 9 files changed, 295 insertions(+), 180 deletions(-) rename src/components/views/settings/tabs/user/{AppearanceUserSettingsTab.js => AppearanceUserSettingsTab.tsx} (73%) create mode 100644 src/dispatcher/payloads/RecheckThemePayload.ts rename src/{FontWatcher.js => settings/watchers/FontWatcher.ts} (51%) create mode 100644 src/settings/watchers/ThemeWatcher.ts create mode 100644 src/settings/watchers/Watcher.ts diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 1200fcaf7a..f6848feb03 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -58,8 +58,8 @@ import ResizeNotifier from "../../utils/ResizeNotifier"; import AutoDiscoveryUtils, { ValidatedServerConfig } from "../../utils/AutoDiscoveryUtils"; import DMRoomMap from '../../utils/DMRoomMap'; import { countRoomsWithNotif } from '../../RoomNotifs'; -import { ThemeWatcher } from "../../theme"; -import { FontWatcher } from '../../FontWatcher'; +import ThemeWatcher from "../../settings/watchers/ThemeWatcher"; +import { FontWatcher } from '../../settings/watchers/FontWatcher'; import { storeRoomAliasInCache } from '../../RoomAliasCache'; import { defer, IDeferred } from "../../utils/promise"; import ToastStore from "../../stores/ToastStore"; diff --git a/src/components/views/elements/Field.tsx b/src/components/views/elements/Field.tsx index 39ed2df9f9..771d2182ea 100644 --- a/src/components/views/elements/Field.tsx +++ b/src/components/views/elements/Field.tsx @@ -34,7 +34,7 @@ interface IProps extends React.InputHTMLAttributes