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

GroupView: Add a User #1402

Merged
merged 10 commits into from
Sep 21, 2017
Merged

GroupView: Add a User #1402

merged 10 commits into from
Sep 21, 2017

Conversation

lukebarnard1
Copy link
Contributor

@lukebarnard1 lukebarnard1 commented Sep 20, 2017

  • Add "Add a User/Room" buttons and always display default lists
  • Implement UserPickerDialog for adding users
  • Add users to group summary using new API
  • Implement avatar, displayname for featured users
  • Disable "Add a Room" button for when we have a room picker
    2017-09-20-170818_588x671_scrot

if (!success) return;
addrs.map((addr) => {
return MatrixClientPeg.get()
.addUserToGroupSummary(this.props.groupId, addr.address);
Copy link
Member

Choose a reason for hiding this comment

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

You're using map here and returning the promise, but then discarding the result - if you're not interested in the result, forEach may be better suited. That said, we should probably display an error if any of them failed, so we should probably not be ignoring the results (https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/GroupInvite.js#L43 is where I did this fwiw)

// Add avatar once we get profile info inline in the summary response
//const BaseAvatar = sdk.getComponent("avatars.BaseAvatar");
const BaseAvatar = sdk.getComponent("avatars.BaseAvatar");
const name = this.props.summaryInfo.displayname || this.props.summaryInfo.user_id.slice(1);
Copy link
Member

Choose a reason for hiding this comment

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

why the slice(1)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah. I hadn't noticed that _getInitialLetter ignores the "@".

this.setState({
busy: false,
});
});
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be fetching the group user list once and then doing a client-side filter when the query changes rather than waiting until you type something and then displaying the whole group user list?

Copy link
Contributor Author

@lukebarnard1 lukebarnard1 Sep 21, 2017

Choose a reason for hiding this comment

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

I would argue that it's best to get the group list frequently and avoid early optimisation (so that the user doesn't have to close and open the dialog once someone has accepted the invite to a group, for example). But yes. I totally forgot to actually implement the filtering. 🤦‍♂️

@dbkr dbkr merged commit 60d444b into develop Sep 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants