Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Hide the "Message" button in the sidebar if the CreateRooms components should not be shown #9271

Merged

Conversation

dhenneke
Copy link
Contributor

@dhenneke dhenneke commented Sep 12, 2022

When using ComponentVisibilityCustomisations to hide certain features from the UI, the "Message" link in the people section of a room is still visible and leads to an error, if the room creation is disabled in the homeserver.

Before:

image image

After:
image

Checklist

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

Here's what your changelog entry will look like:

✨ Features

  • Hide the "Message" button in the sidebar if the CreateRooms components should not be shown (#9271). Contributed by @dhenneke.

@dhenneke dhenneke requested a review from a team as a code owner September 12, 2022 15:07
@github-actions github-actions bot added the Z-Community-PR Issue is solved by a community member's PR label Sep 12, 2022
@SimonBrandner SimonBrandner added the T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements label Sep 12, 2022
Copy link
Contributor

@SimonBrandner SimonBrandner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM codewise

Would it be possible to write tests for this change?

@dhenneke
Copy link
Contributor Author

I could try to write a unit test tomorrow.

@SimonBrandner
Copy link
Contributor

I could try to write a unit test tomorrow.

Absolutely awesome! Take the time you need and in case you need anything, be sure to visit https://matrix.to/#/#element-dev:matrix.org

Copy link
Contributor

@SimonBrandner SimonBrandner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please fix the strict TS warnings?

LGTM otherwise

});

