From ce78cdf4add2091862cbc466e5058846f010a79b Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Mon, 19 Jul 2021 22:43:11 +0100
Subject: [PATCH] Conform to new react and typescript eslint rules
---
package.json | 1 +
src/@types/global.d.ts | 4 +
src/Analytics.tsx | 16 +--
src/CallHandler.tsx | 22 ++--
src/ContentMessages.tsx | 4 +-
src/DeviceListener.ts | 87 ++++++-------
src/IdentityAuthClient.js | 10 +-
src/MatrixClientPeg.ts | 4 +-
src/Modal.tsx | 6 +-
src/SlashCommands.tsx | 8 +-
src/accessibility/KeyboardShortcuts.tsx | 4 +-
src/accessibility/Toolbar.tsx | 4 +-
.../eventindex/DisableEventIndexDialog.js | 4 +-
.../eventindex/ManageEventIndexDialog.tsx | 16 +--
.../dialogs/security/CreateKeyBackupDialog.js | 68 +++++-----
.../security/CreateSecretStorageDialog.js | 78 ++++++------
.../security/NewRecoveryMethodDialog.js | 24 ++--
.../security/RecoveryMethodRemovedDialog.js | 14 +-
src/autocomplete/UserProvider.tsx | 4 +-
.../structures/CustomRoomTagPanel.js | 4 +-
src/components/structures/EmbeddedPage.js | 6 +-
src/components/structures/FilePanel.tsx | 6 +-
src/components/structures/GenericErrorPage.js | 4 +-
src/components/structures/GroupView.js | 8 +-
src/components/structures/LeftPanel.tsx | 14 +-
src/components/structures/LeftPanelWidget.tsx | 6 +-
src/components/structures/LoggedInView.tsx | 86 ++++++-------
src/components/structures/MatrixChat.tsx | 16 +--
src/components/structures/MyGroups.js | 4 +-
.../structures/NonUrgentToastContainer.tsx | 4 +-
.../structures/NotificationPanel.tsx | 4 +-
src/components/structures/RightPanel.tsx | 5 +-
src/components/structures/RoomDirectory.tsx | 20 +--
src/components/structures/RoomSearch.tsx | 6 +-
src/components/structures/RoomStatusBar.js | 14 +-
src/components/structures/RoomView.tsx | 26 ++--
src/components/structures/SearchBox.js | 12 +-
.../structures/SpaceRoomDirectory.tsx | 6 +-
src/components/structures/SpaceRoomView.tsx | 18 +--
src/components/structures/TabbedView.tsx | 24 ++--
src/components/structures/TimelinePanel.tsx | 6 +-
src/components/structures/ToastContainer.tsx | 14 +-
src/components/structures/UploadBar.tsx | 2 +-
src/components/structures/UserMenu.tsx | 68 +++++-----
src/components/structures/ViewSource.js | 32 ++---
.../structures/auth/CompleteSecurity.tsx | 4 +-
.../structures/auth/ForgotPassword.tsx | 26 ++--
src/components/structures/auth/Login.tsx | 24 ++--
.../structures/auth/Registration.tsx | 36 +++---
.../structures/auth/SetupEncryptionBody.tsx | 32 ++---
src/components/structures/auth/SoftLogout.tsx | 30 ++---
.../views/audio_messages/AudioPlayer.tsx | 4 +-
src/components/views/audio_messages/Clock.tsx | 2 +-
.../views/audio_messages/Waveform.tsx | 4 +-
src/components/views/auth/AuthPage.js | 2 +-
src/components/views/auth/CaptchaForm.js | 4 +-
.../auth/InteractiveAuthEntryComponents.tsx | 20 +--
src/components/views/auth/PasswordLogin.tsx | 14 +-
.../views/auth/RegistrationForm.tsx | 10 +-
.../views/avatars/DecoratedRoomAvatar.tsx | 4 +-
.../avatars/MemberStatusMessageAvatar.js | 2 +-
.../views/context_menus/CallContextMenu.tsx | 6 +-
.../context_menus/IconizedContextMenu.tsx | 12 +-
.../context_menus/MessageContextMenu.tsx | 8 +-
.../context_menus/StatusMessageContextMenu.js | 10 +-
.../dialogs/AddExistingToSpaceDialog.tsx | 2 +-
.../views/dialogs/AddressPickerDialog.js | 18 +--
.../views/dialogs/AskInviteAnywayDialog.tsx | 4 +-
src/components/views/dialogs/BaseDialog.js | 2 +-
.../views/dialogs/BetaFeedbackDialog.tsx | 2 +-
.../views/dialogs/BugReportDialog.tsx | 10 +-
.../views/dialogs/ChangelogDialog.tsx | 8 +-
.../CommunityPrototypeInviteDialog.tsx | 20 +--
.../views/dialogs/ConfirmWipeDeviceDialog.tsx | 4 +-
.../CreateCommunityPrototypeDialog.tsx | 24 ++--
.../views/dialogs/CreateGroupDialog.tsx | 4 +-
.../views/dialogs/CreateRoomDialog.tsx | 12 +-
.../views/dialogs/DeactivateAccountDialog.tsx | 12 +-
.../views/dialogs/DevtoolsDialog.tsx | 120 +++++++++---------
.../dialogs/EditCommunityPrototypeDialog.tsx | 8 +-
.../views/dialogs/FeedbackDialog.js | 14 +-
.../views/dialogs/HostSignupDialog.tsx | 28 ++--
.../views/dialogs/IncomingSasDialog.js | 28 ++--
.../dialogs/IntegrationsDisabledDialog.js | 2 +-
.../dialogs/IntegrationsImpossibleDialog.js | 4 +-
.../views/dialogs/InteractiveAuthDialog.js | 2 +-
src/components/views/dialogs/InviteDialog.tsx | 112 ++++++++--------
.../dialogs/KeySignatureUploadFailedDialog.js | 18 +--
.../dialogs/LazyLoadingDisabledDialog.js | 2 +-
.../views/dialogs/LazyLoadingResyncDialog.js | 2 +-
src/components/views/dialogs/LogoutDialog.js | 14 +-
.../views/dialogs/MessageEditHistoryDialog.js | 14 +-
.../views/dialogs/ModalWidgetDialog.tsx | 4 +-
.../dialogs/RegistrationEmailPromptDialog.tsx | 6 +-
.../views/dialogs/ReportEventDialog.tsx | 114 ++++++++---------
.../views/dialogs/RoomUpgradeDialog.js | 14 +-
.../views/dialogs/RoomUpgradeWarningDialog.js | 26 ++--
.../views/dialogs/ServerOfflineDialog.tsx | 40 +++---
.../views/dialogs/ServerPickerDialog.tsx | 14 +-
.../views/dialogs/SeshatResetDialog.tsx | 6 +-
.../views/dialogs/SlashCommandHelpDialog.js | 10 +-
.../views/dialogs/StorageEvictedDialog.js | 10 +-
.../dialogs/TabbedIntegrationManagerDialog.js | 6 +-
src/components/views/dialogs/TermsDialog.tsx | 28 ++--
.../views/dialogs/UntrustedDeviceDialog.tsx | 8 +-
.../views/dialogs/UploadConfirmDialog.tsx | 10 +-
.../views/dialogs/UploadFailureDialog.js | 12 +-
.../views/dialogs/UserSettingsDialog.tsx | 4 +-
.../WidgetCapabilitiesPromptDialog.tsx | 10 +-
.../dialogs/WidgetOpenIDPermissionsDialog.js | 6 +-
.../security/AccessSecretStorageDialog.tsx | 36 +++---
.../ConfirmDestroyCrossSigningDialog.tsx | 4 +-
.../security/CreateCrossSigningDialog.tsx | 4 +-
.../security/RestoreKeyBackupDialog.js | 60 ++++-----
.../views/directory/NetworkDropdown.tsx | 14 +-
.../views/elements/AppPermission.js | 30 ++---
src/components/views/elements/AppTile.js | 6 +-
src/components/views/elements/DNDTagTile.js | 2 +-
.../views/elements/DesktopBuildsNotice.tsx | 14 +-
.../elements/DesktopCapturerSourcePicker.tsx | 6 +-
.../views/elements/DialogButtons.js | 2 +-
.../views/elements/DirectorySearchBox.js | 2 +-
.../views/elements/EditableItemList.tsx | 12 +-
.../views/elements/ErrorBoundary.tsx | 14 +-
src/components/views/elements/FacePile.tsx | 2 +-
src/components/views/elements/Field.tsx | 14 +-
src/components/views/elements/ImageView.tsx | 6 +-
src/components/views/elements/InfoTooltip.tsx | 4 +-
.../views/elements/InlineSpinner.tsx | 2 +-
.../views/elements/InviteReason.tsx | 4 +-
.../views/elements/LabelledToggleSwitch.tsx | 4 +-
.../views/elements/PersistedElement.js | 4 +-
.../views/elements/PowerSelector.js | 2 +-
.../views/elements/RoomAliasField.tsx | 2 +-
.../views/elements/ServerPicker.tsx | 10 +-
.../views/elements/SettingsFlag.tsx | 4 +-
src/components/views/elements/Slider.tsx | 4 +-
.../elements/SpellCheckLanguagesDropdown.tsx | 10 +-
src/components/views/elements/Spoiler.js | 2 +-
.../views/elements/StyledCheckbox.tsx | 2 +-
.../views/elements/StyledRadioButton.tsx | 10 +-
.../views/elements/StyledRadioGroup.tsx | 4 +-
src/components/views/elements/TagTile.js | 8 +-
.../views/elements/TextWithTooltip.js | 6 +-
src/components/views/elements/Validation.tsx | 12 +-
src/components/views/emojipicker/Category.tsx | 2 +-
src/components/views/emojipicker/Emoji.tsx | 2 +-
.../views/emojipicker/EmojiPicker.tsx | 6 +-
src/components/views/emojipicker/Header.tsx | 4 +-
src/components/views/emojipicker/Preview.tsx | 6 +-
.../views/emojipicker/QuickReactions.tsx | 10 +-
src/components/views/emojipicker/Search.tsx | 2 +-
.../views/groups/GroupInviteTile.js | 2 +-
.../views/groups/GroupMemberList.js | 2 +-
.../views/host_signup/HostSignupContainer.tsx | 2 +-
.../views/messages/EditHistoryMessage.js | 14 +-
src/components/views/messages/MFileBody.js | 10 +-
src/components/views/messages/MImageBody.tsx | 11 +-
.../messages/MKeyVerificationRequest.tsx | 8 +-
.../views/messages/MessageActionBar.js | 2 +-
.../views/messages/MessageTimestamp.tsx | 2 +-
src/components/views/messages/MjolnirBody.js | 6 +-
.../views/messages/ReactionsRow.tsx | 2 +-
.../views/messages/ReactionsRowButton.tsx | 6 +-
.../messages/ReactionsRowButtonTooltip.tsx | 8 +-
src/components/views/messages/RoomCreate.js | 2 +-
src/components/views/messages/TextualBody.tsx | 10 +-
.../views/messages/TileErrorBoundary.tsx | 4 +-
.../views/messages/ViewSourceEvent.js | 6 +-
src/components/views/right_panel/BaseCard.tsx | 4 +-
.../views/right_panel/EncryptionInfo.tsx | 22 ++--
.../views/right_panel/EncryptionPanel.tsx | 10 +-
.../views/right_panel/HeaderButtons.tsx | 2 +-
.../views/right_panel/RoomSummaryCard.tsx | 12 +-
src/components/views/right_panel/UserInfo.tsx | 30 ++---
.../views/right_panel/VerificationPanel.tsx | 60 ++++-----
.../views/room_settings/AliasSettings.tsx | 12 +-
.../room_settings/RelatedGroupSettings.js | 2 +-
.../room_settings/RoomProfileSettings.js | 4 +-
src/components/views/rooms/AuxPanel.tsx | 4 +-
src/components/views/rooms/EntityTile.tsx | 10 +-
src/components/views/rooms/EventTile.tsx | 10 +-
src/components/views/rooms/ExtraTile.tsx | 8 +-
.../views/rooms/JumpToBottomButton.js | 2 +-
src/components/views/rooms/MemberList.tsx | 6 +-
.../views/rooms/MessageComposer.tsx | 6 +-
src/components/views/rooms/NewRoomIntro.tsx | 20 +--
.../views/rooms/NotificationBadge.tsx | 4 +-
.../views/rooms/RoomBreadcrumbs.tsx | 4 +-
src/components/views/rooms/RoomHeader.tsx | 8 +-
src/components/views/rooms/RoomList.tsx | 22 ++--
src/components/views/rooms/RoomPreviewBar.js | 10 +-
src/components/views/rooms/RoomSublist.tsx | 56 ++++----
src/components/views/rooms/RoomTile.tsx | 26 ++--
.../views/rooms/RoomUpgradeWarningBar.js | 28 ++--
src/components/views/rooms/SearchBar.tsx | 6 +-
.../views/rooms/SendMessageComposer.tsx | 2 +-
.../views/rooms/ThirdPartyMemberInfo.tsx | 10 +-
.../views/rooms/VoiceRecordComposerTile.tsx | 14 +-
.../views/rooms/WhoIsTypingTile.tsx | 8 +-
.../views/settings/AvatarSetting.js | 10 +-
src/components/views/settings/BridgeTile.tsx | 34 ++---
.../views/settings/ChangePassword.js | 2 +-
.../views/settings/CrossSigningPanel.js | 56 ++++----
src/components/views/settings/DevicesPanel.js | 2 +-
.../views/settings/E2eAdvancedPanel.tsx | 6 +-
.../views/settings/EventIndexPanel.tsx | 38 +++---
.../views/settings/IntegrationManager.js | 6 +-
.../views/settings/ProfileSettings.js | 16 +--
.../views/settings/SecureBackupPanel.js | 88 ++++++-------
src/components/views/settings/SetIdServer.tsx | 56 ++++----
.../views/settings/SetIntegrationManager.tsx | 12 +-
.../views/settings/SpellCheckSettings.tsx | 28 ++--
.../views/settings/UpdateCheckButton.tsx | 8 +-
.../views/settings/account/EmailAddresses.js | 20 +--
.../views/settings/account/PhoneNumbers.js | 24 ++--
.../settings/discovery/EmailAddresses.js | 16 +--
.../views/settings/discovery/PhoneNumbers.js | 16 +--
.../tabs/room/AdvancedRoomSettingsTab.tsx | 4 +-
.../settings/tabs/room/BridgeSettingsTab.tsx | 16 +--
.../tabs/room/GeneralRoomSettingsTab.js | 12 +-
.../tabs/room/NotificationSettingsTab.js | 18 +--
.../tabs/room/RolesRoomSettingsTab.tsx | 32 ++---
.../tabs/room/SecurityRoomSettingsTab.tsx | 36 +++---
.../tabs/user/AppearanceUserSettingsTab.tsx | 36 +++---
.../tabs/user/FlairUserSettingsTab.js | 2 +-
.../tabs/user/GeneralUserSettingsTab.js | 60 ++++-----
.../tabs/user/HelpUserSettingsTab.tsx | 66 +++++-----
.../settings/tabs/user/LabsUserSettingsTab.js | 6 +-
.../tabs/user/MjolnirUserSettingsTab.tsx | 74 +++++------
.../tabs/user/NotificationUserSettingsTab.tsx | 2 +-
.../tabs/user/PreferencesUserSettingsTab.tsx | 42 +++---
.../tabs/user/SecurityUserSettingsTab.js | 80 ++++++------
.../tabs/user/VoiceUserSettingsTab.tsx | 8 +-
src/components/views/spaces/SpacePanel.tsx | 12 +-
.../views/spaces/SpaceSettingsGeneralTab.tsx | 2 +-
.../spaces/SpaceSettingsVisibilityTab.tsx | 2 +-
.../views/spaces/SpaceTreeLevel.tsx | 4 +-
.../views/terms/InlineTermsAgreement.tsx | 12 +-
src/components/views/toasts/GenericToast.tsx | 8 +-
.../toasts/NonUrgentEchoFailureToast.tsx | 6 +-
.../views/toasts/VerificationRequestToast.tsx | 8 +-
.../verification/VerificationCancelled.tsx | 4 +-
.../verification/VerificationComplete.tsx | 8 +-
.../verification/VerificationShowSas.tsx | 24 ++--
src/components/views/voip/CallView.tsx | 64 +++++-----
src/components/views/voip/DialPad.tsx | 6 +-
src/components/views/voip/DialPadModal.tsx | 2 +-
src/components/views/voip/IncomingCallBox.tsx | 8 +-
src/createRoom.ts | 7 +-
src/editor/parts.ts | 6 +-
src/languageHandler.tsx | 6 +-
src/mjolnir/Mjolnir.ts | 55 ++++----
src/rageshake/submit-rageshake.ts | 6 +-
src/stores/GroupFilterOrderStore.js | 2 +-
src/stores/LifecycleStore.ts | 2 +-
src/stores/RightPanelStore.ts | 2 +-
src/stores/RoomViewStore.tsx | 6 +-
src/stores/room-list/MessagePreviewStore.ts | 2 +-
src/toasts/ServerLimitToast.tsx | 2 +-
src/toasts/UpdateToast.tsx | 2 +-
src/utils/AutoDiscoveryUtils.tsx | 6 +-
src/utils/ErrorUtils.tsx | 8 +-
src/widgets/CapabilityText.tsx | 20 +--
test/accessibility/RovingTabIndex-test.js | 12 +-
test/createRoom-test.js | 8 +-
266 files changed, 1992 insertions(+), 2000 deletions(-)
diff --git a/package.json b/package.json
index 6e10bafaea..4e2e933a52 100644
--- a/package.json
+++ b/package.json
@@ -46,6 +46,7 @@
"start:build": "babel src -w -s -d lib --verbose --extensions \".ts,.js\"",
"lint": "yarn lint:types && yarn lint:js && yarn lint:style",
"lint:js": "eslint --max-warnings 0 src test",
+ "lint:js-fix": "eslint --fix src test",
"lint:types": "tsc --noEmit --jsx react",
"lint:style": "stylelint 'res/css/**/*.scss'",
"test": "jest",
diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts
index 7192eb81cc..051e865464 100644
--- a/src/@types/global.d.ts
+++ b/src/@types/global.d.ts
@@ -50,6 +50,8 @@ import UIStore from "../stores/UIStore";
import { SetupEncryptionStore } from "../stores/SetupEncryptionStore";
import { RoomScrollStateStore } from "../stores/RoomScrollStateStore";
+/* eslint-disable @typescript-eslint/naming-convention */
+
declare global {
interface Window {
matrixChat: ReturnType {_t(
+ { _t(
"Please ask the administrator of your homeserver " +
"( {_t(
+ ) } { _t(
"Alternatively, you can try to use the public server at " +
" {_t(
+ { _t(
"This action requires accessing the default identity server " +
" {_t(
+ ) } { _t(
"Only continue if you trust the owner of the server.",
- )} {_t(
+ description: { _t(
"Use an identity server to invite by email. " +
"Click continue to use the default identity server " +
"(%(defaultIdentityServerName)s) or manage in Settings.",
{
defaultIdentityServerName: abbreviateUrl(defaultIdentityServerUrl),
},
- )} {_t(
+ { _t(
"Warning: You should only set up key backup from a trusted computer.", {},
- { b: sub => {sub} },
- )} {_t(
+ { b: sub => { sub } },
+ ) } { _t(
"We'll store an encrypted copy of your keys on our server. " +
"Secure your backup with a Security Phrase.",
- )} {_t("For maximum security, this should be different from your account password.")} { _t("For maximum security, this should be different from your account password.") } {_t("Unable to find profiles for the Matrix IDs listed below - would you like to invite them anyway?")}
- {_t(
+ { _t(
"Clearing all data from this session is permanent. Encrypted messages will be lost " +
"unless their keys have been backed up.",
- )}
+ ) }
{_t(
+ let publicPrivateLabel = { _t(
"Private rooms can be found and joined by invitation only. Public rooms can be " +
"found and joined by anyone.",
- )} {_t(
+ publicPrivateLabel = { _t(
"Private rooms can be found and joined by invitation only. Public rooms can be " +
"found and joined by anyone in this community.",
- )} {federateLabel} { federateLabel } {_t("Tell us below how you feel about %(brand)s so far.", { brand })} {_t("Please go into as much detail as you like, so we can track down the problem.")} { _t("Tell us below how you feel about %(brand)s so far.", { brand }) } { _t("Please go into as much detail as you like, so we can track down the problem.") } {
_t("Please view
- {_t("Continuing temporarily allows the %(hostSignupBrand)s setup process to access your " +
+ { _t("Continuing temporarily allows the %(hostSignupBrand)s setup process to access your " +
"account to fetch verified email addresses. This data is not stored.", {
hostSignupBrand: this.config.brand,
- })}
+ }) }
- {_t("Learn more in our {_t(
+ { _t(
"Verify this user to mark them as trusted. " +
"Trusting users gives you extra peace of mind when using " +
"end-to-end encrypted messages.",
- )} {_t(
+ ) } { _t(
// NB. Below wording adjusted to singular 'session' until we have
// cross-signing
"Verifying this user will mark their session as trusted, and " +
"also mark your session as trusted to them.",
- )}
{ rows.map((row) =>
- ) }
{ otherVariables.map((item, index) =>
diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx
index f90854ee64..489d28e26b 100644
--- a/src/CallHandler.tsx
+++ b/src/CallHandler.tsx
@@ -615,23 +615,23 @@ export default class CallHandler extends EventEmitter {
private showICEFallbackPrompt() {
const cli = MatrixClientPeg.get();
- const code = sub => {_t(
+ { _t(
customVariables[row[0]].expl,
customVariables[row[0]].getTextVariables ?
customVariables[row[0]].getTextVariables() :
null,
- )}
+ ) }
{ row[1] !== undefined && }
{ row[1] }
{sub}
;
+ const code = sub => { sub }
;
Modal.createTrackedDialog('No TURN servers', '', QuestionDialog, {
title: _t("Call failed due to misconfigured server"),
description: %(homeserverDomain)s
) to configure a TURN server in " +
"order for calls to work reliably.",
{ homeserverDomain: cli.getDomain() }, { code },
- )}turn.matrix.org
, but this will not be as reliable, and " +
"it will share your IP address with that server. You can also manage " +
"this in Settings.",
null, { code },
- )}
-
{_t(category)}
- { _t(category) }
+
- {_t("Space used:")} {formatBytes(this.state.eventIndexSize, 0)}
- {_t("Indexed messages:")} {formatCountLong(this.state.eventCount)}
- {_t("Indexed rooms:")} {_t("%(doneRooms)s out of %(totalRooms)s", {
+ { crawlerState }
+ { _t("Space used:") } { formatBytes(this.state.eventIndexSize, 0) }
+ { _t("Indexed messages:") } { formatCountLong(this.state.eventCount) }
+ { _t("Indexed rooms:") } { _t("%(doneRooms)s out of %(totalRooms)s", {
doneRooms: formatCountLong(doneRooms),
totalRooms: formatCountLong(this.state.roomCount),
- })}
+ }) }
{_t("Advanced")}
+ { _t("Advanced") }
{ errorList }
diff --git a/src/components/views/dialogs/BaseDialog.js b/src/components/views/dialogs/BaseDialog.js
index e92bd6315e..8ccc485d7c 100644
--- a/src/components/views/dialogs/BaseDialog.js
+++ b/src/components/views/dialogs/BaseDialog.js
@@ -149,7 +149,7 @@ export default class BaseDialog extends React.Component {
'mx_Dialog_headerWithCancel': !!cancelButton,
})}>
{repo}
- {content}
+ { repo }
+ { content }
{_t("Unavailable")}
: logs}
+ { this.props.version == null || this.props.newVersion == null ? { _t("Unavailable") }
: logs }
{canEdit.toString()}
;
+ return ;
}
render() {
@@ -1028,17 +1028,17 @@ class SettingsExplorer extends React.PureComponent{ canEdit.toString() }
-
- {allSettings.map(i => (
+ { allSettings.map(i => (
{_t("Setting ID")}
- {_t("Value")}
- {_t("Value in this room")}
+ { _t("Setting ID") }
+ { _t("Value") }
+ { _t("Value in this room") }
- ))}
+ )) }
this.onViewClick(e, i)}>
-
{i}
+ { i }
this.onEditClick(e, i)}
className='mx_DevTools_SettingsExplorer_edit'
@@ -1047,20 +1047,20 @@ class SettingsExplorer extends React.PureComponent
-
{this.renderSettingValue(SettingsStore.getValue(i))}
+ { this.renderSettingValue(SettingsStore.getValue(i)) }
- {this.renderSettingValue(SettingsStore.getValue(i, room.roomId))}
+ { this.renderSettingValue(SettingsStore.getValue(i, room.roomId)) }
{_t("Setting:")}
+ {this.state.editSetting}
{ _t("Setting:") }
{ this.state.editSetting }
+ { _t("Setting definition:") }
+ {JSON.stringify(SETTINGS[this.state.editSetting], null, 4)}
{ JSON.stringify(SETTINGS[this.state.editSetting], null, 4) }
-
- {LEVEL_ORDER.map(lvl => (
+ { LEVEL_ORDER.map(lvl => (
{_t("Level")}
- {_t("Settable at global")}
- {_t("Settable at room")}
+ { _t("Level") }
+ { _t("Settable at global") }
+ { _t("Settable at room") }
-
- ))}
+ )) }
- {this.renderCanEditLevel(null, lvl)}
- {this.renderCanEditLevel(room.roomId, lvl)}
+ {lvl}
+ { this.renderCanEditLevel(null, lvl) }
+ { this.renderCanEditLevel(room.roomId, lvl) }
{ lvl }
{_t("Setting:")}
+ {this.state.viewSetting}
{ _t("Setting:") }
{ this.state.viewSetting }
+ { _t("Setting definition:") }
+ {JSON.stringify(SETTINGS[this.state.viewSetting], null, 4)}
{ JSON.stringify(SETTINGS[this.state.viewSetting], null, 4) }
{this.renderSettingValue(
+ { _t("Value:") }
+
{ this.renderSettingValue(
SettingsStore.getValue(this.state.viewSetting),
- )}
+ ) }{this.renderSettingValue(
+ { _t("Value in this room:") }
+
{ this.renderSettingValue(
SettingsStore.getValue(this.state.viewSetting, room.roomId),
- )}
+ ) }{this.renderExplicitSettingValues(
+ { _t("Values at explicit levels:") }
+
+ ) }{ this.renderExplicitSettingValues(
this.state.viewSetting, null,
- )}
{this.renderExplicitSettingValues(
+ { _t("Values at explicit levels in this room:") }
+
+ ) }{ this.renderExplicitSettingValues(
this.state.viewSetting, room.roomId,
- )}
{_t("Rate %(brand)s", { brand })}
+ { _t("Rate %(brand)s", { brand }) }
- {_t("There are two ways you can provide feedback and help us improve %(brand)s.", { brand })}
+ { _t("There are two ways you can provide feedback and help us improve %(brand)s.", { brand }) }
);
}
@@ -106,7 +106,7 @@ export default (props) => {
_t("PRO TIP: If you start a bug, please submit {_t("Report a bug")}
+ { _t("Report a bug") }
{oppProfile.displayname}
+ { oppProfile.displayname }
{this.props.verifier.userId}
+ { this.props.verifier.userId }
{_t( +
{ _t( "Verify this device to mark it as trusted. " + "Trusting this device gives you and other users extra peace of mind when using " + "end-to-end encrypted messages.", - )}
, -{_t( + ) }
, +{ _t( "Verifying this device will mark it as trusted, and users who have verified with " + "you will trust this device.", - )}
, + ) }, ]; return ({_t("Waiting for partner to confirm...")}
+{ _t("Waiting for partner to confirm...") }
{_t("Enable 'Manage Integrations' in Settings to do this.")}
+{ _t("Enable 'Manage Integrations' in Settings to do this.") }
- {_t( + { _t( "Your %(brand)s doesn't allow you to use an integration manager to do this. " + "Please contact an admin.", { brand }, - )} + ) }
{_t("No results")}
+{ _t("No results") }
); } @@ -1175,7 +1175,7 @@ export default class InviteDialog extends React.PureComponent{sectionSubname}
: null} - {tiles} - {showMore} +{ sectionSubname }
: null } + { tiles } + { showMore } ); } @@ -1225,8 +1225,8 @@ export default class InviteDialog extends React.PureComponent{helpText}
+{ helpText }
{_t("%(brand)s encountered an error during upload of:", { brand })}
-{reason}
- {retrying &&{JSON.stringify(failures, null, 2)}+
{ _t("%(brand)s encountered an error during upload of:", { brand }) }
+{ reason }
+ { retrying &&{ JSON.stringify(failures, null, 2) }
{description1}
{description2}
{ description1 }
{ description2 }
{_t( +
{ _t( "Encrypted messages are secured with end-to-end encryption. " + "Only you and the recipient(s) have the keys to read these messages.", - )}
-{_t("Back up your keys before signing out to avoid losing them.")}
+ ) } +{ _t("Back up your keys before signing out to avoid losing them.") }
- {_t("Your homeserver doesn't seem to support this feature.")} + { _t("Your homeserver doesn't seem to support this feature.") }
); } else if (error.errcode) { // some kind of error from the homeserver content = (- {_t("Something went wrong!")} + { _t("Something went wrong!") }
); } else { content = (
- {_t("Cannot reach homeserver")}
+ { _t("Cannot reach homeserver") }
- {_t("Ensure you have a stable internet connection, or get in touch with the server admin")}
+ { _t("Ensure you have a stable internet connection, or get in touch with the server admin") }
{_t("To continue you need to accept the terms of this service.")}
+{ _t("To continue you need to accept the terms of this service.") }
{_t("Service")} | -{_t("Summary")} | -{_t("Document")} | -{_t("Accept")} | +{ _t("Service") } | +{ _t("Summary") } | +{ _t("Document") } | +{ _t("Accept") } |
---|
{newSessionText}
-{device.getDisplayName()} ({device.deviceId})
-{askToVerifyText}
+{ newSessionText }
+{ device.getDisplayName() } ({ device.deviceId })
+{ askToVerifyText }
- {_t("The widget will verify your user ID, but won't be able to perform actions for you:")} + { _t("The widget will verify your user ID, but won't be able to perform actions for you:") }
- {/* cheap trim to just get the path */} - {this.props.widget.templateUrl.split("?")[0].split("#")[0]} + { /* cheap trim to just get the path */ } + { this.props.widget.templateUrl.split("?")[0].split("#")[0] }
{_t("Only do this if you have no other device to complete verification with.")}
-{_t("If you reset everything, you will restart with no trusted sessions, no trusted users, and " - + "might not be able to see past messages.")}
+{ _t("Only do this if you have no other device to complete verification with.") }
+{ _t("If you reset everything, you will restart with no trusted sessions, no trusted users, and " + + "might not be able to see past messages.") }
{_t( +
{ _t(
"Enter your Security Phrase or
{_t("Use your Security Key to continue.")}
+{ _t("Use your Security Key to continue.") }
- {_t( + { _t( "Deleting cross-signing keys is permanent. " + "Anyone you have verified with will see security alerts. " + "You almost certainly don't want to do this, unless " + "you've lost every device you can cross-sign from.", - )} + ) }
{_t("Unable to set up keys")}
+{ _t("Unable to set up keys") }
{_t( +
{ _t( "Backup could not be decrypted with this Security Key: " + "please verify that you entered the correct Security Key.", - )}
+ ) }{_t( +
{ _t( "Backup could not be decrypted with this Security Phrase: " + "please verify that you entered the correct Security Phrase.", - )}
+ ) }{_t( + failedToDecrypt =
{ _t( "Failed to decrypt %(failedCount)s sessions!", { failedCount: this.state.recoverInfo.total - this.state.recoverInfo.imported }, - )}
; + ) }; } content ={_t("Successfully restored %(sessionCount)s keys", { sessionCount: this.state.recoverInfo.imported })}
- {failedToDecrypt} +{ _t("Successfully restored %(sessionCount)s keys", { sessionCount: this.state.recoverInfo.imported }) }
+ { failedToDecrypt }{_t( +
{ _t( "Warning: you should only set up key backup " + "from a trusted computer.", {}, - { b: sub => {sub} }, - )}
-{_t( + { b: sub => { sub } }, + ) }
+{ _t( "Access your secure message history and set up secure " + "messaging by entering your Security Phrase.", - )}
+ ) }{_t( +
{ _t( "Warning: You should only set up key backup " + "from a trusted computer.", {}, - { b: sub => {sub} }, - )}
-{_t( + { b: sub => { sub } }, + ) }
+{ _t( "Access your secure message history and set up secure " + "messaging by entering your Security Key.", - )}
+ ) } extends React.PureComponent {_t(
+ { _t(
"Please {_t(
+ ) } { _t(
"If you've submitted a bug via GitHub, debug logs can help " +
"us track down the problem. Debug logs contain application " +
"usage data including your username, the IDs or aliases of " +
"the rooms or groups you have visited and the usernames of " +
"other users. They do not contain messages.",
- )}{editableItems}
;
+ const editableItemsSection = this.props.canRemove ? editableItems : { editableItems }
;
const label = this.props.items.length > 0 ? this.props.itemsLabel : this.props.noItemsLabel;
return (
diff --git a/src/components/views/elements/ErrorBoundary.tsx b/src/components/views/elements/ErrorBoundary.tsx
index f967b8c594..334e569163 100644
--- a/src/components/views/elements/ErrorBoundary.tsx
+++ b/src/components/views/elements/ErrorBoundary.tsx
@@ -81,33 +81,33 @@ export default class ErrorBoundary extends React.PureComponent<{}, IState> {
let bugReportSection;
if (SdkConfig.get().bug_report_endpoint_url) {
bugReportSection =
✅ {_t("This session is backing up your keys. ")}
; + statusDescription =✅ { _t("This session is backing up your keys. ") }
; } else { statusDescription = <> -{_t( +
{ _t( "This session is not backing up your keys, " + "but you do have an existing backup you can restore from " + "and add to going forward.", {}, - { b: sub => {sub} }, - )}
-{_t( + { b: sub => { sub } }, + ) }
+{ _t( "Connect this session to key backup before signing out to avoid " + "losing any keys that may only be on this session.", - )}
+ ) } >; restoreButtonCaption = _t("Connect this session to Key Backup"); } @@ -253,11 +253,11 @@ export default class SecureBackupPanel extends React.PureComponent { uploadStatus = ""; } else if (sessionsRemaining > 0) { uploadStatus ={_t( +
{ _t( "Your keys are not being backed up from this session.", {}, - { b: sub => {sub} }, - )}
-{_t("Back up your keys before signing out to avoid losing them.")}
+ { b: sub => { sub } }, + ) } +{ _t("Back up your keys before signing out to avoid losing them.") }
>; actions.push({_t( +
{ _t( "Back up your encryption keys with your account data in case you " + "lose access to your sessions. Your keys will be secured with a " + "unique Security Key.", - )}
- {statusDescription} + ) } + { statusDescription }{_t("Backup key stored:")} | +{ _t("Backup key stored:") } | { backupKeyStored === true ? _t("in secret storage") : _t("not stored") } | |
{_t("Backup key cached:")} | +{ _t("Backup key cached:") } | - {backupKeyCached ? _t("cached locally") : _t("not found locally")} - {backupKeyWellFormedText} + { backupKeyCached ? _t("cached locally") : _t("not found locally") } + { backupKeyWellFormedText } | |
{_t("Secret storage public key:")} | -{secretStorageKeyInAccount ? _t("in account data") : _t("not found")} | +{ _t("Secret storage public key:") } | +{ secretStorageKeyInAccount ? _t("in account data") : _t("not found") } |
{_t("Secret storage:")} | -{secretStorageReady ? _t("ready") : _t("not ready")} | +{ _t("Secret storage:") } | +{ secretStorageReady ? _t("ready") : _t("not ready") } |
{_t( +
{ _t(
"You should remove your personal data from identity server " +
"
{_t("You should:")}
+ ) } +{ _t("You should:") }
{_t( +
{ _t(
"You are still sharing your personal data on the identity " +
"server
{_t( + ) }
+{ _t( "We recommend that you remove your email addresses and phone numbers " + "from the identity server before disconnecting.", - )}
+ ) }{_t( +
{ _t( "This room is bridging messages to the following platforms. " + "Learn more.", {}, { // TODO: We don't have this link yet: this will prevent the translators // having to re-translate the string when we do. - a: sub => {sub}, + a: sub => { sub }, }, - )}
+ ) }{_t( + content =
{ _t( "This room isn’t bridging messages to any platforms. " + "Learn more.", {}, { // TODO: We don't have this link yet: this will prevent the translators // having to re-translate the string when we do. - a: sub => {sub}, + a: sub => { sub }, }, - )}
; + ) }; } return ({this.state.uploadedFile.name}
+ { _t("Uploaded sound") }: { this.state.uploadedFile.name }
{this.state.currentSound}
{ this.state.currentSound }
{_t('Select the roles required to change various parts of the room')}
- {powerSelectors} - {eventPowerSelectors} + { _t("Permissions") } +{ _t('Select the roles required to change various parts of the room') }
+ { powerSelectors } + { eventPowerSelectors }- {passwordChangeText} + { passwordChangeText }
- {passwordChangeForm} - {threepidSection} + { passwordChangeForm } + { threepidSection }{MatrixClientPeg.get().getHomeserverUrl()}
{MatrixClientPeg.get().getIdentityServerUrl()}
{ MatrixClientPeg.get().getHomeserverUrl() }
{ MatrixClientPeg.get().getIdentityServerUrl() }
{MatrixClientPeg.get().getAccessToken()}
+ { MatrixClientPeg.get().getAccessToken() }
{rule.entity}
{ rule.entity }
{rule.entity}
+ { rule.entity }
,
);
}
return (
{_t("You are currently ignoring:")}
-{ _t("You are currently ignoring:") }
+{list.roomId}
) : list.roomId
;
+ const name = room ? { room.name } ({ list.roomId }
) : list.roomId
;
tiles.push(
{_t("You are currently subscribed to:")}
-{ _t("You are currently subscribed to:") }
+@bot:*
" +
"would ignore all users that have the name 'bot' on any server.",
- { brand }, { code: (s) => {s}
},
- )}{ s }
},
+ ) }{deviceId}
+ { deviceId }
{identityKey}
+ { identityKey }
{_t("Missing media permissions, click the button below to request.")}
+{ _t("Missing media permissions, click the button below to request.") }
{_t( +
{ _t( "The other party cancelled the verification.", - )}
+ ) }{_t("You've successfully verified this user.")}
-{_t( +
{ _t("You've successfully verified this user.") }
+{ _t( "Secure messages with this user are end-to-end encrypted and not able to be " + "read by third parties.", - )}
+ ) }{sasCaption}
- {sasDisplay} -{this.props.isSelf ? +
{ sasCaption }
+ { sasDisplay } +{ this.props.isSelf ? "": - _t("To be secure, do this in person or use a trusted way to communicate.")}
- {confirm} + _t("To be secure, do this in person or use a trusted way to communicate.") } + { confirm }{incomingCallText}
+{ incomingCallText }
{releaseNotes}, + description:
{ releaseNotes }, button: _t("Update"), onFinished: (update) => { if (update && PlatformPeg.get()) { diff --git a/src/utils/AutoDiscoveryUtils.tsx b/src/utils/AutoDiscoveryUtils.tsx index 6c0c8b2e13..bad87db2b9 100644 --- a/src/utils/AutoDiscoveryUtils.tsx +++ b/src/utils/AutoDiscoveryUtils.tsx @@ -90,7 +90,7 @@ export default class AutoDiscoveryUtils { href="https://github.com/vector-im/element-web/blob/master/docs/config.md" target="_blank" rel="noreferrer noopener" - >{sub}; + >{ sub }; }, }, ); @@ -130,8 +130,8 @@ export default class AutoDiscoveryUtils { serverErrorIsFatal: isFatalError, serverDeadError: (