Commit Graph

1364 Commits (4de315fb6c8842d8b3d4bc3d3d022ada10846f7c)

Author SHA1 Message Date
Michael Telatynski 4de315fb6c
Use Intl for names of languages (#11427)
* Use Intl for names of languages

* Tweak Intl language style from "American English" -> "US English"

* Update tests

* Fix tests

* Consolidate languageHandler-test files

* Improve coverage

* Consistent casing for languages in dropdown

* Update LanguageDropdown.tsx

* Delint & update snapshot

* Fix tests

* Improve coverage

`of` will fallback to the given code with fallback=code (default)
2023-08-22 14:07:16 +00:00
Kerry 3684c77cfe
Hide account deactivation for externally managed accounts (#11445)
* util for account url

* test cases

* disable multi session selection on device list

* remove sign out all from context menus when oidc-aware

* comment

* remove unused param

* typo

* dont show account deactivation for externally managed accounts

* Update snapshots - field ID changed

---------

Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
2023-08-22 11:51:16 +00:00
Kerry 23196d49e1
OIDC: Redirect to delegated auth provider when signing out (#11432)
* util for account url

* test cases

* disable multi session selection on device list

* remove sign out all from context menus when oidc-aware

* comment

* remove unused param

* redirect to auth provider when signing out

* open auth provider in new tab, refresh sessions on return

* correct comment

* fix bad copy paste

* try to make sonar happy

* Update for latest revision of MSCs

* Update SessionManagerTab-test.tsx

* Make InteractiveAuthCallback async and await it

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@matrix.org>
Co-authored-by: Hugh Nimmo-Smith <hughns@users.noreply.github.com>
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
2023-08-22 11:15:35 +00:00
Kerry 5c1b62cf99
Disable 3pid fields in settings when `m.3pid_changes` capability is disabled (#11430)
* check m.3pid_changes capability in user settings

* comments

* assume 3pid_changes is true for older evrsions
2023-08-22 06:07:10 +00:00
Kerry dfded8d4d3
OIDC: disable multi session signout for OIDC-aware servers in session manager (#11431)
* util for account url

* test cases

* disable multi session selection on device list

* remove sign out all from context menus when oidc-aware

* comment

* remove unused param

* typo
2023-08-22 02:25:34 +00:00
Michael Telatynski 3c52ba0c92
Use Intl to localise dates and times (#11422)
* Use Intl to generate better internationalised date formats

* Get `Yesterday` and `Today` from Intl also

* Correct capitalisation blunder

* Fix formatTime include weekday

* Iterate

* Fix tests

* use jest setSystemTime

* Discard changes to cypress/e2e/settings/general-user-settings-tab.spec.ts

* Discard changes to res/css/_components.pcss

* Discard changes to res/css/views/elements/_LanguageDropdown.pcss

* Discard changes to src/components/views/elements/LanguageDropdown.tsx

* Add docs & tests for getDaysArray & getMonthsArray

* Discard changes to test/components/structures/__snapshots__/MatrixChat-test.tsx.snap

* Consolidate consts

* Improve testing & documentation

* Update snapshot

* Apply suggestions from code review

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

* Iterate

* Clarify comments

* Update src/DateUtils.ts

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

* Specify hourCycle

* Discard changes to test/components/views/settings/devices/DeviceDetails-test.tsx

* Update comments

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-08-21 19:38:59 +00:00
Michael Telatynski dd6097c568
Polish & delabs `Exploring public spaces` feature (#11423)
* Iterate search public spaces UX

* Tweak iconography in spotlight

* Delabs `Exploring public spaces`

* Tweak msc3827 v1.4 support discovery

* i18n

* Delete stale test

* Fix tests

* Iterate

* Iterate PR based on review

* Improve types

* Add shortcut to search for public spaces to create space menu

* Update import

* Add org.matrix.msc3827.stable filtering

* Fix tests

* silence some errors
2023-08-21 09:39:20 +00:00
Michael Telatynski d81f71f993
Load SAS Emoji translations from `@matrix-org/spec` (#11429)
* Remove last instance of componentWillMount

* Load SAS Emoji translations from @matrix-org/spec

* Fix import

* Test normalisation on both sides

* update comment for @richvdh

* Delint
2023-08-21 08:15:22 +00:00
Richard van der Hoff 4a5b686aaa
Update MatrixChat-test to `restoreAllMocks` after each test (#11424)
* Update MatrixChat to  `restoreAllMocks` after each test

This helps keep tests independent.

* more MatrixChat fixes
2023-08-17 19:06:45 +00:00
Richard van der Hoff 523e691136
MatrixChat-test: stop mocking localStorage (#11419)
We have a perfectly good localStorage impl; no need to do a half-arsed mock of
it.
2023-08-16 16:28:46 +00:00
Michael Telatynski 6b14ecfdf9
Re-key all |zero-pluralised translations for Localazy compatibility (#11417)
* Re-key all |zero-pluralised translations for Localazy compatibility

* Add missing interpolation variable

* i18n

* Add test coverage

* Improve coverage
2023-08-16 15:26:21 +00:00
Richard van der Hoff 7a6d81c3b8
Update Jest to more recent release (#11409)
* Update Jest to more recent release

I want to use things like `jest.advanceTimersByTimeAsync`

* more jest updates

* add dep on types/prettier

* fix LegacyRoomHeader-test

* fix MatrixChat-test

* fix RoomView-test

* fix PollHistory-test

* update SidebarUserSettingsTab-test

* fix PipContainer-test

* fix UserOnboardingPage-test

* fix WidgetContextMenu-test.tsx

* Avoid `mockImplementation` for mock `matchMedia` impl

`mockImplementation` is (now) reset by `jest.resetAllMocks` and
`jest.restoreAllMocks`, which we don't really want here.

Fixes `theme-test`

* Move `mediaDevices` mock out of `setupManualMocks`

This doesn't work well in test suites with multiple tests, because the
`mockReturnValue` is reset for subsequent tests.

In any case, having it mocked out automagically is *magical*. Let's make it
opt-in.

* fix FormattingButtons-test.tsx

* fix DeviceListenerTest

* fix RoomTile-test
2023-08-16 10:20:48 +00:00
Richard van der Hoff 3fda0299a5
Move `mediaDevices` mock out of `setupManualMocks` (#11413)
* Move `mediaDevices` mock out of `setupManualMocks`

This doesn't work well in test suites with multiple tests, because the
`mockReturnValue` is reset for subsequent tests.

In any case, having it mocked out automagically is *magical*. Let's make it
opt-in.

* clarify ts-ignore
2023-08-16 08:29:34 +00:00
Charly Nguyen d569ba0cfe
Allow managing room knocks (#11404)
* Allow managing room knocks

Signed-off-by: Charly Nguyen <charly.nguyen@nordeck.net>

* Apply PR feedback

Signed-off-by: Charly Nguyen <charly.nguyen@nordeck.net>

* Apply Sonar feedback

Signed-off-by: Charly Nguyen <charly.nguyen@nordeck.net>

---------

Signed-off-by: Charly Nguyen <charly.nguyen@nordeck.net>
2023-08-16 08:16:19 +00:00
Michael Telatynski ad73b0c16e
Switch to importing most things from the main matrix-js-sdk export (#11406)
* Switch to importing most things from the main matrix-js-sdk export

* fix imports

* Iterate

* Fix tests
2023-08-15 15:00:17 +00:00
Michael Telatynski 0842559fb2
Simplify registration with email validation (#11398) 2023-08-15 16:14:53 +01:00
Richard van der Hoff 672ad98ec7
Clean up the MatrixChat initSession code (#11403)
`async` functions are a thing, and they make this much more comprehensible.
2023-08-14 12:52:08 +00:00
Neeraj Vageele 6f455217d1
correct home server URL (#11391)
* correct home server URL

* update snapshot

---------

Co-authored-by: Neeraj <neerajv@thirdrocktechkno.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-08-14 09:08:34 +00:00
Michael Telatynski d2c6577024
Switch to importing more things from the main js-sdk export (#11394) 2023-08-14 08:58:55 +00:00
Travis Ralston 180fcaa70f
Support Matrix 1.1 (drop legacy r0 versions) (#9819)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-08-14 09:25:13 +01:00
Milton Moura d240f06810
Include non-matching DMs in Spotlight recent conversations when the DM's userId is part of the search API results (#11374)
* This addresses two issues:

     1. Include non-matching DMs in Spotlight suggestions if the userId of the DM is included in the user directory search results
     2. The user directory search results order is kept when there is no relevant activity between users, instead of sorting by MXID

* Applying feedback from PR:
1. Updated comments
2. Renamed users to userDirectorySearchResults
3. Makes sure linter is happy
2023-08-10 17:27:24 +00:00
Michael Telatynski ef385e6028
Switch to importing more things from the main js-sdk export (#11377) 2023-08-10 08:01:14 +00:00
Michael Telatynski a1328d8ef7
Switch to importing more things from the main js-sdk export (#11376) 2023-08-09 15:10:54 +00:00
Michael Telatynski 57a0d99dc8
Improve randomString mock for better snapshots (#11375) 2023-08-09 09:39:48 +01:00
Michael Telatynski c3574c2050
Switch to importing client from main js-sdk export (#11370) 2023-08-09 07:18:41 +00:00
Kerry e0d498e338
Enable `jsx-a11y/click-events-have-key-events` eslint rule (#10362)
* enable "jsx-a11y/alt-text" lint rule

* enable "jsx-a11y/label-has-associated-control"

* make Spoilers keyboard accessible

* make invite reason keyboard accessible

* make invite suggestions keyboard accessible

* make avatar upload in space basic settings keyboard accessible

* ignore jsx-a11y/click-events-have-key-events issues in tests

* Update test expectation

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-08-09 06:27:31 +00:00
Michael Telatynski 2b17fc3221
Show error when searching public rooms fails (#11378)
* Show error when searching public rooms fails

* Fix types

* Improve test coverage

* Improve coverage
2023-08-08 14:08:17 +00:00
Michael Telatynski 033c600fa2
Switch to importing @types/{event,partials} from main js-sdk export (#11369) 2023-08-08 10:12:12 +00:00
Michael Telatynski 368b6b9355
Switch to importing models/{event-timeline{,set},user,device,event-status} from main js-sdk export (#11368) 2023-08-08 07:16:04 +00:00
Michael Telatynski 24703eea8f
Switch to importing models/event from main js-sdk export (#11363) 2023-08-07 08:24:58 +00:00
Charly Nguyen 5152aad059
Allow knocking rooms (#11353)
Signed-off-by: Charly Nguyen <charly.nguyen@nordeck.net>
2023-08-07 06:27:09 +00:00
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
Peter Scheu 5ee8e61bf5
Search for users on paste (#11304)
Signed-off-by: Peter Scheu <peter.scheu@aceart.de>
2023-08-04 07:19:56 +00:00
Travis Ralston 771d7e95e7
Support adding space-restricted joins on rooms not members of those spaces (#9017)
* Support adding space-restricted joins on rooms not members of those spaces

* add react dependencies

* Add snapshot test

* Fix snapshot stability

* Update snapshot

* Increase coverage

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-08-03 15:56:53 +00:00
Michael Telatynski 47877ba2da
Switch to importing matrix-js-sdk from its main export (#11360)
* 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

* Fix cypress-axe import

* Fix cypress-axe import
2023-08-03 12:56:30 +00:00
Michael Telatynski 755f8d7ab0
Fix AppTile context menu not always showing up when it has options (#11358)
* Fix AppTile context menu not always showing up when it has options

* Comment

* Update snapshots
2023-08-03 09:23:20 +00:00
Germain d94808a197
Make room model mandatory on the RoomHeader (#11355)
* Remove oobData from RoomHeader

It is never used as the RoomHeader is not shown unless a Room model exists

* Make room model mandatory on the RoomHeader
2023-08-02 15:29:19 +00:00
Germain d49581344e
Integrate @vector-im/compound-web (#11354)
* Create useRoomName hook

Mark RoomName component as deprecated

* Pass out-of-band data to relevant RoomHeader component

* Mark LegacyRoomHeader as deprecated

* Fix incorrect search&replace in _RoomHeader.pcss

* lintfix

* Mark room as optional in room topic hook

* Fix i18n

* Discard use of useCallback

* Change export of useRoomName

* fix ts issue

* lints

* Add room topic to room header

* lintfix

* lintfix & clamp to one line

* Revert optimisations to DecoratedRoomAvatar

* Add test for opening the room summary

* Make transition honour prefer-reduced-motion

* Integrate @vector-im/compound-web

* Use compound type styles

* Use latest version of @vector-im/compound-web

* Change component name

* Fallback when room is undefined

* fix snapshot
2023-08-02 13:03:04 +00:00
Germain 33299af5c9
Add room topic and animation (#11352)
* Create useRoomName hook

Mark RoomName component as deprecated

* Pass out-of-band data to relevant RoomHeader component

* Mark LegacyRoomHeader as deprecated

* Fix incorrect search&replace in _RoomHeader.pcss

* lintfix

* Mark room as optional in room topic hook

* Fix i18n

* Discard use of useCallback

* Change export of useRoomName

* fix ts issue

* lints

* Add room topic to room header

* lintfix

* lintfix & clamp to one line

* Revert optimisations to DecoratedRoomAvatar

* Add test for opening the room summary

* Make transition honour prefer-reduced-motion

* Fallback when room is undefined

* fix snapshot
2023-08-02 10:54:06 +00:00
Michael Telatynski 2f2067e434
Fix home/all rooms context menu in space panel (#11350)
* Fix home/all rooms context menu in space panel

* Fix tests
2023-08-01 15:26:14 +00:00
Germain 5d9f5ccf0b
Create useRoomName hook (#11346)
* Create useRoomName hook

Mark RoomName component as deprecated

* Pass out-of-band data to relevant RoomHeader component

* Mark LegacyRoomHeader as deprecated

* Fix incorrect search&replace in _RoomHeader.pcss

* lintfix

* Fix i18n

* Discard use of useCallback

* Change export of useRoomName

* fix ts issue

* lints
2023-08-01 13:47:09 +00:00
Michael Telatynski 340e301844
Make keyboard handling in and out of autocomplete completions consistent (#11344)
* Make keyboard handling in and out of autocomplete completions consistent

* Add test
2023-08-01 09:06:37 +00:00
Germain 6ae7c033d5
Add feature flag 'feature_new_room_decoration_ui' and segrate legacy UI component (#11345)
* Move RoomHeader to LegacyRoomHeader

* Create new RoomHeader component
2023-08-01 07:32:53 +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
Kerry 5636a9f7ca
Unit test logout action in MatrixChat (#11303)
* test logout action in MatrixChat

* add restore all mocks
2023-07-28 02:25:18 +00:00
Richard van der Hoff f6fc5cad5c
Remove display of key backup signatures from backup settings (#11333)
* Remove display of Key backup signatures

This is *fiddly* to support in Element-R, and we don't really think it's
offering any value.

* update snapshot

* clean up i18n
2023-07-27 19:52:02 +00:00
renovate[bot] 5405c22db1
Update all non-major dependencies (#11329)
* Update all non-major dependencies

* Add isLocation to ComposerEvent analytics events

* Remove cypress-each as it is incompatible with modern typescript

* Roll back eslint-plugin-deprecate

* Remove stale comment

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-07-27 11:34:44 +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
Michael Telatynski 3ab0757604
Fix edge case with sent indicator being drawn when it shouldn't be (#11320)
* Fix edge case with sent indicator being drawn when it shouldn't be

* Comment
2023-07-27 07:41:36 +00:00