* Mock subtle crypto in OIDC test
To unblock upgrade to oidc-client-ts
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update dependency oidc-client-ts to v3
* delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Ensure oidc-client-ts 3.0.1 to drop crypto-js
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Reuse exported common type
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve client metadata used for OIDC dynamic registration
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix Native OIDC for Element Desktop by including ssoid in the url_state of the /auth call
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Reuse exported common type
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve client metadata used for OIDC dynamic registration
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix typo
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix test
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Mock PlatformPeg
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Mock platform
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Add comment
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve comment
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update src/BasePlatform.ts
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Upgrade compound-web
I forgot to include this in https://github.com/matrix-org/matrix-react-sdk/pull/12209, which has caused avatar and username colors to be out of sync and sometimes revert to plain black/white.
* Update tests
* Update tests
* Add `Thread Activity centre` labs flag
* Rename translation string
* WIP Thread Activity Centre
* Update supportedLevels
* css lint
* i18n lint
* Fix labs subsection test
* Update Threads Activity Centre label
* Rename Thread Activity Centre to Threads Activity Centre
* Use compound `MenuItem` instead of custom button
* Color thread icon when hovered
* Make the pop-up scrollable and add a max height
* Remove Math.random in key
* Remove unused class
* Change add comments on `mx_ThreadsActivityRows` and `mx_ThreadsActivityRow`
* Make threads activity centre labs flag split out unread counts
Just shows notif & unread counts for main thread if the TAC is enabled.
* Fix tests
* Simpler fix
* Open thread panel when thread clicke in Threads Activity Centre
Hopefully this is a sensible enough way. The panel will stay open of
course (ie. if you go to a different room & come back), but that's the
nature of the right panel.
* Dynamic state of room
* Add doc
* Use the StatelessNotificationBadge component in ThreadsActivityCentre
and re-use the existing NotificationLevel
* Remove unused style
* Add room sorting
* Fix `ThreadsActivityRow` props doc
* Pass in & cache the status of the TAC labs flag
* Pass includeThreads as setting to doesRoomHaveUnreadMessages too
* Fix tests
* Add analytics to the TAC (#12179)
* Update TAC label (#12186)
* Add `IndicatorIcon` to the TAC button (#12182)
Add `IndicatorIcon` to the TAC button
* Threads don't have activity if the room is muted
This makes it match the computation in determineUnreadState.
Ideally this logic should all be in one place.
* Re-use doesRoomHaveUnreadThreads for useRoomThreadNotifications
This incorporates the logic of not showing unread dots if the room
is muted
* Add TAC description in labs (#12197)
* Fox position & size of dot on the tac button
IndicatorIcon doesn't like having the size of its icon adjusted and
we probably shouldn't do it anyway: better to specify to the component
what size we want it.
* TAC: Utils tests (#12200)
* Add tests for `doesRoomHaveUnreadThreads`
* Add tests for `getThreadNotificationLevel`
* Add test for the ThreadsActivityCentre component
* Add snapshot test
* Fix narrow hover background on TAC button
Make the button 32x32 (and the inner icon 24x24)
* Add caption for empty TAC
* s/tac/threads_activity_centre/
* Fix i18n & add tests
* Add playwright tests for the TAC (#12227)
* Fox comments
---------
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
* Fix StorageManager checks for rust migration manual opt-in
* fix restricted imports
* Moved utility to check db internals into js-sdk
* fix typos and test names
* more timeout for migration test
* Add notification dots to thread summary icons
Adopts new IndicatorIcon from compound to have threads icons with
indicator dot (that aren't also buttons). Adds green & red dots on
the threads icon in the thread summary to indicate notifications.
Changes the notification level dots colours in the threads panel to
be green to match.
* Update test for new CSS class
* Update snapshots with new class name
* Another snapshot update for new class name
* Replace more uses of old class name in tests
* More snapshot updates for new class name
* Unsure how this ever worked in chronological mode
* More snapshot updates
* Fix dot colours
* Upgrade to compound-web 3
* Fix computed notification levels
* Add test for notificationLevelToIndicator
* Fix OIDC bugs due to amnesiac stores forgetting OIDC issuer & other data
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate landmarks around the app in order to improve a11y
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Add missing aria-label
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update snapshots
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* i18n
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update screenshots which have changed a fraction due to default heading margins being different in different landmarks
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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
* 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
* 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
* 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
* 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
* 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>
* 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