Filter Expensify team members from workspace members CSV export#82866
Filter Expensify team members from workspace members CSV export#82866
Conversation
Build the members CSV client-side when employee list data is available, applying the same isExpensifyTeam filtering that the member list UI already uses. This prevents @expensify.com and @team.expensify.com accounts (such as account managers) from appearing in the exported CSV. Co-authored-by: Lydia Barclay <lydiabarclay@users.noreply.github.com>
Co-authored-by: Lydia Barclay <lydiabarclay@users.noreply.github.com>
|
Fixed the failing Prettier check. The long import line in |
…t rule Co-authored-by: Lydia Barclay <lydiabarclay@users.noreply.github.com>
|
Fixed the failing |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
Seeing what this updated and the new logic, I think this change should be in the backend. I asked Melvin in the issue to make the relevant changes |
Explanation of Change
The workspace members CSV export in New Expensify includes Expensify account managers (e.g.,
@expensify.comand@team.expensify.comemails) in the exported file, even though they are filtered from the members list UI. Classic Expensify filters these members in both views.This PR builds the CSV client-side on web when the employee list data is available, applying the same
isExpensifyTeam()filtering that the members list UI uses. On native platforms (or when data is unavailable), it falls back to the existing server-sideExportMembersCSVAPI.Changes:
escapeCSVField()helper for proper CSV field escapingbuildFilteredMembersCSV()that constructs the CSV while filtering out Expensify team members (unless the policy owner or current user is on an Expensify domain)downloadMembersCSV()to accept employee list data and generate the CSV client-side on webWorkspaceMembersPage.tsxto pass the required dataFixed Issues
$ https://github.com/Expensify/Expensify/issues/600539
Tests
@expensify.comor@team.expensify.com) does NOT appear in the CSV@expensify.comemail, repeat steps 2-5 and verify Expensify team members ARE included (since the owner is on an Expensify domain)Offline tests
When offline, the download button should be disabled (existing behavior, unchanged by this PR). The client-side CSV generation does not make network requests, but the button is already gated by
isOffline.QA Steps
@expensify.comor@team.expensify.comemails appear@expensify.comaccount and verify Expensify team members are includedPR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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
Android: Native
N/A — No UI changes, only CSV export content filtering
Android: mWeb Chrome
N/A — No UI changes, only CSV export content filtering
iOS: Native
N/A — No UI changes, only CSV export content filtering
iOS: mWeb Safari
N/A — No UI changes, only CSV export content filtering
MacOS: Chrome / Safari
N/A — No UI changes, only CSV export content filtering