-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix split expense page is not found when editing a split expense with policy workflow disabled #79274
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
base: main
Are you sure you want to change the base?
Conversation
…flow disabled Signed-off-by: Tsaqif <[email protected]>
Signed-off-by: Tsaqif <[email protected]>
Signed-off-by: Tsaqif <[email protected]>
…pense page Signed-off-by: Tsaqif <[email protected]>
Signed-off-by: Tsaqif <[email protected]>
Signed-off-by: Tsaqif <[email protected]>
Signed-off-by: Tsaqif <[email protected]>
|
@alitoshmatov 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f7303d45d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: Tsaqif <[email protected]>
Signed-off-by: Tsaqif <[email protected]>
| } | ||
|
|
||
| if (isExpenseSplit && isSplitAvailable) { | ||
| if (isExpenseSplit) { |
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.
To show edit split page, I am reverting this change from #77911 because the expected behavior should follow this: #75472 (comment)
Signed-off-by: Tsaqif <[email protected]>
Signed-off-by: Tsaqif <[email protected]>
|
Bugs on
Video:refresh.mp4
Video:adding_split_done.mp4
|
|
|
||
| const isEditingSplitExpense = !!Number(splitExpenseTransactionID); | ||
| const splitTransactionIOUAction = getIOUActionForTransactions([splitExpenseTransactionID], expenseReport?.reportID).at(0); | ||
| const canEditSplitExpense = canEditFieldOfMoneyRequest(splitTransactionIOUAction, CONST.EDIT_REQUEST_FIELD.AMOUNT); |
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.
I am using canEditFieldOfMoneyRequest because I think it is the proper way to check whether a user can edit a money request, and it is also used in MoneyRequestView.
isSplitAction is in ReportSecondaryActionUtils.ts and is used to determine whether the Split action menu (secondary actions / More menu, etc.) is available for a transaction. I think modifying it to check whether a user can edit a split expense would be incorrect and could affect the secondary action menu behavior.
|
@alitoshmatov PR is ready |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 813fd6018f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| isSelected: splitExpenseTransactionID === item.transactionID, | ||
| keyForList: item?.transactionID, | ||
| isEditable: (item.statusNum ?? 0) < CONST.REPORT.STATUS_NUM.CLOSED, | ||
| isEditable: isEditingSplitExpense ? canEditSplitExpense : (item.statusNum ?? 0) < CONST.REPORT.STATUS_NUM.CLOSED, |
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.
Preserve per-item editability when editing splits
When isEditingSplitExpense is true, every split item’s isEditable is forced to the single canEditSplitExpense value, which ignores each item’s own statusNum (derived from its report in initSplitExpenseItemData). In a mixed-status split (e.g., one item approved/settled while another remains open), this makes all items editable or non‑editable together, so closed items can be opened for edit or open items get blocked. Consider combining canEditSplitExpense with the per‑item statusNum (or computing permissions per item) so editability reflects each split’s report state.
Useful? React with 👍 / 👎.
Explanation of Change
Fixed Issues
$ #77179
PROPOSAL: #77179 (comment)
Tests
Precondition: Workspace workflow is disabled.
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Precondition: Workspace workflow is disabled.
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))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
android_native_d.mp4
Android: mWeb Chrome
android_mweb_d.mp4
iOS: Native
ios_native_d.mp4
iOS: mWeb Safari
ios_msafari_d.mp4
MacOS: Chrome / Safari
macos_web_d.mp4