it('hides the message button if the visibility customisation hides all create room features', () => {
(shouldShowComponent as jest.Mock).mockImplementation((component) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to use mocked() here

@dhenneke
Copy link
Contributor Author

I added additional test for the component. I never worked with enzyme before and was surprised that it was used in this file while other components seem to use @testing-library/react which I'm more familiar with. But I hope it's correct in this way.

@t3chguy
Copy link
Member

t3chguy commented Sep 13, 2022

@dhenneke enzyme is considered deprecated here, please use RTL instead. Enzyme is blocking our React 18 upgrade

Signed-off-by: Dominik Henneke <[email protected]>
@dbkr
Copy link
Member

dbkr commented Jan 25, 2024

Hey - apologies for this dropping off our radar. This looks fine now though. I'm assuming we don't have write permission to the fork: could you pull in the changes from develop so all the tests run?

@dhenneke
Copy link
Contributor Author

Neither do I... Maybe @maheichyk could help out?

Mikhail Aheichyk added 2 commits January 25, 2024 23:05
# Conflicts:
#	src/components/views/right_panel/UserInfo.tsx
#	test/components/views/right_panel/UserInfo-test.tsx
Signed-off-by: Mikhail Aheichyk <[email protected]>
@maheichyk
Copy link
Contributor

maheichyk commented Jan 26, 2024

Hey - apologies for this dropping off our radar. This looks fine now though. I'm assuming we don't have write permission to the fork: could you pull in the changes from develop so all the tests run?

@dbkr branch is updated. Could you please have a look and merge if fine?

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 26, 2024
@dbkr dbkr added this pull request to the merge queue Jan 26, 2024
Merged via the queue into matrix-org:develop with commit 11f45f5 Jan 26, 2024
19 checks passed
@maheichyk maheichyk deleted the nic/feat/hide-message-button-if-disabled branch January 26, 2024 16:32
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Feb 14, 2024
https://build.opensuse.org/request/show/1146559
by user dheidler + anag+factory
- Version 1.11.58
  * 🦀  🔒 **The flag to enable the Rust crypto implementation is now set to `true` by default. This means that without any additional configuration every new login will use the new cryptography implementation.**
  * Add Element call related functionality to new room header (matrix-org/matrix-react-sdk#12091). Contributed by @toger5.
  * Add labs flag for Threads Activity Centre (matrix-org/matrix-react-sdk#12137). Contributed by @florianduros.
  * Refactor element call lobby + skip lobby (matrix-org/matrix-react-sdk#12057). Contributed by @toger5.
  * Hide the "Message" button in the sidebar if the CreateRooms components should not be shown (matrix-org/matrix-react-sdk#9271). Con
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Mar 3, 2024
Changes in [1.11.59](https://github.com/element-hq/element-web/releases/tag/v1.11.59) (2024-02-27)
==================================================================================================
## 🦖 Deprecations

* Enable custom themes to theme Compound ([#12240](matrix-org/matrix-react-sdk#12240)). Contributed by @robintown.
* Remove welcome bot `welcome_user_id` support ([#12153](matrix-org/matrix-react-sdk#12153)). Contributed by @t3chguy.

## ✨ Features

* Ignore activity in TAC ([#12269](matrix-org/matrix-react-sdk#12269)). Contributed by @florianduros.
* Use browser's font size instead of hardcoded `16px` as root font size ([#12246](matrix-org/matrix-react-sdk#12246)). Contributed by @florianduros.
* Revert "Use Compound primary colors for most actions" ([#12264](matrix-org/matrix-react-sdk#12264)). Contributed by @florianduros.
* Revert "Refine menu, toast, and popover colors" ([#12263](matrix-org/matrix-react-sdk#12263)). Contributed by @florianduros.
* Fix Native OIDC for Element Desktop ([#12253](matrix-org/matrix-react-sdk#12253)). Contributed by @t3chguy.
* Improve client metadata used for OIDC dynamic registration ([#12257](matrix-org/matrix-react-sdk#12257)). Contributed by @t3chguy.
* Refine menu, toast, and popover colors ([#12247](matrix-org/matrix-react-sdk#12247)). Contributed by @robintown.
* Call the AsJson forms of import and exportRoomKeys ([#12233](matrix-org/matrix-react-sdk#12233)). Contributed by @andybalaam.
* Use Compound primary colors for most actions ([#12241](matrix-org/matrix-react-sdk#12241)). Contributed by @robintown.
* Enable redirected media by default ([#12142](matrix-org/matrix-react-sdk#12142)). Contributed by @turt2live.
* Reduce TAC width by `16px` ([#12239](matrix-org/matrix-react-sdk#12239)). Contributed by @florianduros.
* Pop out of Threads Activity Centre ([#12136](matrix-org/matrix-react-sdk#12136)). Contributed by @florianduros.
* Use new semantic tokens for username colors ([#12209](matrix-org/matrix-react-sdk#12209)). Contributed by @robintown.

## 🐛 Bug Fixes

* [Backport staging] Fix spurious session corruption error ([#12287](matrix-org/matrix-react-sdk#12287)). Contributed by @RiotRobot.
* Fix the space panel getting bigger when gaining a scroll bar ([#12267](matrix-org/matrix-react-sdk#12267)). Contributed by @dbkr.
* Fix gradients spacings on the space panel ([#12262](matrix-org/matrix-react-sdk#12262)). Contributed by @dbkr.
* Remove hardcoded `Element` in tac labs description ([#12266](matrix-org/matrix-react-sdk#12266)). Contributed by @florianduros.
* Fix branding in "migrating crypto" message ([#12265](matrix-org/matrix-react-sdk#12265)). Contributed by @richvdh.
* Use h1 as first heading in dialogs ([#12250](matrix-org/matrix-react-sdk#12250)). Contributed by @dbkr.
* Fix forced lowercase username in login/registration flows ([#9329](matrix-org/matrix-react-sdk#9329)). Contributed by @vrifox.
* Update the TAC indicator on event decryption ([#12243](matrix-org/matrix-react-sdk#12243)). Contributed by @dbkr.
* Fix OIDC delegated auth account url check ([#12242](matrix-org/matrix-react-sdk#12242)). Contributed by @t3chguy.
* New Header edgecase fixes: Close lobby button not shown, disable join button in various places, more... ([#12235](matrix-org/matrix-react-sdk#12235)). Contributed by @toger5.
* Fix TAC button alignment when expanded ([#12238](matrix-org/matrix-react-sdk#12238)). Contributed by @florianduros.
* Fix tooltip behaviour in TAC ([#12236](matrix-org/matrix-react-sdk#12236)). Contributed by @florianduros.



Changes in [1.11.58](https://github.com/element-hq/element-web/releases/tag/v1.11.58) (2024-02-13)
==================================================================================================
## ✨ Features

 * 🦀  🔒 **The flag to enable the Rust crypto implementation is now set to `true` by default. This means that without any additional configuration every new login will use the new cryptography implementation.**
* Add Element call related functionality to new room header ([#12091](matrix-org/matrix-react-sdk#12091)). Contributed by @toger5.
* Add labs flag for Threads Activity Centre ([#12137](matrix-org/matrix-react-sdk#12137)). Contributed by @florianduros.
* Refactor element call lobby + skip lobby ([#12057](matrix-org/matrix-react-sdk#12057)). Contributed by @toger5.
* Hide the "Message" button in the sidebar if the CreateRooms components should not be shown ([#9271](matrix-org/matrix-react-sdk#9271)). Contributed by @dhenneke.
* Add notification dots to thread summary icons ([#12146](matrix-org/matrix-react-sdk#12146)). Contributed by @dbkr.

## 🐛 Bug Fixes

* [Backport staging] Fix the StorageManger detecting a false positive consistency check when manually migrating to rust from labs ([#12230](matrix-org/matrix-react-sdk#12230)). Contributed by @RiotRobot.
* Fix logout can take ages ([#12191](matrix-org/matrix-react-sdk#12191)). Contributed by @BillCarsonFr.
* Fix `Mark all as read` in settings ([#12205](matrix-org/matrix-react-sdk#12205)). Contributed by @florianduros.
* Fix default thread notification of the new RoomHeader ([#12194](matrix-org/matrix-react-sdk#12194)). Contributed by @florianduros.
* Fix display of room notification debug info ([#12183](matrix-org/matrix-react-sdk#12183)). Contributed by @dbkr.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants