-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Refactor Modals, ChannelHeader and Navbar component #1666
Conversation
I would prefer the |
f83858b
to
33dc9cd
Compare
This comment has been minimized.
This comment has been minimized.
@cometkim Really appreciate your help here. Let me know if you have any questions or would like someone to review progress so far? Excited for this :) |
@jasonblais Still working on. I will request a review in a couple days. |
This comment has been minimized.
This comment has been minimized.
Thanks @cometkim! The matrix is great. We'll review. A question: Can you help clarify the difference between 'O', 'X' and '-'? |
@jasonblais Sorry to late,
you can arrange it in a better format to clarify. What I want to do is to unify the visibility verification of menu items based on the channel state. (user permissions or system settings are not included hear)
I can leave it with test codes, or make it more declarative in a flavor of JSX(ex, like ChannelPermissionGate component). To do this, I need to know clearly conditions for visibility of each menu item. it's too hard to figure it out through the code. |
Thanks @cometkim! I've added a QA label given they'll be better equipped to confirm the above matrix is correct. |
@cometkim Can you answer a couple more questions about your matrix above.
|
@cometkim One other question: 3: Do you know if these changes can affect the Mattermost advanced permissions feature? https://docs.mattermost.com/deployment/advanced-permissions.html Some of the menu items are hidden depending on which permissions are enabled for the user. |
Thank you! |
@jasonblais I use |
This comment has been minimized.
This comment has been minimized.
I just removed 1000 lines of code from Navbar and it works properly. very excited |
fcb66ea
to
8ac4d73
Compare
Took a look through and I really like the direction you're going with this, it's very much more React-like and a much more organized and clean structuring 👍 |
Thank for review @jwilander, I go for ChannelHeader. BTW, I am wondering if I can express channel validation more declaratively using HOC or render props. something like... as is:
to be (in parent):
Any idea here? |
This has been delayed for days, but I just restarted. |
I don't have a strong opinion either way if you want to use HOC or just return null early in the lower components. We don't use a ton of HOC currently, and I'd lean just slightly towards using the render props to reduce the hierarchy a bit but 0/5 on that |
Excellent! Huge thanks @DHaussermann and @cometkim 🎉 @jwilander ready to merge, apart from a dev confirmation on changes since the latest dev review |
I'll give it another quick pass and then merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me, great work @cometkim !
Finally...! 😇 Thanks @hmhealey @saturninoabril @jwilander @jasonblais for following-up and review this PR. Let me know if have any problem or need any explanation |
Summary
NavBar
toChannelHeaderMobile
for consistencyModalController
and Redux action instead of manage modal internallyMany modals was rendered twice, each in NavBar and ChannelHeader
Ticket Links
InviteMemberModal
Navbar
Checklist
make check-style
to check for style errors (required for all pull requests)make test
to ensure unit and component tests passedFuture plan
mapStateToProps
for ChannelHeader and ChannelHeaderMobile (like ChannelHeaderDropdown)