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

[WIP] changeview/manage members dialog to use multiselect component consist… #100

Closed
wants to merge 2 commits into from

Conversation

xjlim
Copy link

@xjlim xjlim commented Oct 3, 2017

Summary

Change View/Manage members dialog to be consistent with 'Add members to team' dialog

Ticket Link

Issue
Jira

Checklist

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

  • Added or updated unit tests (required for all new features)
  • Has server changes (please link)
  • Has redux changes (please link)
  • Has UI changes
  • Includes text changes and localization file (.../i18n/en.json and .../webapp/i18n/en.json) updates
  • Touches critical sections of the codebase (auth, posting, etc.)

@mattermod
Copy link
Contributor

Thanks @xjlim for the pull request!

Per the CONTRIBUTING.md file displayed when you created this pull request, we need to add you to the list of approved contributors for the Mattermost project.

Please help complete the Mattermost contribution license agreement?

This is a standard procedure for many open source projects. Your form should be processed within 24 hours and reviewers for your pull request will be able to proceed.

Please let us know if you have any questions.

We are very happy to have you join our growing community! If you're not yet a member, please consider joining our Contributors community channel to meet other contributors and discuss new opportunities with the core team.

const user = Object.assign({}, users[i]);
user.value = user.id;
user.label = '@' + user.username;
users[i] = user;
Copy link
Member

Choose a reason for hiding this comment

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

A bit of an early review, but there's a few things to note here:

  1. We should never be mutating data that comes from the store. It should be treated as immutable even though JavaScript makes that hard to enforce it
  2. On top of that, nothing in the state should be changed without setState since React uses that to know if should redraw parts of the app
  3. The render function should never have any side effects (in this case, changing the state). It ideally should just take the state/props of the component and return whatever it renders as without touching or looking at anything else.

What you'll want to do here instead is, as you're filling up usersToDisplay, you'll also want to create a corresponding values array which has the corresponding IDs for each user in it, and then pass that to the MultiSelect

@hmhealey hmhealey self-requested a review October 4, 2017 17:14
@xjlim
Copy link
Author

xjlim commented Oct 4, 2017

Right now for both view/manage dialog, user can search to filter the list and navigate up/down on the list. What is the expected behavior when user presses the enter key on the multiselect component?

@hmhealey
Copy link
Member

hmhealey commented Oct 4, 2017

^ @jasonblais

@jasonblais
Copy link
Contributor

@xjlim ENTER should open the dropdown menu for the user that's in focus in the Manage Members modal, as it does now.

image

In View Members modal, ENTER shouldn't take any action.

@xjlim
Copy link
Author

xjlim commented Oct 4, 2017

the up/down navigation might conflict with the dropdown up/down. should up/down not work for the dropdown then

image

@jasonblais
Copy link
Contributor

jasonblais commented Oct 4, 2017

@xjlim Yeah I think the up/down arrows should work on the dropdown.

But you raise a good point as it's not obvious how you can get back to scrolling through the users list when focus is on the dropdown. Hmm. Do you have any thoughts on that?

I'll think about it too, I hadn't thought about that case earlier.

@xjlim
Copy link
Author

xjlim commented Oct 4, 2017

i was thinking that the user can 'esc'ape out of the dropdown, but 'esc' by default will dismiss the dialog.

@hmhealey
Copy link
Member

hmhealey commented Oct 5, 2017

Maybe it doesn't make sense to use the multiselect for that modal? I know we have that on the mobile app, but you can only remove members with it so it's fine there. This has more options in a dropdown, so I don't know if it works here

@jasonblais
Copy link
Contributor

@hmhealey I don't think we'll use multiselect in the modal the same way.

Functionally the only change should be that you can navigate through the users list with up/down arrow keys to change the selected user in the list. My understanding was that this was simplest to achieve by changing the "View/Manage Members" dialog to use the same UI component as "Add Members to Team".

Is there a better way to achieve this?

@xjlim Thanks for your patience here,

@jasonblais jasonblais self-assigned this Oct 5, 2017
@jasonblais
Copy link
Contributor

@xjlim Terribly sorry for the late response here.

Would it be feasible to have the escape key close the dropdown, without dismissing the dialog? I think that would be most natural. The second escape key would then dismiss the dialog.

If that is not tehcnically feasible, we could consider other options like the left arrow key going back to the user list.

Again, really apologize for the delay here @xjlim. I'll make sure to be more responsive.

@jasonblais
Copy link
Contributor

@xjlim Let me know if you have any questions about the above comment?

@xjlim
Copy link
Author

xjlim commented Oct 30, 2017

@jasonblais I believe it won't be easy to do the first case as that involves changing bootstrap modal default escape behaviour. I will try the second option.

@jasonblais
Copy link
Contributor

Hey @xjlim , let me know if there's anything we can help with?

@xjlim
Copy link
Author

xjlim commented Nov 16, 2017

@jasonblais Sorry, I have gotten busy. I will try to pick it up this weekend. I believed I was stuck trying to figure out how to toggle the dropdown of each row within the dialog and found that there are some inconsistency in the design. Some dialogs use the react bootstrap modal wrapper with props to show/hide while others use ref to directly call show/hide the modal instance.

@jasonblais
Copy link
Contributor

@xjlim No worries - if you have any further questions, don't hesitate to ask in the Contributors or Developers channel at https://pre-release.mattermost.com

@jasonblais
Copy link
Contributor

@xjlim Closing due to inactivity. If you'd still be interested to work on the ticket, let us know and we'd be more than happy to help.

@jasonblais jasonblais closed this Jan 2, 2018
@lindalumitchell lindalumitchell added the Tests/Not Needed Does not require new release tests label Jan 4, 2018
hmhealey pushed a commit that referenced this pull request Aug 28, 2020
Include cleaning action_types folder
hmhealey pushed a commit that referenced this pull request Mar 17, 2021
Include cleaning action_types folder
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Hacktoberfest Tests/Not Needed Does not require new release tests Work in Progress Not yet ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants