Commit graph

46 commits

Author SHA1 Message Date
Michael Telatynski
cf1b592f26
Update overly sensitive snapshot (#9421)
* Update snapshot

* Fix tests by adding missing stub
2022-10-14 15:57:12 +01:00
Germain
970d1912e5
Add mock for canSupport (#9414)
* Add mock for canSupport

* dead code
2022-10-13 18:22:25 +01:00
Michael Telatynski
8b54be6f48
Move from browser-request to fetch (#9345) 2022-10-12 18:59:07 +01:00
Šimon Brandner
6b1ee13c28
Always allow enabling sending read receipts (#9367)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-10-07 15:10:18 +02:00
David Baker
07a5a1dc6f
Fix device selection in pre-join screen for Element Call video rooms (#9321)
* Fix device selection in pre-join screen for Element Call video rooms

As per https://github.com/vector-im/element-call/pull/609

* Update unit test

* Lint

* Hold a media stream while we enumerate device so we can do so reliably.

This means we can remove the device fallback labels.

* i18n

* Remove unnecessary useState

* Fix fetching video devices when video muted

* Actually fix preview stream code

* Fix unit test now fallback is no longer a thing

* Test changing devices
2022-09-30 17:28:53 +01:00
Michael Weimann
d775e403c4
Add voice broadcast recording stores (#9319)
* Add voice broadcast recording stores

* Refactor startNewVoiceBroadcastRecording
2022-09-28 10:22:50 +02:00
Germain
641cf28e4c
Implement push notification toggle in device detail (#9308)
Co-authored-by: Travis Ralston <travisr@matrix.org>
2022-09-27 13:35:54 +01:00
Michael Telatynski
56c95467de
Don't show feedback prompts when that UIFeature is disabled (#9305) 2022-09-22 15:08:14 +01:00
Michael Weimann
c182c1c706
Generalise VoiceRecording (#9304) 2022-09-21 18:46:28 +02:00
kegsay
06c4ba32cd
Store refactor: make it easier to test stores (#9290)
* refactor: convert RoomViewStore from flux Store to standard EventEmitter

Parts of a series of experimental changes to improve the design of stores.

* Use a gen5 store for RoomViewStore for now due to lock handling

* Revert "Use a gen5 store for RoomViewStore for now due to lock handling"

This reverts commit 1076af071d997d87b8ae0b0dcddfd1ae428665af.

* Add untilEmission and tweak untilDispatch; use it in RoomViewStore

* Add more RVS tests; remove custom room ID listener code and use EventEmitter

* Better comments

* Null guard `dis` as tests mock out `defaultDispatcher`

* Additional tests
2022-09-20 15:32:39 +00:00
Robin
cb735c9439
Element Call video rooms (#9267)
* Add an element_call_url config option

* Add a labs flag for Element Call video rooms

* Add Element Call as another video rooms backend

* Consolidate event power level defaults

* Remember to clean up participantsExpirationTimer

* Fix a code smell

* Test the clean method

* Fix some strict mode errors

* Test that clean still works when there are no state events

* Test auto-approval of Element Call widget capabilities

* Deduplicate some code to placate SonarCloud

* Fix more strict mode errors

* Test that calls disconnect when leaving the room

* Test the get methods of JitsiCall and ElementCall more

* Test Call.ts even more

* Test creation of Element video rooms

* Test that createRoom works for non-video-rooms

* Test Call's get method rather than the methods of derived classes

* Ensure that the clean method is able to preserve devices

* Remove duplicate clean method

* Fix lints

* Fix some strict mode errors in RoomPreviewCard

* Test RoomPreviewCard changes

* Quick and dirty hotfix for the community testing session

* Revert "Quick and dirty hotfix for the community testing session"

This reverts commit 37056514fbc040aaf1bff2539da770a1c8ba72a2.

* Fix the event schema for org.matrix.msc3401.call.member devices

* Remove org.matrix.call_duplicate_session from Element Call capabilities

It's no longer used by Element Call when running as a widget.

* Replace element_call_url with a map

* Make PiPs work for virtual widgets

* Auto-approve room timeline capability

Because Element Call uses this now

* Create a reusable isVideoRoom util
2022-09-16 11:12:27 -04:00
Robin
0d6a550c33
Prepare for Element Call integration (#9224)
* Improve accessibility and testability of Tooltip

Adding a role to Tooltip was motivated by React Testing Library's
reliance on accessibility-related attributes to locate elements.

* Make the ReadyWatchingStore constructor safer

The ReadyWatchingStore constructor previously had a chance to
immediately call onReady, which was dangerous because it was potentially
calling the derived class's onReady at a point when the derived class
hadn't even finished construction yet. In normal usage, I guess this
never was a problem, but it was causing some of the tests I was writing
to crash. This is solved by separating out the onReady call into a start
method.

* Rename 1:1 call components to 'LegacyCall'

to reflect the fact that they're slated for removal, and to not clash
with the new Call code.

* Refactor VideoChannelStore into Call and CallStore

Call is an abstract class that currently only has a Jitsi
implementation, but this will make it easy to later add an Element Call
implementation.

* Remove WidgetReady, ClientReady, and ForceHangupCall hacks

These are no longer used by the new Jitsi call implementation, and can
be removed.

* yarn i18n

* Delete call map entries instead of inserting nulls

* Allow multiple active calls and consolidate call listeners

* Fix a race condition when creating a video room

* Un-hardcode the media device fallback labels

* Apply misc code review fixes

* yarn i18n

* Disconnect from calls more politely on logout

* Fix some strict mode errors

* Fix another updateRoom race condition
2022-08-30 15:13:39 -04:00
Robin
28ed87bffe
Implement MSC3846: Allowing widgets to access TURN servers (#9061)
* Implement MSC3819: Allowing widgets to send/receive to-device messages

* Don't change the room events and state events drivers

* Implement MSC3846: Allowing widgets to access TURN servers

* Update to latest matrix-widget-api changes

* Support sending encrypted to-device messages

* Yield a TURN server immediately

* Use queueToDevice for better reliability

* Update types for latest WidgetDriver changes

* Upgrade matrix-widget-api

* Add tests

* Test StopGapWidget

* Fix a potential memory leak

* Add tests

* Empty commit to retry CI
2022-08-10 13:26:42 +00:00
Robin
103b60dfb5
Implement MSC3819: Allowing widgets to send/receive to-device messages (#8885)
* Implement MSC3819: Allowing widgets to send/receive to-device messages

* Don't change the room events and state events drivers

* Update to latest matrix-widget-api changes

* Support sending encrypted to-device messages

* Use queueToDevice for better reliability

* Update types for latest WidgetDriver changes

* Upgrade matrix-widget-api

* Add tests

* Test StopGapWidget

* Fix a potential memory leak
2022-08-10 08:57:56 -04:00
Šimon Brandner
7eaed1a3f8
Add option to stop sending read receipts (delabs MSC2285: private read receipts) (#8629)
Co-authored-by: Travis Ralston <travisr@matrix.org>
2022-08-05 17:33:57 +02:00
Šimon Brandner
6a8dd23d29
Add support for EventTarget to useEventEmitter() (#9060) 2022-07-29 11:32:03 +02:00
Michael Weimann
fa1bff67cf
Wire local room logic (#9078)
* Wire local room logic

* Migrate to testling-lib; update test descriptions
2022-07-20 09:26:25 +02:00
Michael Weimann
742b21ca46
Extract ValidatedServerConfig (#9054) 2022-07-14 15:03:34 +02:00
Michael Weimann
3be20cf434
Use doMaybeLocalRoomAction (#9038)
* Use doMaybeLocalRoomAction

* Revert unnecessary changes
2022-07-13 07:56:36 +02:00
Michael Telatynski
d81e2cea14
Remove unused sessionStorage layer (#8834)
* Remove unused sessionStorage layer

* Update global.d.ts

* Fix tests
2022-06-14 21:29:24 +01:00
Robin
53340db5e9
Update the live timeline when the JS SDK resets it (#8806) 2022-06-10 08:59:07 -04:00
Johannes Marbach
abd39c61b1
Add support for MD / HTML in room topics (#8215)
* Add support for MD / HTML in room topics

Setting MD / HTML supported:
- /topic command
- Room settings overlay
- Space settings overlay

Display of MD / HTML supported:
- /topic command
- Room header
- Space home

Based on extensible events as defined in [MSC1767]

Fixes: vector-im/element-web#5180
Signed-off-by: Johannes Marbach <johannesm@element.io>

[MSC1767]: matrix-org/matrix-spec-proposals#1767

* Fix build error

* Add comment to explain origin of styles

Co-authored-by: Travis Ralston <travpc@gmail.com>

* Empty commit to retrigger build

* Fix import grouping

* Fix useTopic test

* Add tests for HtmlUtils

* Add slash command test

* Add further serialize test

* Fix ternary formatting

Co-authored-by: Travis Ralston <travpc@gmail.com>

* Add blank line

Co-authored-by: Travis Ralston <travpc@gmail.com>

* Properly mock SettingsStore access

* Remove trailing space

* Assert on HTML content and add test for plain text in HTML parameter

* Appease the linter

* Fix JSDoc comment

* Fix toEqual call formatting

* Repurpose test for literal HTML case

* Empty commit to fix CI

Co-authored-by: Travis Ralston <travpc@gmail.com>
Co-authored-by: Travis Ralston <travisr@matrix.org>
2022-06-07 14:20:32 -06:00
Robin
ceda77d7dc
Proactively fix stuck devices in video rooms (#8587)
* Proactively fix stuck devices in video rooms

* Fix tests

* Explain why we're disabling the lint rule

* Apply code review suggestions

* Back VideoChannelStore's flags by SettingsStore instead of localStorage
2022-05-16 16:54:08 -04:00
Kerry
2c19d286ed
Eslint - require copyright header rule (#8514)
* bump eslint plugin to 0.5.2

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add rule

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add missing copyright headers

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix comment order

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-05-06 09:09:28 +00:00
Michael Telatynski
f29ef04751
Fix race conditions around threads (#8448) 2022-05-03 14:25:08 +01:00
Robin
c83ad1faa7
Add local echo of connected devices in video rooms (#8368) 2022-04-21 07:41:38 -04:00
Michael Telatynski
8cd715c6a3
Prevent soft crash around room list header context menu when space changes (#8289) 2022-04-12 14:23:04 +00:00
Robin
5fbb25c707
Make Jitsi widgets in video rooms immutable (#8244)
* Make Jitsi widgets in video rooms immutable

* Test video room creation
2022-04-07 07:34:07 -04:00
Robin
371ccd7858
Don't use m.call for Jitsi video rooms (#8223) 2022-04-04 10:29:40 -04:00
Robin
8baf06c3ff
Show voice room participants when not connected (#8136)
* Add utility for getting connected voice participants

* Allow voice room members to send connected device state

* Update connected devices when connecting/disconnecting voice

* Show voice room participants in room tile when not connected

* Update voice room tests

* Add null types and guards
2022-03-28 14:12:09 +01:00
Robin
1e060fed84
Don't form continuations from thread roots (#8166)
* Don't form continuations from thread roots

* Only apply the continuation break in the main timeline
2022-03-26 18:06:25 -04:00
Travis Ralston
fce36ec826
Delete groups (legacy communities system) (#8027)
* Remove deprecated feature_communities_v2_prototypes

* Update _components

* i18n

* delint

* Cut out a bit more dead code

* Carve into legacy components

* Carve into mostly the room list code

* Carve into instances of "groupId"

* Carve out more of what comes up with "groups"

* Carve out some settings

* ignore related groups state

* Remove instances of spacesEnabled

* Fix some obvious issues

* Remove now-unused css

* Fix variable naming for legacy components

* Update i18n

* Misc cleanup from manual review

* Update snapshot for changed flag

* Appease linters

* rethemedex

* Remove now-unused AddressPickerDialog

* Make ConfirmUserActionDialog's member a required prop

* Remove useless override from RightPanelStore

* Remove extraneous CSS

* Update i18n

* Demo: "Communities are now Spaces" landing page

* Restore linkify for group IDs

* Demo: Dialog on click for communities->spaces notice

* i18n for demos

* i18n post-merge

* Update copy

* Appease the linter

* Post-merge cleanup

* Re-add spaces_learn_more_url to the new SdkConfig place

* Round 1 of post-merge fixes

* i18n

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-03-22 23:07:37 +00:00
Robin
cfabcdda35
Voice rooms prototype (#8084)
* Add voice room labs flag

Signed-off-by: Robin Townsend <robin@robin.town>

* Add more widget actions for interacting with Jitsi

Signed-off-by: Robin Townsend <robin@robin.town>

* Factor out a more generic Jitsi creation utility

Signed-off-by: Robin Townsend <robin@robin.town>

* Add utilities for managing voice channels

Signed-off-by: Robin Townsend <robin@robin.town>

* Enable creation of voice rooms

Signed-off-by: Robin Townsend <robin@robin.town>

* Force a maximized view of voice channel widgets

Signed-off-by: Robin Townsend <robin@robin.town>

* Add voice channel store

Signed-off-by: Robin Townsend <robin@robin.town>

* Factor out a more generic FacePile

Signed-off-by: Robin Townsend <robin@robin.town>

* Implement room tile changes for voice rooms

Signed-off-by: Robin Townsend <robin@robin.town>

* Add interactive radio component to the left panel

Signed-off-by: Robin Townsend <robin@robin.town>

* Test voice rooms

Signed-off-by: Robin Townsend <robin@robin.town>

* Update name of call room type

Signed-off-by: Robin Townsend <robin@robin.town>

* Clarify that voice rooms are under development

Signed-off-by: Robin Townsend <robin@robin.town>

* Use readonly

Signed-off-by: Robin Townsend <robin@robin.town>

* Move acks to the end of handlers

Signed-off-by: Robin Townsend <robin@robin.town>

* Add comment about avatar URLs coming from Jitsi

Signed-off-by: Robin Townsend <robin@robin.town>

* Don't use unicode ellipses

for translation reasons?

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix tests

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix tests, again

Signed-off-by: Robin Townsend <robin@robin.town>

* Remove unnecessary export

Signed-off-by: Robin Townsend <robin@robin.town>

* Ack Jitsi events when we wait for them

Signed-off-by: Robin Townsend <robin@robin.town>
2022-03-22 16:14:11 -06:00
Kerry
026ca1ab64
Fix tsc issues in right_panel and room component tests (#8078)
* fix ts issues in SendMessageComposer-test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove empty file

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix tsc issues in MessageComposerbUttons-test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix the rest

Signed-off-by: Kerry Archibald <kerrya@element.io>

* bad autoformatter

Signed-off-by: Kerry Archibald <kerrya@element.io>

* tsc fixes for test/components/views/right_panel

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-21 10:03:03 +01:00
Kerry
df6c53ff41
include /test/stores in tsconfig (#8026)
* fix space store emits

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix spacestore-test imports

* fix export-test.tsx

Signed-off-by: Kerry Archibald <kerrya@element.io>

* include test/utils to tsconfig

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix types in SpaceStore-test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix ts issues in rest of test/stores

Signed-off-by: Kerry Archibald <kerrya@element.io>

* include test/stores in tsconfig

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-11 17:03:33 +01:00
Kerry
2ab8b46ba3
include test/test-utils in tsconfig (#8000)
* move js utils into directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* typescripterize js test-utils

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move test utils to directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move remaining mock functions to directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update imports

Signed-off-by: Kerry Archibald <kerrya@element.io>

* missed copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* type wait for update

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add tests/test-utils to tsconfig

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix wrapper type

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-09 14:23:58 +01:00
Robin
77ed1e3ef8
More pinned messages tests (#7988)
* Test basic pinned message functionality

Signed-off-by: Robin Townsend <robin@robin.town>

* Test pinned polls

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix test

Signed-off-by: Robin Townsend <robin@robin.town>
2022-03-04 18:15:03 -05:00
Michael Telatynski
0e60ad98c1
Hide composer and call buttons when the room is tombstoned (#7975) 2022-03-04 15:53:22 +00:00
Michael Telatynski
15cbc6c26c
Fix wrongly asserting that PushRule::conditions is non-null (#7973) 2022-03-04 09:39:16 +00:00
Michael Telatynski
afbe3d16b4
Fix account & room settings race condition (#7953) 2022-03-03 22:09:06 +00:00
Robin
8a7ffb4f90
Test that pinned messages reflect edits correctly (#7960)
* Hide unpinnable pinned messages in more cases

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix typo

Signed-off-by: Robin Townsend <robin@robin.town>

* Test that unpinnable pinned messages get hidden

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix cli.relations error in test

Signed-off-by: Robin Townsend <robin@robin.town>

* Use event: true shortcut when calling mkEvent

Signed-off-by: Robin Townsend <robin@robin.town>

* Use mockResolvedValue instead of mockReturnValue for async mock

Signed-off-by: Robin Townsend <robin@robin.town>

* Actually mock redacted messages correctly

Signed-off-by: Robin Townsend <robin@robin.town>

* Ensure that panel is updated before assertions are made

Signed-off-by: Robin Townsend <robin@robin.town>

* Test that pinned messages reflect edits correctly

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix warning about missing date

Signed-off-by: Robin Townsend <robin@robin.town>

* Move calls to update out of act

They don't need to be there.

Signed-off-by: Robin Townsend <robin@robin.town>

* Move calls to update out of act

They don't need to be there.

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix lint

Signed-off-by: Robin Townsend <robin@robin.town>
2022-03-03 12:20:13 -05:00
Robin
f9ad2a5151
Hide unpinnable pinned messages in more cases (#7921)
* Hide unpinnable pinned messages in more cases

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix typo

Signed-off-by: Robin Townsend <robin@robin.town>

* Test that unpinnable pinned messages get hidden

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix cli.relations error in test

Signed-off-by: Robin Townsend <robin@robin.town>

* Use event: true shortcut when calling mkEvent

Signed-off-by: Robin Townsend <robin@robin.town>

* Use mockResolvedValue instead of mockReturnValue for async mock

Signed-off-by: Robin Townsend <robin@robin.town>

* Actually mock redacted messages correctly

Signed-off-by: Robin Townsend <robin@robin.town>

* Ensure that panel is updated before assertions are made

Signed-off-by: Robin Townsend <robin@robin.town>

* Move calls to update out of act

They don't need to be there.

Signed-off-by: Robin Townsend <robin@robin.town>
2022-03-03 07:54:44 -05:00
Michael Telatynski
f25e6813bb
Mandate use of js-sdk/src/matrix import over js-sdk/src (#7933) 2022-03-01 20:42:05 +00:00
Michael Telatynski
08c47ac473
Fix changing space sometimes bouncing to the wrong space (#7910) 2022-03-01 08:33:29 +00:00
Kerry
1830de2733
Thread test utilities (#7881)
* move js utils into directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* typescripterize js test-utils

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move test utils to directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move remaining mock functions to directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update imports

Signed-off-by: Kerry Archibald <kerrya@element.io>

* missed copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* threads test helpers

Signed-off-by: Kerry Archibald <kerrya@element.io>

* forgotten copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* comments

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add unsigned to root event

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-23 17:12:48 +01:00
Kerry
5e76d988ca
convert test-utils to typescript (#7877)
* move js utils into directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* typescripterize js test-utils

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move test utils to directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move remaining mock functions to directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update imports

Signed-off-by: Kerry Archibald <kerrya@element.io>

* missed copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* type wait for update

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-23 11:21:11 +00:00
Renamed from test/test-utils.js (Browse further)