matrix-react-sdk icon indicating copy to clipboard operation
matrix-react-sdk copied to clipboard

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

Open dhenneke opened this issue 1 year ago • 4 comments

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)
  • [x] Linter and other CI checks pass
  • [x] 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 avatar Sep 12 '22 15:09 dhenneke

I could try to write a unit test tomorrow.

dhenneke avatar Sep 12 '22 17:09 dhenneke

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

SimonBrandner avatar Sep 12 '22 17:09 SimonBrandner

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.

dhenneke avatar Sep 13 '22 09:09 dhenneke

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

t3chguy avatar Sep 13 '22 09:09 t3chguy

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 avatar Jan 25 '24 11:01 dbkr

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

dhenneke avatar Jan 25 '24 18:01 dhenneke

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?

maheichyk avatar Jan 26 '24 09:01 maheichyk