Commit Graph

302 Commits (7638790095f8f033a8c72627180dd4c589892917)

Author SHA1 Message Date
Germain f96583e74a
Update RoomSummaryCard navigation links (#11812)
* Update RoomSummaryCard navigation links

* Fix tests

* remove unneeded test

* "@vector-im/compound-web": "0.8.0"

* Fix: search button no transition on hover

* Fix: disabled invite option is not reflected in UI

* test canInviteTo

* update snapshots for CW 0.8.1

* unit test inviteToRoom

* unit test tagRoom

* add member link to roomsummarycard when using legacy room header

* use onChange instead of onClick for ToggleMenuItem favourite room

* update selectors in cypress tests

* always show people menu item

* add hover style to close button

* add padding around room name

* prettier

---------

Co-authored-by: Kerry Archibald <kerrya@element.io>
2023-11-16 03:25:34 +00:00
Ole Wieners 4ff35f0471
Fix unfederated invite dialog (#9618)
* clarify error message for unfederated room invites

* hide external user suggesetions

* rename some descriptors

* fix i18n

* add warning for unfederated spaces

* i18n

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Add tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-10-25 10:08:10 +00:00
Kerry 1d9c24e96e
OIDC: add friendly errors (#11184)
* add delegatedauthentication to validated server config

* dynamic client registration functions

* test OP registration functions

* add stubbed nativeOidc flow setup in Login

* cover more error cases in Login

* tidy

* test dynamic client registration in Login

* comment oidc_static_clients

* register oidc inside Login.getFlows

* strict fixes

* remove unused code

* and imports

* comments

* comments 2

* util functions to get static client id

* check static client ids in login flow

* remove dead code

* OidcRegistrationClientMetadata type

* navigate to oidc authorize url

* exchange code for token

* navigate to oidc authorize url

* navigate to oidc authorize url

* test

* adjust for js-sdk code

* login with oidc native flow: messy version

* tidy

* update test for response_mode query

* tidy up some TODOs

* use new types

* add identityServerUrl to stored params

* unit test completeOidcLogin

* test tokenlogin

* strict

* whitespace

* tidy

* unit test oidc login flow in MatrixChat

* strict

* tidy

* extract success/failure handlers from token login function

* typo

* use for no homeserver error dialog too

* reuse post-token login functions, test

* shuffle testing utils around

* shuffle testing utils around

* i18n

* tidy

* Update src/Lifecycle.ts

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

* tidy

* comment

* update tests for id token validation

* move try again responsibility

* prettier

* add friendly error messages for oidc authorization failures

* i18n

* update for new translations, tidy

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-10-19 02:46:37 +00:00
Michael Telatynski 5ff965106a
Render timeline separator for late event groups (#11739)
* Use Compound tooltips on MessageTimestamp to improve UX of date time discovery

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Show io.element.late_event in MessageTimestamp when known

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update snapshot

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Avoid needing new Compound changes

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Move groupers into their own directory

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Refactor date separator code to be more generic

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Render timeline separator for late event groups

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix date used in copy

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update snapshot

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Move groupers into their own directory

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update copy

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update copy

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update snapshot

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* i18n

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Add comments

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Add comments

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2023-10-16 14:14:04 +00:00
Kerry d9d52fba8c
OIDC: use delegated auth account URL from `OidcClientStore` (#11723)
* test persistCredentials without a pickle key

* test setLoggedIn with pickle key

* lint

* type error

* extract token persisting code into function, persist refresh token

* store has_refresh_token too

* pass refreshToken from oidcAuthGrant into credentials

* rest restore session with pickle key

* retreive stored refresh token and add to credentials

* extract token decryption into function

* remove TODO

* very messy poc

* utils to persist clientId and issuer after oidc authentication

* add dep oidc-client-ts

* persist issuer and clientId after successful oidc auth

* add OidcClientStore

* comments and tidy

* expose getters for stored refresh and access tokens in Lifecycle

* revoke tokens with oidc provider

* test logout action in MatrixChat

* comments

* prettier

* test OidcClientStore.revokeTokens

* put pickle key destruction back

* comment pedantry

* working refresh without persistence

* extract token persistence functions to utils

* add sugar

* implement TokenRefresher class with persistence

* tidying

* persist idTokenClaims

* persist idTokenClaims

* tests

* remove unused cde

* create token refresher during doSetLoggedIn

* tidying

* also tidying

* OidcClientStore.initClient use stored issuer when client well known unavailable

* test Lifecycle.logout

* update Lifecycle test replaceUsingCreds calls

* fix test

* add sdkContext to UserSettingsDialog

* use sdkContext and oidcClientStore in session manager

* use sdkContext and OidcClientStore in generalusersettingstab

* tidy

* test tokenrefresher creation in login flow

* test token refresher

* Update src/utils/oidc/TokenRefresher.ts

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

* use literal value for m.authentication

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

* improve comments

* fix test mock, comment

* typo

* add sdkContext to SoftLogout, pass oidcClientStore to logout

* fullstops

* comments

* fussy comment formatting

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-10-15 23:03:25 +00:00
Michael Telatynski 4605fd7396
Use Compound tooltips on MessageTimestamp to improve UX of date time discovery (#11732)
* Use Compound tooltips on MessageTimestamp to improve UX of date time discovery

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update snapshot

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update snapshot

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2023-10-13 11:26:12 +00:00
renovate[bot] 3bd6dd9143
Update vector-im (#11621)
* Update vector-im

* Update snapshots

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-10-12 11:12:59 +00:00
Kerry 3a025c4b21
OIDC: refresh tokens (#11699)
* test persistCredentials without a pickle key

* test setLoggedIn with pickle key

* lint

* type error

* extract token persisting code into function, persist refresh token

* store has_refresh_token too

* pass refreshToken from oidcAuthGrant into credentials

* rest restore session with pickle key

* retreive stored refresh token and add to credentials

* extract token decryption into function

* remove TODO

* very messy poc

* comments

* prettier

* comment pedantry

* working refresh without persistence

* extract token persistence functions to utils

* add sugar

* implement TokenRefresher class with persistence

* tidying

* persist idTokenClaims

* persist idTokenClaims

* tests

* remove unused cde

* create token refresher during doSetLoggedIn

* tidying

* also tidying

* update Lifecycle test replaceUsingCreds calls

* tidy

* test tokenrefresher creation in login flow

* test token refresher

* Update src/utils/oidc/TokenRefresher.ts

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

* use literal value for m.authentication

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

* improve comments

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-10-12 00:49:07 +00:00
Kerry feb7e9899b
OIDC: persist id token claims (#11691)
* persist idTokenClaims

* tests

* remove unused cde
2023-10-04 05:06:04 +01:00
Michael Telatynski e1cfde0c6e
Migrate more strings to translation keys (#11694) 2023-10-03 19:17:26 +01:00
Andy Balaam 875fcb1a32
Merge pull request #11634 from matrix-org/germain-gg/facepile-offset
Revert "Fix regression around FacePile with overflow (#11527)"
2023-09-26 09:49:37 +01:00
Michael Telatynski 0f59298f30
Consolidate conjugation i18n strings (#11660) 2023-09-25 12:18:15 +01:00
Germain 899cc53a3e upgrade snapshots 2023-09-22 09:35:36 +01:00
maheichyk 86e86ba49f
Show knock rooms in the list (#11573)
* Show knock rooms in the list

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>

* Pass userId to IndexedDBStore

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>

* Revert "Pass userId to IndexedDBStore"

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>

* Code review changes

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>

---------

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
Co-authored-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
2023-09-19 11:24:35 +00:00
Kerry 46072caa3a
OIDC: persist refresh token (#11249)
* test persistCredentials without a pickle key

* test setLoggedIn with pickle key

* lint

* type error

* extract token persisting code into function, persist refresh token

* store has_refresh_token too

* pass refreshToken from oidcAuthGrant into credentials

* rest restore session with pickle key

* comments

* prettier

* Update src/Lifecycle.ts

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

* comments

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-09-19 00:06:19 +00:00
Florian Duros 579b0dd10a
ElementR: Cross user verification (#11364)
The hard work has been done in previous PRs in the js-sdk, so this is now just a case of updating a few call sites to use the new APIs.
2023-09-18 17:34:00 +01:00
renovate[bot] d34dc0c307
Update vector-im (#11526)
* Update vector-im

* Update snapshots of Compound Avatars

* Update snapshots of Compound Avatars

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-09-05 08:09:36 +00:00
Germain d551469543
Room header UI updates (#11507)
* Fix performance issues with useRoomMembers

With the current implementation it would create a new function, with leading: true, rendering the whole throttling useless

* Add public room indicator

* Format room members count better

* Add public room test

* Add search to room summary card

* Update settings UI

* Update snapshot

* Remove default title attribute
2023-09-01 09:45:50 +00:00
Germain 23897dff4f
Fix colour of avatar and colour matching with username (#11470)
* Use consistent colouring of username with avatar

* Upgrade Compound to fix Firefox issue

* Use the approapriate color shade for usernames

* Use the approapriate color shade for usernames

* Upgrade Compound

* Fix tests
2023-08-24 17:12:28 +00:00
Richard van der Hoff 839c0a720c
Lock out the first tab if Element is opened in a second tab. (#11425)
* Implement session lock dialogs

* Bump analytics-events package

* clean up resetJsDomAfterEach

* fix types

* update snapshot

* update i18n strings
2023-08-24 08:28:43 +00:00
Germain 09c5e06d12
Change avatar to use Compound implementation (#11448)
* Move avatar to new compound implementation

* Make space avatars square

* Remove reference to the avatar initial CSS class

* remove references to mx_BaseAvatar_image

* Fixe test suites

* Fix accessbility violations

* Add ConfirmUserActionDialog test

* Fix tests

* Add FacePile test

* Fix items clipping in members list

* Fix user info avatar sizing

* Fix tests
2023-08-24 03:48:35 +00:00
Michael Telatynski 99e80dd296
Consume more imports from matrix-js-sdk/src/matrix (#11449) 2023-08-23 09:04:25 +00:00
Michael Telatynski ac70f7ac9b
Fix instances of double translation and guard translation calls using typescript (#11443)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-08-22 16:32:05 +01:00
Richard van der Hoff d13b6e1b41
Add mechanism to check only one instance of the app is running (#11416)
* Add mechanism to check only one instance of the app is running

This isn't used yet, but will form part of the solution to
https://github.com/vector-im/element-web/issues/25157.

* disable instrumentation for SessionLock

* disable coverage reporting

* exclude SessionLock in sonar.properties

* Revert "disable coverage reporting"

This reverts commit 80c4336f76ec8e47e376b6744ef612a73299d14f.

* only disable session storage

* use pagehide instead of visibilitychange

* Add `checkSessionLockFree`

* Give up waiting for a lock immediately when someone else claims

* Update src/utils/SessionLock.ts
2023-08-22 14:10:47 +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 ff9d4905d5
Fix export type "Current timeline" to match its behaviour to its name (#11426)
* Fix export type "Current timeline" to match its behaviour to its name

* Iterate tests
2023-08-18 11:58:58 +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 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
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 27d79458da
Remove dead & duplicated code (#11405)
* Remove dead code

* Make dead code happier

* DRY pickle additional data calculation

* Iterate
2023-08-15 08:43:15 +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
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
Germain 84d196776e
Change formatCount impl to use Intl.NumberFormat (#11379)
* Change formatCount impl to use Intl.NumberFormat

* Update formatCount JSDoc description
2023-08-08 11:45:20 +00:00
Rashmit Pankhania b08bdf7e0d
Fix "Export chat" not respecting configured time format in plain text mode (#10696)
* #23838 Fix "Export chat" time format in plain text mode

* #23838 Fix import of matrix-js-sdk

* Remove hardcoded locale

Co-authored-by: Michael Weimann <mail@michael-weimann.eu>

* Fix test for readability

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix test

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix test

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix test

Signed-off-by: Rashmit Pankhania <rashmitpankhania@gmail.com>
Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Use dateUtils formatFullDate function

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

---------

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>
Signed-off-by: Rashmit Pankhania <rashmitpankhania@gmail.com>
Co-authored-by: Rashmit Pankhania <raspankh@publicisgroupe.net>
Co-authored-by: Michael Weimann <mail@michael-weimann.eu>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-08-07 13:58:45 +00:00
Michael Telatynski 24703eea8f
Switch to importing models/event from main js-sdk export (#11363) 2023-08-07 08:24:58 +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
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
Kerry 0b0d77cbcc
OIDC: Persist details in session storage, create store (#11302)
* utils to persist clientId and issuer after oidc authentication

* add dep oidc-client-ts

* persist issuer and clientId after successful oidc auth

* add OidcClientStore

* comments and tidy

* format
2023-07-20 21:30:19 +00:00
Michael Telatynski 58db307cf2
Update jest snapshot (#11293) 2023-07-18 14:33:46 +00:00
RiotRobot 5881df3f41 Merge branch 'master' into develop 2023-07-18 13:33:41 +01:00
RiotRobot 22fcd34c60 Sanitise strings going into the html export CVE-2023-37259 2023-07-18 13:23:27 +01:00
Michael Telatynski 63bdd84c94
Offer to unban user during invite if inviter has sufficient permissions (#11256)
* Offer to unban user during invite if inviter has sufficient permissions

* Improve unban check in MultiInviter

* Improve coverage

* Update src/utils/MultiInviter.ts

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-07-14 13:26:02 +00:00
Michael Telatynski f5f31eb7d8
Fix jest/valid-expects lints (#11238) 2023-07-13 15:19:44 +00:00
Kerry 7b3d0ad209
OIDC: Log in (#11199)
* add delegatedauthentication to validated server config

* dynamic client registration functions

* test OP registration functions

* add stubbed nativeOidc flow setup in Login

* cover more error cases in Login

* tidy

* test dynamic client registration in Login

* comment oidc_static_clients

* register oidc inside Login.getFlows

* strict fixes

* remove unused code

* and imports

* comments

* comments 2

* util functions to get static client id

* check static client ids in login flow

* remove dead code

* OidcRegistrationClientMetadata type

* navigate to oidc authorize url

* exchange code for token

* navigate to oidc authorize url

* navigate to oidc authorize url

* test

* adjust for js-sdk code

* login with oidc native flow: messy version

* tidy

* update test for response_mode query

* tidy up some TODOs

* use new types

* add identityServerUrl to stored params

* unit test completeOidcLogin

* test tokenlogin

* strict

* whitespace

* tidy

* unit test oidc login flow in MatrixChat

* strict

* tidy

* extract success/failure handlers from token login function

* typo

* use for no homeserver error dialog too

* reuse post-token login functions, test

* shuffle testing utils around

* shuffle testing utils around

* i18n

* tidy

* Update src/Lifecycle.ts

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

* tidy

* comment

* update tests for id token validation

* move try again responsibility

* prettier

* use more future proof config for static clients

* test util for oidcclientconfigs

* rename type and lint

* correct oidc test util

* store issuer and clientId pre auth navigation

* adjust for js-sdk changes

* update for js-sdk userstate, tidy

* update MatrixChat tests

* update tests

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-07-11 04:09:18 +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