Sort participants in report participants and workspace invite page#17421
Conversation
|
@eVoloshchak @amyevans One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| participantsList: [{login, displayName: userPersonalDetail.displayName}], | ||
| }); | ||
| }); | ||
| }).value(); |
There was a problem hiding this comment.
| }).value(); | |
| }).sortBy(participant => participant.displayName.toLowerCase()).value(); |
I think we should sort participants by displayName, that's how we do it on WorkspaceMembersPage
And .toLowerCase() to avoid issues similar to #16925
There was a problem hiding this comment.
There is also no sorting on WorkspaceInvitePage, we can add it so it's consistent across the screens
There was a problem hiding this comment.
Sounds good @eVoloshchak, I'll add these changes.
|
Updated! |
amyevans
left a comment
There was a problem hiding this comment.
Tests aren't passing still but otherwise looking good
eVoloshchak
left a comment
There was a problem hiding this comment.
Looks good and tests well on all platforms
As for the failing test, I think the problem is we're calling getMemberInviteOptions here to get the options, but it doesn't return displayName for each item (by design). It uses createOption under the hood.
I think we can resolve this by including displayName in the returned result, meaning add
result.displayName = personalDetail.displayName;below this line
|
@eVoloshchak @amyevans I just discovered a bug here https://github.com/Expensify/App/blob/main/src/pages/workspace/WorkspaceInvitePage.js#L116, when there is no
and we end up not showing the workspace members in the invite page, though I couldn't reproduce it live, it consistently happens for me locally. This can be easily fixed this way |
I'm not sure, I just had to re-order the items to get the test to pass now that we also sort members in the invite page, and brought back |
Reviewer Checklist
Screenshots/Videos |
eVoloshchak
left a comment
There was a problem hiding this comment.
Looks good and tests well
Hmm, I think the logic is working as intended - essentially we should exclude users who are already on the policy from the list of people you could invite, unless it's pending delete, in which case perhaps you want to invite them back so we should show them. You can look at the commit where it was introduced (and also the PR/GH from there). We could be more explicit by adding Doing |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/amyevans in version: 1.3.16-0 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.16-7 🚀
|
2 similar comments
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.16-7 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.16-7 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.16-7 🚀
|












To make things consistent with how we display members in the invite page, let's also sort participants of a report. The personalDetails we fetch from the backend happen to already be sorted, but when we grab the
participantsfrom areportthey're not sorted.The sorting added about 3ms in a chat report with about 6k participants, so I think performance wise this is negligible.
Details
Fixed Issues
$ #16509
Tests
Offline tests
Same as the online tests above.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android