Move selected transactions#61839
Conversation
|
@MarioExpensify 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] |
|
@waterim I used your implementation here and move UI to separate component. I think you'll work on follow up so please don't be surprised 😅 @sumo-slonik I slightly modified logic here so please take a look 😇 cc @luacmartins |
|
@waterim I made a mistake and wrote that I'll work on follow up 😅 I think you're the one who's doing it so I don't want to interfere 😅 but of course I can help with it :D |
| const policyID = policyIDToCheck ?? getPolicyIDFromState(navigationRef.getRootState() as State<RootNavigatorParamList>); | ||
| const policyMemberAccountIDs = getPolicyEmployeeAccountIDs(policyID); | ||
| const shouldOpenAllWorkspace = isEmptyObject(targetReport) ? true : !doesReportBelongToWorkspace(targetReport, policyMemberAccountIDs, policyID); | ||
| isNavigationReady().then(() => { |
There was a problem hiding this comment.
This change was approved by @WojtekBoman himself 🙇
luacmartins
left a comment
There was a problem hiding this comment.
Looking good. Left a few minor comments
There was a problem hiding this comment.
This asset doesn't seem to follow the same pattern as others. @jnowakow did you just extract it directly from figma?
There was a problem hiding this comment.
Yes and then I removed attributes that were not present in assets/images/document-plus.svg
There was a problem hiding this comment.
I think we have a different process to export these assets. @Expensify/design could you please assist?
There was a problem hiding this comment.
Yeah, who exported this? Did it come from the design team or not?
There was a problem hiding this comment.
Yeah, who exported this? Did it come from the design team or not?
I don't think so, I think @jnowakow just got it from figma
src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx
Outdated
Show resolved
Hide resolved
| options.push({ | ||
| text: 'Move Expenses', | ||
| icon: Expensicons.DocumentMerge, | ||
| value: 'MOVE', |
There was a problem hiding this comment.
Let's use a const for this, probably declared in CONST.REPORT.SECONDARY_ACTIONS.MOVE_TRANSACTIONS
There was a problem hiding this comment.
I'll declare it as const on top of the file because it's ignored anyway
| const policyID = policyIDToCheck ?? getPolicyIDFromState(navigationRef.getRootState() as State<RootNavigatorParamList>); | ||
| const policyMemberAccountIDs = getPolicyEmployeeAccountIDs(policyID); | ||
| const shouldOpenAllWorkspace = isEmptyObject(targetReport) ? true : !doesReportBelongToWorkspace(targetReport, policyMemberAccountIDs, policyID); | ||
| isNavigationReady().then(() => { |
|
|
||
| function IOURequestEditReportCommon({backTo, transactionReport, selectReport}: Props) { | ||
| const {translate} = useLocalize(); | ||
| const [allReports] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {selector: (c) => mapOnyxCollectionItems(c, reportSelector), canBeMissing: true}); |
There was a problem hiding this comment.
I know this is not your code, but what is c? Can we use a better variable name in this case?
|
Where do we have the most up-to-date videos for review? Otherwise we can make a test build when this is ready too. Just let us know! |
|
🚧 @luacmartins has triggered a test app build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
Screen.Recording.2025-05-14.at.9.56.24.AM.mov |
It was done this way before so I didn't alter this behaviour |
allgandalf
left a comment
There was a problem hiding this comment.
I also cannot reproduce the second bug with new report! thanks
|
@luacmartins @trjExpensify should it be possible to move all expenses from submitted report? It leads to situation where there's a report without expenses and there's no option to add expense to it Screen.Recording.2025-05-14.at.10.50.16.mov |
|
Ahh okey after #61465 is merged it will be possible to bring expenses back but this |
|
Hmm interesting, I would think that in that case above, we should probably just delete the report since it no longer has expenses on it? Curious what Tom thinks though. |
Yeah, it seems pretty unlikely that someone is going to move all expenses off a report and then add new ones to that old report? Curious what Tom thinks though for sure. |
Yea, this is possible.
We don't do this in OldDot, so I don't think we should start it now. Let's just keep the empty report. |
| const canMoveExpense = canEditFieldOfMoneyRequest(iouReportAction, CONST.EDIT_REQUEST_FIELD.REPORT); | ||
|
|
||
| return canMoveExpense; |
There was a problem hiding this comment.
NAB
| const canMoveExpense = canEditFieldOfMoneyRequest(iouReportAction, CONST.EDIT_REQUEST_FIELD.REPORT); | |
| return canMoveExpense; | |
| return canEditFieldOfMoneyRequest(iouReportAction, CONST.EDIT_REQUEST_FIELD.REPORT); |
|
@jnowakow we have conflicts |
|
@luacmartins 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. |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.1.46-12 🚀
|
| const currentUserPersonalDetails = useCurrentUserPersonalDetails(); | ||
| const [searchValue, debouncedSearchValue, setSearchValue] = useDebouncedState(''); | ||
|
|
||
| const expenseReports = getOutstandingReportsForUser(transactionReport?.policyID, transactionReport?.ownerAccountID ?? currentUserPersonalDetails.accountID, allReports ?? {}); |
There was a problem hiding this comment.
We need to exclude reports from deleted workspaces when moving transactions. We fixed this in #62552






Explanation of Change
Fixed Issues
$ #61770
PROPOSAL: N/A
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR 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))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
Android: mWeb Chrome
android-web.mov
iOS: Native
iOS: mWeb Safari
ios.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop