Commit Graph

147 Commits

Author SHA1 Message Date
Michael Telatynski
8b8ca425d7
Hide widget menu button if it there are no options available (#11257)
* Hide widget menu button if it there are no options available

* Update snapshots
2023-07-17 10:37:07 +00:00
Richard van der Hoff
2cfbd73cd3
Replace getQRCodeBytes with generateQRCode (#11241)
* Replace `getQRCodeBytes` with `generateQRCode`

* another test update

* remove obsolete snapshot
2023-07-13 13:55:55 +00:00
Johannes Marbach
9d9c55d92e
Handle permalinks in room topic (#11115)
* Handle permalinks in room topic

Fixes: vector-im/element-web#23395

* Add test for clicking non-link
2023-06-21 18:09:22 +00:00
Suguru Hirahara
2972219959
Conform class names of mx_AppTileBody for a widget and PiP widget to our naming policy (#11002)
* Rename classes of appTileBodyClass

Include mx_AppTileBody_fadeInSpinner in mx_AppTileBody, the class name applied by default

* Apply a common CSS declaration to mx_AppTileBody

* Strictify style rule specificity to avoid visual regressions - mx_AppTileBody--*

* Run prettier

* Change --normal to --large

* Edit and add comments

When you add, edit, or remove style rules from mx_appTileBody without causing a visual regression, it is imperative to keep in mind which selector should be worked on. The comments should help developers who are not familiar with the style codebase to avoid a regression.

* Rename classes of appTileBodyClass

Include mx_AppTileBody_fadeInSpinner in mx_AppTileBody, the class name applied by default

* Apply a common CSS declaration to mx_AppTileBody

* Strictify style rule specificity to avoid visual regressions - mx_AppTileBody--*

* Run prettier

* Change --normal to --large

* Edit and add comments

When you add, edit, or remove style rules from mx_appTileBody without causing a visual regression, it is imperative to keep in mind which selector should be worked on. The comments should help developers who are not familiar with the style codebase to avoid a regression.

* Update a Jest snapshot

* Update a Jest snapshot
2023-06-16 18:24:10 +00:00
Suguru Hirahara
b40f29f04c
Fix visual regressions around widget permissions (#10954)
* Add a Jest snapshot of AppPermission

* Move the test inside 'for a pinned widget' category

* Make only spinner message bold

* Set font size specified with "mx_AppPermission_smallText" by default

- Add "mx_AppPermission_largeText" for elements whose size has not been specified with mx_AppPermission_smallText
- Create _AppWarning.pcss for AppWarning

* Make AppPermission panel scrollable, keeping the content at the center

* Run prettier

* Use Heading component

* Use Icon component

* Fix the test
2023-06-14 11:11:06 +00:00
Suguru Hirahara
0ce3664434
Conform to the naming policy - AppsContainer resizer (#11042)
* Add a snapshot to track AppTile in AppsDrawer

* Conform to the naming policy - AppsContainer resizer

* Nest 'mx_AppsContainer_resizer_container_handle' to enforce the style

- mx_AppsContainer_resizer
- mx_AppsContainer_resizer_container
- mx_AppsContainer_resizer_container_handle

* Rename "mx_AppsContainer_resizer" to "mx_AppsDrawer_resizer"

PersistentVResizer is defined by mx_AppsDrawer (see const "classes")
2023-06-13 11:13:07 +00:00
Richard van der Hoff
34439ee652
Simplify references to VerificationRequest (#11045)
* Use new `VerificationRequest.getQRCodeBytes()`

* Use new `VerificationRequest.otherDeviceId`

* Remove references to `VerificationRequest.channel`

* Replace references to `VerificationRequest.{requesting,receiving}UserId`

Normally these are guarded by `request.initiatedByMe` so we can trivially
replace it with `request.otherUserId` or `client.getUserId()`. In one place we
actually need to apply some logic.

* increase test coverage

* Even more test coverage

* Even more test coverage
2023-06-07 14:43:44 +00:00
Michael Telatynski
6b46d6e4f8
Add MatrixClientPeg::safeGet and use it in tests (#10985) 2023-06-05 18:12:23 +01:00
Suguru Hirahara
43d9e30673
Fix fadein spinner placement on AppTileBody (#10970) 2023-06-01 15:17:28 +00:00
Michael Telatynski
30429df948
Eliminate the use of MatrixClientPeg in utils (#10910) 2023-05-23 16:24:12 +01:00
Suguru Hirahara
b7cd1f00fc
Use Icon component for icons on AppTile's menu bar (#10955)
* Use icon component for buttons on mx_AppTileMenuBar_widgets

* Remove redundant declarations

* Add a Percy snapshot test

* Set color value to mx_Icon, fill and stroke with currentColor

* Iterate
2023-05-22 07:48:40 +00:00
Suguru Hirahara
c6f44d3053
Add Jest snapshots for AppTile (#10946)
- on PiP widget (PersistentApp)
- on RightPanel
2023-05-19 10:34:55 +00:00
Suguru Hirahara
8637a5d77d
Take Jest snapshots of widgets (AppTile) (#10897)
* Take a Jest snapshot of a widget (AppTile)

* Fix the comment

* Update test/components/views/elements/AppTile-test.tsx

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>

* Add container

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-05-18 08:30:55 +00:00
Michael Telatynski
2da199c41d
Remove url npm dependency and use Web URL constructor (#10930) 2023-05-17 12:50:00 +01:00
Michael Telatynski
2cee8a4b01
Specify lazy loading for avatars (#10866)
* Specify lazy loading for avatars

so browser doesn't fetch eagerly if off-screen

* Update snapshots
2023-05-11 18:29:48 +00:00
Michael Telatynski
82e32035fd
Conform more of the codebase to strictNullChecks (#10842) 2023-05-11 09:56:56 +01:00
Michael Telatynski
99ac9e5029
Ensure tooltip contents is linked via aria to the target element (#10729)
* Ensure tooltip contents is linked via aria to the target element

* Iterate

* Fix tests

* Fix tests

* Update snapshot

* Fix missing aria labels for more tooltips

* Iterate

* Update snapshots
2023-05-05 08:26:11 +00:00
Michael Telatynski
782060a26e
ARIA Accessibility improvements (#10674)
* Add missing aria-expanded attributes

* Improve autoComplete for phone numbers & email addresses

* Fix room summary card heading order

* Fix missing label on timeline search field

* Use appropriate semantic elements for dropdown listbox

* Use semantic list elements in keyboard settings tab

* Use semantic list elements in spotlight

* Fix types and i18n

* Improve types

* Update tests

* Add snapshot test
2023-04-20 17:13:30 +00:00
Michael Telatynski
a47b3eb0ee
Apply strictNullChecks to src/components/views/elements/* (#10462
* Apply `strictNullChecks` to `src/components/views/elements/*`

* Iterate

* Iterate

* Iterate

* Apply `strictNullChecks` to `src/components/views/elements/*`

* Iterate

* Iterate

* Iterate

* Update snapshot
2023-03-29 08:23:54 +01:00
Michael Weimann
aec454dd6f
Add UserProfilesStore, LruCache and cache for user permalink profiles (#10425) 2023-03-27 10:07:43 +02:00
Michael Weimann
3eb6a55b93
Tweak pill UI (#10417) 2023-03-22 13:27:24 +01:00
Michael Weimann
96d1b74ffc
Pillify event permalinks (#10392) 2023-03-21 10:23:20 +01:00
Michael Telatynski
1c9ea423c9
Conform more code to strictNullChecks (#10374)
* Apply `strictNullChecks` to `src/components/views/room_settings/*`

* Restore tsconfig.json

* Conform more code to `strictNullChecks`

* Iterate

* Update matrix-widget-api

* Conform more code to `strictNullChecks`
2023-03-16 11:07:29 +00:00
Michael Weimann
41d88ad6ae
Fix user pill click (#10359) 2023-03-13 15:43:13 +01:00
Michael Weimann
85e8d27697
Extract avatars from permalink hook (#10328) 2023-03-09 12:48:36 +01:00
Michael Weimann
ad26925bb6
Refactor pill and add tests (#10304) 2023-03-08 13:06:50 +01:00
Sebbones
0c1c3f1cde
Improved a11y for Field feedback and Secure Phrase input (#10320)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-03-08 11:32:50 +00:00
Michael Telatynski
e5291c195d
Replace react-dom tests with react testing-library tests (#10260) 2023-03-01 15:59:27 +00:00
Michael Weimann
5398db21ad
Add ESLint Jest (#10261) 2023-03-01 16:23:35 +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
Michael Telatyński
9b2b3ca42e
Remove tests of non-spec-compliant behaviour (#10248) 2023-02-27 18:50:15 +00:00
Michael Telatyński
12dd799301
Fix double translation issue (#10240
* Fix double translation issue

* Remove some redundant string concatenations
2023-02-27 09:15:27 +00:00
maheichyk
7b77f76486
Widget permissions customizations using module api (#10121)
* Using module api to customize widget permissions

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

* Revert type export and use ComponentProps instead.

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-02-23 14:53:44 +00:00
Michael Telatynski
c29e5f18ff
Update usages of test utilities preferring RTL (#10203) 2023-02-22 10:52:55 +00:00
Michael Telatynski
e8b92b308b
Conform more code to strict null checking (#10169)
* Conform more code to strict null checking

* delint

* Iterate

* delint

* Fix bad test
2023-02-16 09:38:44 +00:00
Michael Telatynski
145a5a8a8d
Conform more code to strict null checking (#10153)
* Conform more code to strict null checking

* Conform more code to strict null checking

* Iterate

* Iterate
2023-02-15 13:36:22 +00:00
Suguru Hirahara
ea4000cf1e
Fix 'Failed check: Ellipsis' on Weblate (#10144)
* Fix 'Failed check: Ellipsis' on Weblate

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Fix tests

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Remove white space characters before the horizontal ellipsis from RoomPreviewBar

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* yarn run i18n

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Additional change

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-02-14 09:05:01 +00:00
Michael Telatynski
61a63e47f4
Comply with noImplicitAny (#9940)
* Stash noImplicitAny work

* Stash

* Fix imports

* Iterate

* Fix tests

* Delint

* Fix tests
2023-02-13 11:39:16 +00:00
Kerry
18ab325eaf
Poll history - filter by active or ended (#10098)
* 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

* move FilterTabGroup into generic components

* comments

* Update src/components/views/dialogs/polls/types.ts

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

* Apply suggestions from code review

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-02-13 09:19:45 +13:00
Michael Weimann
2501dad0a3
Migrate LabelledCheckbox-test to react-testing-library (#10115) 2023-02-09 12:23:34 +01:00
Michael Telatynski
54a6ce589f
Fix wrongly grouping 3pid invites into a single repeated transition (#10087) 2023-02-07 10:09:46 +00:00
Michael Telatynski
2bde31dcff
Switch to linkify-react for element Linkification as it handles React subtrees without exploding (#10060
* Switch to linkify-react instead of our faulty implementation

Fixes a series of soft crashes where errors include "The node to be removed is not a child of this node."

* Improve types

* Fix types

* Update snapshots

* Add test

* Fix test
2023-02-03 08:59:21 +00:00
Clark Fischer
2417482667
Fix error when viewing source of redacted events (#9914)
* Fix viewing source of redacted events

Clicking 'View Source' in the context menu of a redacted event causes an error,
and the user gets no visible result.

This fixes <ViewSource /> to indicate that the source is unavailable when a
message has been redacted. The original source remains available.

<SyntaxHighlight /> requires a non-null string for its `content` prop, and, in
the case of redacted events, <ViewSource /> was passing `undefined`. This is
ultimately because redacting an event causes `MatrixEvent.clearEvent` to be
`undefined`, which <ViewSource /> wasn't checking.

Fixes https://github.com/vector-im/element-web/issues/24165

Signed-off-by: Clark Fischer <clark.fischer@gmail.com>

* Use correct highlight.js call

Previous call signature was deprecated.

See https://github.com/highlightjs/highlight.js/issues/2277

Signed-off-by: Clark Fischer <clark.fischer@gmail.com>

Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
2023-01-15 16:22:59 +00:00
Travis Ralston
badb2c4b27
Use js-sdk imports for poll event types instead of events-sdk (#9904)
* Use js-sdk imports for poll event types instead of events-sdk

* Attempt to appease some tsc --strict errors

* Manually create poll response in cypress test
2023-01-13 10:02:33 -07:00
Florian Duros
a691e634b0
Add edit and remove actions to link in RTE (#9864)
Add edit and remove actions to link in RTE
2023-01-11 10:10:55 +00:00
Johannes Marbach
214fa13d7d Update snapshots 2023-01-06 17:44:36 +01:00
Michael Weimann
3ce064731b
Migrate AppTile-Test to RTL (#9838) 2022-12-30 10:33:10 +00:00
Germain
d2763c329d
Migrate AccessibleButton-test to RTL (#9833) 2022-12-28 10:40:34 +00:00
Kerry
9a8545bf34
Fix: Editing a poll will silently change it to a closed poll (#9809)
* add failing test case

* dont reset poll disclosure on editing
2022-12-21 21:29:11 +00:00
Michael Weimann
526645c791
Apply prettier formatting 2022-12-12 12:24:14 +01:00