element-web-Github/src
Eric Eastwood c1e7905ddc
Properly translate errors in AddThreepid.ts (#10432)
* Properly translate errors in AddThreepid.ts

Part of https://github.com/vector-im/element-web/issues/9597

* Use translated message

* Avoid returning undefined ever

* More usage

* Introduce UserFriendlyError

* Use UserFriendlyError

* Add more usage instead of normal error

* Use types and translatedMessage

* Fix lints

* Update i18n although it's wrong

* Use unknown for easier creation from try/catch

* Use types

* Use error types

* Use types

* Update i18n strings

* Remove generic re-label of HTTPError

See https://github.com/matrix-org/matrix-react-sdk/pull/10432#discussion_r1156468143

The HTTPError already has a good label and it isn't even translated if we re-label it here in this way generically

Probably best to just remove in favor of thinking about a translations in general from the `matrix-js-sdk`, see https://github.com/matrix-org/matrix-js-sdk/issues/1309

* Make error message extraction generic

* Update i18n strings

* Add tests for email addresses

* More consistent error logging to actually see error in logs

* Consistent error handling

* Any is okay because we have a fallback

* Check error type

* Use dedicated mockResolvedValue function

See https://github.com/matrix-org/matrix-react-sdk/pull/10432#discussion_r1163344034
2023-04-14 15:40:19 +01:00
..
@types Update dependency typescript to v5 (#10532) 2023-04-06 13:17:50 +01:00
accessibility Make composer format bar an aria toolbar (#10583) 2023-04-12 13:58:38 +00:00
actions Conform more of the codebase to strictNullChecks (#10350 2023-03-10 14:55:06 +00:00
async-components/views/dialogs Fix import e2e key dialog staying disabled after paste (#10375) 2023-03-15 09:20:20 +00:00
audio Conform more of the codebase to strictNullChecks (#10350 2023-03-10 14:55:06 +00:00
autocomplete Support dynamic room predecessor in SpaceProvider (#10348) 2023-03-10 11:01:45 +00:00
components Properly translate errors in AddThreepid.ts (#10432) 2023-04-14 15:40:19 +01:00
contexts Improve context types (#10510) 2023-04-04 14:01:04 +01:00
customisations Conform more code to strictNullChecks (#10368 2023-03-14 11:09:35 +00:00
dispatcher Conform more code to strictNullChecks (#10374) 2023-03-16 11:07:29 +00:00
editor Conform more of the codebase to strictNullChecks (#10573) 2023-04-13 08:52:57 +01:00
effects Make TS strict the effects folder (#10111) 2023-02-08 13:12:14 +01:00
emojipicker Enable @typescript-eslint/explicit-function-return-type in /src (#9788) 2023-01-12 13:25:14 +00:00
events Update dependency typescript to v5 (#10532) 2023-04-06 13:17:50 +01:00
hooks Conform more of the codebase to strictNullChecks (#10573) 2023-04-13 08:52:57 +01:00
i18n/strings Properly translate errors in AddThreepid.ts (#10432) 2023-04-14 15:40:19 +01:00
indexing Make more code conform to strict null checks (#10219 2023-02-24 15:28:40 +00:00
integrations Apply strictNullChecks to src/stores/widgets/* (#10324) 2023-03-08 11:48:58 +00:00
mjolnir Apply strictNullChecks around the codebase (#10302 2023-03-07 13:19:18 +00:00
models Conform more code to strict null checking (#10153) 2023-02-15 13:36:22 +00:00
modules Merge branch 'master' into develop 2023-03-28 14:30:52 +01:00
notifications Apply strictNullChecks around the codebase (#10302 2023-03-07 13:19:18 +00:00
performance Conform more of the code base to strict null checking (#10147) 2023-02-13 17:01:43 +00:00
rageshake Remove dependency on org.matrix.e2e_cross_signing unstable feature (#10593) 2023-04-14 10:14:05 +00:00
resizer fix resize to only work with left mouse click (#10546) 2023-04-11 06:13:11 +00:00
settings Update setting description to match reality (#10600) 2023-04-14 08:58:08 +00:00
stores Conform more of the codebase to strictNullChecks (#10573) 2023-04-13 08:52:57 +01:00
toasts Simplify isDeviceVerified definitions (#10594) 2023-04-14 09:46:37 +00:00
usercontent Apply prettier formatting 2022-12-12 12:24:14 +01:00
utils Simplify isDeviceVerified definitions (#10594) 2023-04-14 09:46:37 +00:00
voice-broadcast Conform more of the codebase to strictNullChecks (#10504 2023-04-04 11:41:46 +01:00
widgets Apply strictNullChecks around the codebase (#10302 2023-03-07 13:19:18 +00:00
workers
AddThreepid.ts Properly translate errors in AddThreepid.ts (#10432) 2023-04-14 15:40:19 +01:00
AsyncWrapper.tsx Explicitly specify all children props (#10312) 2023-03-08 13:28:07 +00:00
Avatar.ts Fix bug on Avatar.ts for custom theme avatar background color (#10598) 2023-04-14 13:38:54 +00:00
BasePlatform.ts Clear electron data when logging out (#10386) 2023-03-15 15:56:29 +00:00
BlurhashEncoder.ts Enable @typescript-eslint/explicit-function-return-type in /src (#9788) 2023-01-12 13:25:14 +00:00
boundThreepids.ts Conform more of the codebase to strictNullChecks (#10350 2023-03-10 14:55:06 +00:00
call-types.ts Apply prettier formatting 2022-12-12 12:24:14 +01:00
ContentMessages.ts Implement MSC3952: intentional mentions (#9983) 2023-03-23 11:47:40 +00:00
createRoom.ts Conform more of the codebase to strictNullChecks (#10518 2023-04-06 11:10:14 +01:00
DateUtils.ts Display relative timestamp for threads on the same calendar day (#10399) 2023-03-27 20:22:46 +00:00
DecryptionFailureTracker.ts Conform more code to strict null checking (#10167) 2023-02-16 17:21:44 +00:00
DeviceListener.ts Remove dependency on org.matrix.e2e_cross_signing unstable feature (#10593) 2023-04-14 10:14:05 +00:00
Editing.ts Enable @typescript-eslint/explicit-function-return-type in /src (#9788) 2023-01-12 13:25:14 +00:00
email.ts Factor out basic email check (#10244) 2023-02-28 10:39:35 +01:00
emoji.ts Conform more of the code base to strict null checking (#10147) 2023-02-13 17:01:43 +00:00
HtmlUtils.tsx Apply strictNullChecks to src/components/views/elements/* (#10462 2023-03-29 08:23:54 +01:00
IConfigOptions.ts Remove hosting link provider from Element (#10270) 2023-03-02 17:36:16 +00:00
identifiers.ts
IdentityAuthClient.tsx Conform more code to strict null checking (#10167) 2023-02-16 17:21:44 +00:00
ImageUtils.ts Conform more of the codebase to strictNullChecks (#10573) 2023-04-13 08:52:57 +01:00
index.ts Step 6: Refactor event rendering to stop using getComponent 2022-03-28 14:02:31 -06:00
KeyBindingsDefaults.ts Apply strictNullChecks around the codebase (#10302 2023-03-07 13:19:18 +00:00
KeyBindingsManager.ts Conform more code to strictNullChecks (#10374) 2023-03-16 11:07:29 +00:00
Keyboard.ts Comply with noImplicitAny (#9940) 2023-02-13 11:39:16 +00:00
languageHandler.tsx Replace newTranslatableError with UserFriendlyError (#10440 2023-03-31 08:30:43 +01:00
LegacyCallHandler.tsx Conform more of the codebase to strictNullChecks (#10504 2023-04-04 11:41:46 +01:00
Lifecycle.ts Conform more of the codebase to strictNullChecks (#10518 2023-04-06 11:10:14 +01:00
linkify-matrix.ts Make more code conform to strict null checks (#10219 2023-02-24 15:28:40 +00:00
Livestream.ts Enable @typescript-eslint/explicit-function-return-type in /src (#9788) 2023-01-12 13:25:14 +00:00
Login.ts Apply strictNullChecks to src/components/auth/* (#10484 2023-03-31 09:26:15 +01:00
Markdown.ts Conform more of the code base to strict null checking (#10147) 2023-02-13 17:01:43 +00:00
MatrixClientPeg.ts Conform more of the codebase to strictNullChecks (#10518 2023-04-06 11:10:14 +01:00
MediaDeviceHandler.ts Make more code conform to strict null checks (#10219 2023-02-24 15:28:40 +00:00
Modal.tsx Better error handling in jump to date (#10405) 2023-03-24 14:39:24 -05:00
NodeAnimator.tsx Apply strictNullChecks around the codebase (#10302 2023-03-07 13:19:18 +00:00
Notifier.ts Apply strictNullChecks around the codebase (#10302 2023-03-07 13:19:18 +00:00
PageTypes.ts Delete the remainder of groups (#9357) 2022-10-05 17:44:46 +00:00
PasswordReset.ts Fix some inconsistencies in error messages (#10114) 2023-02-09 10:04:54 +00:00
phonenumber.ts Enable @typescript-eslint/explicit-function-return-type in /src (#9788) 2023-01-12 13:25:14 +00:00
PlatformPeg.ts Enable @typescript-eslint/explicit-function-return-type in /src (#9788) 2023-01-12 13:25:14 +00:00
PosthogAnalytics.ts Conform more code to strict null checking (#10153) 2023-02-15 13:36:22 +00:00
PosthogTrackers.ts Make more code conform to strict null checks (#10219 2023-02-24 15:28:40 +00:00
Presence.ts Conform more of the code base to strict null checking (#10147) 2023-02-13 17:01:43 +00:00
Registration.tsx Fix UIFeature.Registration not applying to all paths (#10371) 2023-03-14 15:20:38 +00:00
Resend.ts Conform more of the code base to strict null checking (#10147) 2023-02-13 17:01:43 +00:00
Roles.ts Apply prettier formatting 2022-12-12 12:24:14 +01:00
RoomAliasCache.ts Conform more of the code base to strict null checking (#10147) 2023-02-13 17:01:43 +00:00
RoomInvite.tsx Properly type Modal props to ensure useful typescript checking (#10238 2023-02-28 10:31:48 +00:00
RoomNotifs.ts Conform more of the code base to strict null checking (#10147) 2023-02-13 17:01:43 +00:00
Rooms.ts Apply strictNullChecks around the codebase (#10302 2023-03-07 13:19:18 +00:00
ScalarAuthClient.ts Conform more code to strict null checking (#10167) 2023-02-16 17:21:44 +00:00
ScalarMessaging.ts Apply strictNullChecks around the codebase (#10302 2023-03-07 13:19:18 +00:00
SdkConfig.ts Apply strictNullChecks to src/components/views/auth/* (#10299 2023-03-07 10:45:55 +00:00
Searching.ts Conform more code to strictNullChecks (#10374) 2023-03-16 11:07:29 +00:00
SecurityManager.ts Apply strictNullChecks around the codebase (#10302 2023-03-07 13:19:18 +00:00
SendHistoryManager.ts Enable @typescript-eslint/explicit-function-return-type in /src (#9788) 2023-01-12 13:25:14 +00:00
sendTimePerformanceMetrics.ts Enable @typescript-eslint/explicit-function-return-type in /src (#9788) 2023-01-12 13:25:14 +00:00
sentry.ts Remove dependency on org.matrix.e2e_cross_signing unstable feature (#10593) 2023-04-14 10:14:05 +00:00
shouldHideEvent.ts Comply with noImplicitAny (#9940) 2023-02-13 11:39:16 +00:00
SlashCommands.tsx Replace newTranslatableError with UserFriendlyError (#10440 2023-03-31 08:30:43 +01:00
SlidingSyncManager.ts More tests 2023-01-20 12:38:58 +00:00
Terms.ts Apply strictNullChecks around the codebase (#10302 2023-03-07 13:19:18 +00:00
TextForEvent.tsx Conform more code to strict null checking (#10167) 2023-02-16 17:21:44 +00:00
theme.ts Update all non-major dependencies (#9766) 2023-03-06 17:21:09 +00:00
Unread.ts Add unread fallback logging (#10509) 2023-04-11 07:41:59 +00:00
UserActivity.ts Comply with noImplicitAny (#9940) 2023-02-13 11:39:16 +00:00
UserAddress.ts Remove dead code (#9035) 2022-07-11 07:52:44 +02:00
verification.ts TypeScript strict fixes (#10138) 2023-02-10 18:11:57 +00:00
Views.ts Implement Use Case Selection screen (#8984) 2022-07-13 15:43:44 +02:00
VoipUserMapper.ts Conform more of the code base to strict null checking (#10147) 2023-02-13 17:01:43 +00:00
WhoIsTyping.ts TypeScript strict fixes (#10138) 2023-02-10 18:11:57 +00:00