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

[MM-12396] Option to add user to a channel from the profile pop-over #1918

Merged
merged 2 commits into from
Nov 26, 2018

Conversation

mickmister
Copy link
Member

@mickmister mickmister commented Oct 21, 2018

Summary

This is an added option to the profile pop-over to add another user to a different channel.

The components/profile_popover component is affected, and a new modal components/add_user_to_channel_modal has been introduced.

GitHub Issue Link

mattermost/mattermost#9501

Ticket Link

https://mattermost.atlassian.net/browse/MM-12396

Invision screens: https://invis.io/DYNZR9J64A9

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • Ran make check-style to check for style errors (required for all pull requests)
  • Ran make test to ensure unit and component tests passed
  • Added or updated unit tests (required for all new features)
  • Has UI changes
  • Includes text changes and localization file (.../i18n/en.json) updates

@jwilander jwilander added 1: PM Review Requires review by a product manager Hacktoberfest and removed 1: PM Review Requires review by a product manager labels Oct 22, 2018
@esethna
Copy link
Contributor

esethna commented Oct 22, 2018

Thanks @mickmister! I wasn't able to test the PR as it seems there is a build failure. Please help look into this when you have a chance and we can set up a test server. Regarding your questions:

  1. Re Permissions: Adding @grundleborg who is familiar with that area to provide some guidance on permissions checks.

  2. Re Styling: Looks fine to me, since it's consistent with other modals in the product. Once the test server is up I'll test the selector component.

  3. Re Testing the suggestion provider and import issues in tests: Adding @saturninoabril who can provide some guidance in that area.

@esethna esethna added this to the v5.6.0 milestone Oct 22, 2018
@mickmister
Copy link
Member Author

mickmister commented Oct 22, 2018

https://pre-release.mattermost.com/core/pl/ssdwfa5z53bdpjbqns3yyc4cty
There was a mention that a refactoring may be in the works for providers to be connected to the redux store. If this is the case, I'll fix my code/tests accordingly when it is resolved.

@saturninoabril
Copy link
Member

saturninoabril commented Oct 23, 2018

@mickmister Thanks for your contribution! I pulled out your branch and it's really weird that it's having that issue. I'll find time to see what's going on there.
But I guess it's right to wait till that on going refactor is completed.

@saturninoabril
Copy link
Member

@mickmister There's an initial change on SuggestionStore - https://github.com/mattermost/mattermost-webapp/pull/1932/files. Once merged, could you please try again and see if you're still having issue in importing the test. Thanks!

@mickmister
Copy link
Member Author

Awesome, will do!

@grundleborg
Copy link
Contributor

On the permissions question: you can use haveITeamPermission or haveICurrentTeamPermission to manage team-scoped permissions. If it's managing the channel though, you should use haveIChannelPermission instead.

However, you can go one better even than this. Instead of passing in a prop for this, you can use the <ChannelPermissionGate> component in the render function around the JSX elements that you want to depend on that permission. This is the preferred way to do permissions wherever possible. If you grep the source code for the relevant permissions gate component, you'll find many examples of how to use it.

@mickmister
Copy link
Member Author

mickmister commented Oct 30, 2018

Using ChannelPermissionGate is the better solution here. My intent was to keep the component as dumb as possible, but that doesn't mean that it shouldn't be doing the permission assertions. Passing a simple boolean to the component makes it easy to test (no permission setup required in the test), but the component isn't tested properly at that point. Using ChannelPermissionGate ends up with much cleaner code. Thank you for your feedback!

@mickmister
Copy link
Member Author

mickmister commented Nov 5, 2018

@saturninoabril

Once merged, could you please try again and see if you're still having issue in importing the test.

The import issue isn't happening anymore :)

There's an initial change on SuggestionStore - https://github.com/mattermost/mattermost-webapp/pull/1932/files.

I have my branch updated with the changes from the above PR. The Suggestion components are still using the global getState, so I think this PR is still on hold. Unless we want to proceed without connecting the component to redux.

@saturninoabril
Copy link
Member

Thanks @mickmister! For me, that on going efforts on redux migration is non-blocking for this PR. I'm good with how it's done right now. Let us know if PR is complete so we can proceed with the PM review. Thanks!

@esethna esethna added the Work in Progress Not yet ready for review label Nov 5, 2018
@esethna
Copy link
Contributor

esethna commented Nov 5, 2018

@mickmister please let me know when this is ready to test, looking forward to it!

@mickmister
Copy link
Member Author

@saturninoabril recent pushes address all of your requested changes

@mickmister mickmister changed the title [WIP] [MM-12396] Option to add user to a channel from the profile pop-over [MM-12396] Option to add user to a channel from the profile pop-over Nov 6, 2018
i18n/en.json Outdated Show resolved Hide resolved
@mickmister
Copy link
Member Author

@esethna PR is ready barring any further requested changes.

@esethna esethna added the Setup Old Test Server Triggers the creation of a test server label Nov 9, 2018
@mickmister
Copy link
Member Author

Awesome, thanks @saturninoabril!

@lindy65 lindy65 removed the 4: Reviews Complete All reviewers have approved the pull request label Dec 4, 2018
@lindy65 lindy65 added the Tests/Done Release tests have been written label Dec 14, 2018
@cpanato cpanato mentioned this pull request Dec 14, 2018
2 tasks
jwilander pushed a commit that referenced this pull request Dec 14, 2018
@amyblais amyblais modified the milestones: v5.6.0, v5.8.0 Jan 1, 2019
@JtheBAB JtheBAB mentioned this pull request Jan 15, 2019
9 tasks
@amyblais amyblais added Changelog/Done Required changelog entry has been written Docs/Needed Requires documentation labels Jan 23, 2019
jwilander added a commit that referenced this pull request Feb 5, 2019
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation and removed Changelog/Done Required changelog entry has been written Docs/Needed Requires documentation labels Feb 11, 2019
@mickmister
Copy link
Member Author

@hanzei There was an issue with this PR so it got reverted. I am working on a new PR for the fix. Should this issue be reopened or should a new issue be created?

@hanzei
Copy link
Contributor

hanzei commented Feb 14, 2019

Would you just open a new PR for this and I will reopen mattermost/mattermost#9501?

@mickmister
Copy link
Member Author

Yes, thank you @hanzei

jwilander added a commit that referenced this pull request Apr 9, 2019
bradjcoughlin pushed a commit to bradjcoughlin/mattermost-webapp that referenced this pull request Apr 15, 2019
tuannguyen041094 pushed a commit to Designveloper/mattermost-webapp that referenced this pull request Apr 21, 2019
TranMacTien pushed a commit to Designveloper/mattermost-webapp that referenced this pull request Jun 13, 2019
@mickmister mickmister deleted the MM-12396 branch August 24, 2022 04:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation Tests/Done Release tests have been written
Projects
None yet
9 participants