-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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] |
src/pages/ReportParticipantsPage.js
Outdated
@@ -75,7 +75,7 @@ const getAllParticipants = (report, personalDetails) => { | |||
tooltipText: userLogin, | |||
participantsList: [{login, displayName: userPersonalDetail.displayName}], | |||
}); | |||
}); | |||
}).value(); |
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.
}).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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good @eVoloshchak, I'll add these changes.
Updated! |
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.
Tests aren't passing still but otherwise looking good
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.
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 |
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.
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
participants
from areport
they'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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android