Commit Graph

192 Commits (e6af09e42425ca01232fc19ef71c410cb03cdc35)

Author SHA1 Message Date
Michael Telatynski e6af09e424
Switch to importing models/room-state & models/room-member from main js-sdk export (#11362)
* Switch to importing TypedEventEmitter from main js-sdk export

* Switch to importing js-sdk/matrix in cypress

* Remove duplicated imports

* Fix lint:js-fix to run prettier last otherwise ESLint --fix may cause a mess

* Add lint rule

* Switch to importing models/Room from main js-sdk export

* Switch to importing models/room-state & models/room-member from main js-sdk export

* Fix cypress-axe import

* Fix more imports

* Fix cypress-axe import

* Fix bad merge
2023-08-04 11:22:08 +00:00
Michael Telatynski e67ca33c4a
Switch to importing models/Room from main js-sdk export (#11361)
* Switch to importing TypedEventEmitter from main js-sdk export

* Switch to importing js-sdk/matrix in cypress

* Remove duplicated imports

* Fix lint:js-fix to run prettier last otherwise ESLint --fix may cause a mess

* Add lint rule

* Switch to importing models/Room from main js-sdk export

* Fix cypress-axe import

* Fix more imports

* Fix cypress-axe import

* Fix duplicated lint rule
2023-08-04 07:36:16 +00:00
Richard van der Hoff ddb8e0aa3a
Update `SecureBackupPanel` to use `getCrypto()` (#11322)
`MatrixClient.crypto` is going away, so let's switch over to `getCrypto()`.

There doesn't seem to be anything else relying on the `crypto` stub in
`mockClientMethodsCrypto()`, so let's get rid of that.
2023-07-28 09:24:28 +00:00
Michael Telatynski d405160080
Use PassphraseFields in ExportE2eKeysDialog to enforce minimum passphrase complexity (#11222)
* Use PassphraseFields in ExportE2eKeysDialog to enforce minimum passphrase complexity

* Tweak copy

* Iterate

* Add tests

* Improve variable naming

* Improve coverage
2023-07-27 09:21:20 +00:00
Richard van der Hoff e959eca354
Fix corrupt thread timeline for sending events (#11260)
Events which are still in the process of being sent should *not* be included
in the `EventTimeline`. Doing so means that we will attempt to render them
twice, which makes react explode.

Fixes https://github.com/vector-im/element-web/issues/25770
2023-07-14 10:59:55 +00:00
Kerry c5befa1ef8
Stabilize support for MSC3952: intentional mentions (#10967)
* enable feature_intentional_mentions with v1.7

* org.matrix.msc3952.mentions -> m.mentions

* update push rules test util

* only support stable version 1.7

* use stable values for msc3952 push rules

* use stable intentional mentions rule sin test models

* unstable feature in settings controller
2023-07-11 22:29:54 +00:00
Kerry 01bd80fe59
OIDC: update to `oidc-client-ts` functions from js-sdk (#11193)
* test util for oidcclientconfigs

* rename type and lint

* correct oidc test util

* store issuer and clientId pre auth navigation

* update for js-sdk userstate, tidy
2023-07-10 00:57:16 +00:00
Michael Telatynski 209f5bdf33
Consider the empty push rule actions array equiv to deprecated dont_notify (#11155)
* Consider the empty push rule actions array equiv to deprecated dont_notify

* Switch primary tests to empty actions, add test for dont_notify

* strict types
2023-06-28 14:07:02 +00:00
Richard van der Hoff 46eb34a55d
Kill off references to deprecated `getStoredDevice` and `getStoredDevicesForUser` (#11152)
* Use new `CryptoEvent.VerificationRequestReceived` event

https://github.com/matrix-org/matrix-js-sdk/pull/3514 deprecates
`CryptoEvent.VerificationRequest` in favour of
`CryptoEvent.VerificationRequestReceived`. Use the new event.

* Factor out `getDeviceCryptoInfo` function

I seem to be writing this logic several times, so let's factor it out.

* Factor out `getUserDeviceIds` function

Another utility function

* VerificationRequestToast: `getStoredDevice` -> `getDeviceCryptoInfo`

* SlashCommands: `getStoredDevice` -> `getDeviceCryptoInfo`

* MemberTile: `getStoredDevicesForUser` -> `getUserDeviceIds`

* Remove redundant mock of `getStoredDevicesForUser`
2023-06-28 12:39:34 +00:00
Kerry 328db8fdfd
OIDC: Check static client registration and add login flow (#11088)
* util functions to get static client id

* check static client ids in login flow

* remove dead code

* add trailing slash

* comment error enum

* spacing

* PR tidying

* more comments

* add ValidatedDelegatedAuthConfig type

* Update src/Login.ts

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Update src/Login.ts

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Update src/utils/ValidatedServerConfig.ts

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* rename oidc_static_clients to oidc_static_client_ids

* comment

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-06-22 10:15:44 +00:00
Richard van der Hoff 8570f16e31
Fix access to deprecated methods in `SetupEncryptionStore` (#11107)
* Fix access to deprecated methods in `SetupEncryptionStore`

* Updte tests

* more tests
2023-06-19 22:20:14 +00:00
Florian Duros 77da949fd4
`CreateKeyBackupDialog.tsx`: Remove logic for servers which are not supporting cross-signing (#11076) 2023-06-16 13:25:24 +01:00
Michael Telatynski 7236e48765
Allow maintaining a different right panel width for thread panels (#11064)
* Move Room context threadId our of RoomView state

* Allow maintaining a different right panel width for thread panels

* Fix types

* Fix types

* Add tests

* Increase coverage

* Increase coverage

* Add comments

* Update src/components/structures/MainSplit.tsx

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-06-15 11:57:58 +00:00
Michael Telatynski 9c48487d85
Prefer MatrixClientContext over MatrixClientPeg (#10986) 2023-06-14 13:42:07 +01:00
Florian Duros 127b542233
Use `crypto.isCrossSigningReady` in `CrossSigningPanel` (#11080) 2023-06-14 09:46:14 +00:00
Florian Duros d5d1ec775c
Use new api `CryptoApi.getCrossSigningStatus` in `CrossSigningPanel` (#11052)
* Use new api `CryptoApi.getCrossSigningStatus` in `CrossSigningPanel`

* Update `CrossSigningPanel-test.tsx`

* Update `publicKeysOnDevice`

* Fix `CryptoApi` import

* Fix strict type

* Fix tests

* Remove `crossSigningInfo` in `mockClientMethodsCrypto`

* Move matrix client initialization in `beforeEach`
2023-06-12 18:33:39 +00:00
Michael Telatynski 6b46d6e4f8
Add MatrixClientPeg::safeGet and use it in tests (#10985) 2023-06-05 18:12:23 +01:00
Michael Telatynski b6b9ce3c46
When joining room in sub-space join the parents too (#11011)
* When joining room in sub-space join the parents too

* Fix joined state not updating on sync

* Add membership check

* Update tests

* Improve coverage

* Make TS happier

* Make TS happier
2023-06-01 12:35:47 +00:00
Michael Weimann b5727cb463
Include thread replies in message previews (#10631)
* Include thread replies to message previews

* Extend tests

* Fix type issue

* Use currentColor for thread icon

* Fix long room name overflow

* Update snapshots

* Fix preview

* Fix typing issue

* Fix type issues

* Tweak thread reply detection

* Extend tests

* Fix type issue

* Fix test
2023-06-01 07:53:48 +00:00
Richard van der Hoff 161e19dfb6
Settings panels: avoid exceptions with rust crypto (#10962)
* Settings panels: avoid exceptions with rust crypto

If we are using rust crypto, `client.crypto` is undefined. We'll need to fix
these up better in future, but for now, just return early.

* Update tests
2023-05-23 12:01:27 +00:00
Michael Weimann 4e5687c454
Send correct receipts when viewing a room (#10864)
* Send correct receipts when viewing a room

* Fix strict type issues

* Handle promises

* Handle more primises

* Add generic array type

* Replace existende check with type predicate

* Fix wrong variable check

* Improve comment about initial read marker

* Use read_markers API for fully read receipts

* Log public receipt fallback

* Rename variables in new code to be aligned to the spec

* Add end-2-end test for read markers and receipts
2023-05-15 16:06:02 +00:00
Robin 87e2274ae7
Enable pagination for overlay timelines (#10757)
* Update @types/jest to 29.2.6

This adds the correct types for the contexts field on mock objects, which I'll need shortly

* Enable pagination for overlay timelines
2023-05-12 16:27:41 +00:00
Kerry f6e8ffe750
add push rules test utility (#10712)
* add push rules test utility

* strict

* strict
2023-04-27 01:18:19 +00:00
Florian Duros 5328f6e5fe
Element-R: Populate device list for right-panel (#10671)
* Use `getUserDeviceInfo` instead of `downloadKeys` and `getStoredDevicesForUser`

* Use new `getUserDeviceInfo` api in `UserInfo.tsx` and `UserInfo-test.tsx`

* Fix missing fields

* Use `getUserDeviceInfo` instead of `downloadKeys`

* Move `ManualDeviceKeyVerificationDialog.tsx` from class to functional component and add tests

* Fix strict errors

* Update snapshot

* Add snapshot test to `UserInfo-test.tsx`

* Add test for <BasicUserInfo />

* Remove useless TODO comment

* Add test for ambiguous device

* Rework `<BasicUserInfo />` test
2023-04-26 10:23:32 +00:00
Florian Duros db40479910
Element-R: Starting a DMs with a user (#10673)
* Use `cli.getUserDeviceInfo` instead of `cli.downloadKeys` to create a room

* Use `client.getCrypto().getUserDeviceInfo` instead of `client.getUserDeviceInfo`

* Update `createRoom-test.ts` to use `getUserDeviceInfo`

* Remove duplicate  field
2023-04-24 14:19:08 +00:00
Richard van der Hoff d7bb8043ea
Replace uses of `checkDeviceTrust` with `getDeviceVerificationStatus` (#10663)
matrix-org/matrix-js-sdk#3287 and matrix-org/matrix-js-sdk#3303 added a new API called getDeviceVerificationStatus. Let's use it.
2023-04-24 14:19:46 +01:00
Richard van der Hoff 83f12fcba0
More tests for UserInfo (#10677)
* UserInfo-test: move mocking to `beforeEach`

... so that changes to the mocks do not leak between tests

* Add some more tests for UserInfo
2023-04-21 13:48:27 +00:00
Kerry 7a914e73f8
hack to fix console noise from unfaked timers and clearAllModals (#10660) 2023-04-20 22:35:44 +00:00
Richard van der Hoff 70b87f8bde
Simplify `isDeviceVerified` definitions (#10594)
* Simplify `isDeviceVerified` definitions

Currently, we have two similar but different definitions of `isDeviceVerified`,
and they both do a lot of wrangling that relies on js-sdk internals. We can
simplify it a lot by just calling `MatrixClientPeg.checkDeviceTrust`.

* fix tests

* more test fixes
2023-04-14 09:46:37 +00:00
Kerry 81a4498a8f
Apply `strictNullChecks` to `src/utils/*!exportUtils` (#10455
* Apply `strictNullChecks` to `src/utils/exportUtils`

* strict fix

* fix strictNullChecks issues in some utils

* fix error message

* test coverage

* lint

* more strictNullChecks

* small optimisation for getUniqueRoomsWithIndividuals

* tidy

* test coverage
2023-04-03 09:26:55 +01:00
Kerry 6f1a3af895
Properly generate mentions when editing a reply with MSC3952 (#10486)
* remove redundant feature_intentional_mentions settings check

* tests

* pass replytoevent to attachmmentions in editmessagecomposer

* lint

* strict fix
2023-04-02 21:32:12 +00:00
Eric Eastwood e5f06df3f7
Better error handling in jump to date (#10405)
- Friendly error messages with details
 - Add a way to submit debug logs for actual errors (non-networking errors)
 - Don't jump someone back to a room they already navigated away from. Fixes bug mentioned in https://github.com/vector-im/element-web/issues/21263#issuecomment-1056809714
2023-03-24 14:39:24 -05:00
Patrick Cloke 5c47142dab
Prep for matrix-js-sdk supporting intentional mentions. (#10431)
Add a method to the fake MatrixClient used in tests for compatibility with
changes in matrix-org/matrix-js-sdk#3092. This stops the downstream tests
from failing on that PR.
2023-03-22 16:22:19 -04:00
Michael Weimann 3eb6a55b93
Tweak pill UI (#10417) 2023-03-22 13:27:24 +01:00
Dominik Henneke ef68650594
Implement MSC3973: Search users in the user directory with the Widget API (#10269)
* Add an action to search for users in the user directory according to MSC3973

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

* Fix linter errors

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

* Update the matrix-widget-api package to version 1.3.0

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

* Improve the test

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

---------

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
2023-03-21 11:38:41 +00:00
Michael Weimann 96d1b74ffc
Pillify event permalinks (#10392) 2023-03-21 10:23:20 +01:00
Michael Weimann a86a8e7f8e
Pillify permalinks to rooms and users (#10388) 2023-03-16 15:01:09 +01:00
Michael Telatynski e3930fb8b0
Show all labs even if incompatible, with appropriate tooltip explaining requirements (#10369)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-03-15 08:37:41 +00:00
Michael Weimann ad26925bb6
Refactor pill and add tests (#10304) 2023-03-08 13:06:50 +01:00
Michael Telatynski 667ec166d7
Remove Enzyme tests in favour of React testing-library (#10289) 2023-03-06 12:13:17 +00:00
Michael Telatynski ad8d27d2b2
Fix some features not being configurable via `features` (#10276) 2023-03-03 13:31:51 +00:00
Michael Weimann ffa047be68
Find DMs with pending third-paty invites (#10256) 2023-03-02 09:44:12 +01:00
Michael Telatyński f40d15388c
Update tests to prefer RTL over Enzyme (#10247
* Update tests to prefer RTL over Enzyme

* Strict types
2023-02-28 08:58:23 +00:00
Kerry f57495d3cd
Poll history: detail screen (#10172)
* basic navigation to focused poll

* add tooltip

* drill permalinkCreator down to poll history

* render poll tile and link to timeline

* tidy and lint

* unit test poll detail

* add view poll link to ended pollliste item

* strict fix

* pr improvements

* pass room as prop

* permalinkcreator ts assertion
2023-02-27 20:39:55 +00:00
Michael Weimann 880428ab94
Update „new device“ toast texts and buttons (#10200) 2023-02-23 10:25:33 +01:00
Michael Weimann eb6278df1d
Do not prompt for a password when doing a „reset all“ after login (#10208) 2023-02-23 08:46:49 +01:00
Kerry a06163ee98
Poll history - ended polls list items (#10119)
* wip

* remove dupe

* use poll model relations in all cases

* update mpollbody tests to use poll instance

* update poll fetching login in pinned messages card

* add pinned polls to room polls state

* add spinner while relations are still loading

* handle no poll in end poll dialog

* strict errors

* render a poll body that errors for poll end events

* add fetching logic to pollend tile

* extract poll testing utilities

* test mpollend

* strict fix

* more strict fix

* strict fix for forwardref

* add filter component

* update poll test utils

* add unstyled filter tab group

* filtertabgroup snapshot

* lint

* update test util setupRoomWithPollEvents to allow testing multiple polls in one room

* style filter tabs

* test error message for past polls

* sort polls list by latest

* extract poll option display components from pollbody

* add ended poll list item component

* use named export for polllistitem

* test POllListItemEnded

* comments

* strict fixes

* extract poll option display components

* strict fixes

* strict
2023-02-20 18:19:50 +00:00
Germain 8c22584f64
Remove threads labs flag and the ability to disable threads (#9878) 2023-02-20 14:46:07 +00:00
Michael Telatynski 4574c665ea
Conform more code to strict null checking (#10167)
* Conform more code to strict null checking

* Delint

* Iterate PR based on feedback
2023-02-16 17:21:44 +00:00
Michael Weimann 8feed1a225
Try to resolve emails before creating a DM (#10164) 2023-02-16 14:17:43 +01:00