[Search v1] Add bulk actions#44385
Conversation
|
@WojtekBoman FYI the PR for |
|
👋 @WojtekBoman how are you getting on here? Just a heads up that the basic CSV export project is a critical deliverable for GBTA (conference) on July 22nd. As the work to add the selection checkboxes to the Search page has begun with this PR, it's now effectively a blocker to getting that project complete before the conference. We're starting on imp today, and @rlinoz will work on the backend in the meantime, but it would be good to clear this dependency ASAP. |
|
@WojtekBoman given this is a blocker and the hold/unhold commands are not ready yet. Let's implement only Delete for now and we add hold/unhold as a follow up |
|
Great idea! |
|
@DylanDylann Please 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] |
@luacmartins I don't know if we should address these 2 cases. If so, could we create followups and merge this PR? I'll be OOO from 03.07 to 08.07 and wouldn't like to hold CSV export. |
Yea, I think addressing them as follow ups is fine. That being said, I'm unsure if we need to address them too. I think yes for the delete confirm modal, but no for the scroll checkbox issue. |
luacmartins
left a comment
There was a problem hiding this comment.
Left a few comments. I'll get this PR merged since none of them are blockers. Let's address them in a follow up though!
| value: CONST.SEARCH.BULK_ACTION_TYPES.HOLD, | ||
| onSelected: () => { | ||
| clearSelectedItems?.(); | ||
| SearchActions.holdMoneyRequestOnSearch(hash, itemsToHold, ''); |
There was a problem hiding this comment.
We'll still need to redirect the user to the reason page. Maybe that's something that @Kicu can address in his PR?
src/components/Search/index.tsx
Outdated
| return ( | ||
| <> | ||
| <SearchPageHeader | ||
| selectedItems={{}} |
There was a problem hiding this comment.
Could we just add a default to the component prop instead of passing this empty object? This just looks odd.
src/components/Search/index.tsx
Outdated
| return ( | ||
| <> | ||
| <SearchPageHeader | ||
| selectedItems={{}} |
|
@WojtekBoman we have conflicts |
Solved :) |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
I will go over this PR and address any followups required in a separate PR |
|
@luacmartins about this:
Here is a small possibile future issue that I would like to discuss. Right now when displaying the Reason modal for 1 hold, we pass the However if we also want to display the same modal for bulk actions, then there is no limit to the amount of transactions a user can check. If we continue to pass them, we would have to change url to something like: Any other way of handling this would have to involve onyx I guess, where we save the selection in onyx, navigate to RHP hold reason page and then read from onyx. I would like for this RHP screen for Hold to work the same whether it's 1 transaction or bulk transactions, so I think I would create a new PR for this tomorrow, once we agree on a solution. |
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.0.4-0 🚀
|
|
@Kicu that's an issue and I agree that we should use the same page for all these actions. I think we could either go the Onyx route or React context to keep this in state since it doesn't really need to be persisted. Maybe creating a hook for it would be good, e.g. |
|
🚀 Cherry-picked to staging by https://github.com/tgolen in version: 9.0.4-5 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.5-13 🚀
|
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.6-8 🚀
|
| isChildListItem | ||
| isDisabled={!!isDisabled} | ||
| canSelectMultiple={!!canSelectMultiple} | ||
| isButtonSelected={item.isSelected} |
There was a problem hiding this comment.
there was a design issue Individually selected expense rows in grouped reports don't have a background color applied to them, we fixed it #45384 by checking transaction.isSelected instead of item.isSelected
| } | ||
|
|
||
| function deleteMoneyRequestOnSearch(hash: number, transactionIDList: string[]) { | ||
| const {optimisticData, finallyData} = getOnyxLoadingData(hash); |
There was a problem hiding this comment.
Coming from #66028, we also need to optimistically mark a transaction as deleted to avoid it being still displayed after deletion. More details here: #66028 (comment)

Details
This PR adds support for bulk actions in the Search tab.
Screen.Recording.2024-07-01.at.17.33.55.mov
Fixed Issues
$ #39887
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
This functionality is only supported on wide screen.
MacOS: Chrome / Safari
Screen.Recording.2024-07-01.at.17.33.55.mov
MacOS: Desktop
Screen.Recording.2024-07-02.at.17.04.12.mov