-
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
Fix/34609: Remove old description page #35137
Conversation
const newComment = value.moneyRequestComment; | ||
// Only update comment if it has changed | ||
if (newComment.trim() !== lodashGet(transaction, 'comment.comment', '')) { | ||
if (isDraft) { | ||
IOU.setMoneyRequestDescription_temporaryForRefactor(transactionID, newComment, isDraft); | ||
} else { | ||
if (iouType === CONST.IOU.TYPE.REQUEST) { | ||
IOU.updateMoneyRequestDescription(transaction.transactionID, reportID, newComment.trim()); | ||
} | ||
if (iouType === CONST.IOU.TYPE.SPLIT) { | ||
IOU.setDraftSplitTransaction(transaction.transactionID, { | ||
comment: newComment.trim(), | ||
}); | ||
} | ||
} | ||
} |
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 expected to see all this logic handled in setMoneyRequestDescription_temporaryForRefactor
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.
Updated
if (props.isEditingSplitBill) { | ||
Navigation.navigate(ROUTES.EDIT_SPLIT_BILL.getRoute(props.reportID, props.reportActionID, CONST.EDIT_REQUEST_FIELD.DESCRIPTION)); | ||
if (!props.isEditingSplitBill) { | ||
return; | ||
} | ||
Navigation.navigate(ROUTES.MONEY_REQUEST_DESCRIPTION.getRoute(props.iouType, props.reportID)); | ||
Navigation.navigate( | ||
ROUTES.MONEY_REQUEST_STEP_DESCRIPTION.getRoute( | ||
CONST.IOU.ACTION.EDIT, | ||
CONST.IOU.TYPE.SPLIT, | ||
transaction.transactionID, | ||
props.reportID, | ||
Navigation.getActiveRouteWithoutParams(), | ||
), | ||
); |
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.
Why we are assuming that this is going to be used for edits only? (similar question for MoneyTemporaryForRefactorRequestConfirmationList.js
)
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.
@s77rt if props.isEditingSplitBill
is false, we will disable this field by this logic
interactive={!props.isReadOnly} |
Because of isReadOnly={!isEditingSplitBill}
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.
The isReadOnly is a different prop and we can't assume it will always be related to isEditingSplitBill.
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.
Why we are assuming that this is going to be used for edits only?
@s77rt In that time, there was only editing split bill that used this component and this component MoneyRequestConfirmationList also be removed in this refactor phrase. But you're right, we can't assume that this is going to be used for edits only. So I updated in this commit to remove condition
if (!props.isEditingSplitBill) {
return;
}
and using iouType as param of navigate function
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.
@DylanDylann Is there any need to change the logic there? Can't we just keep using the same logic (i.e. keep isEditingSplitBill conditions) and navigate to the correct pages?
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.
@s77rt We need to change logic to use a new route to IOURequestStepDescription
for both case. The above code is outdated. This is code after updating
Trying to edit a split bill request crashes the app, please make sure we are replacing all the old routes Screen.Recording.2024-01-26.at.7.20.13.PM.mov |
@s77rt I can't reproduce your bug so.mp4Could you help to point out the step to create this request? |
@s77rt Thanks for your commit suggestion. I updated |
@s77rt From your comment, I think we should revert this change in here. I agree with you that
But we have 3 cases when user enter description and click save button:
|
Note that in case 3: we only call |
We should update the transaction too same as we do with receipt |
Creating/Editing a split request => isDraft = true (and a comment explaining the reason) |
We still need to use Creating a split bill request => save to transactionDraft |
Is that the current behavior on main? Don't we save to splitTransactionDraft? |
@s77rt Do you know how to re-run Reassure Performance Tests ? |
I have seen this problem many times while implementing PR. I ofter merge the main and push a new commit to re-run Reassure Performance Tests |
Any new commits should trigger the test but it seems unstable, even after merging main it could still fail |
@s77rt What do you think about putting |
It may not help us well as we will still need to check if |
@s77rt I mean
to avoid the use withOnyx in IOURequestStepDescription and many other similar pages |
But we will be returning two transactions from |
Yes. I checked all the places that used withFullTransactionOrNotFound. And see that almost places also need to import splitDraftTransaction to handle similar case as we did here |
You can generally restart the either the failing tests or all the tests by clicking "Details" next to the failing test and selecting "Re-Run Jobs" at the top right. With that said, I restarted the failing job twice and it continued to fail. Can you please try pulling |
@DylanDylann I think it's fine to keep it that way for now. If anything a follow would be better than handling it here |
@deetergp All jobs are successful. Please help to check again |
@DylanDylann I just came here to say "It looks like the tests were fixed here" 😂 |
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.
Changes look good and test well 👍
✋ 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/deetergp in version: 1.4.39-0 🚀
|
This PR is failing because of issue #36175 The issue is reproducible in: IOS Android mWeb Bug6372489_1707422129564.Screen_Recording_20240209_032141_New_Expensify.1.mp4 |
CONST.IOU.TYPE.REQUEST, | ||
transaction?.transactionID ?? '', | ||
report.reportID, | ||
Navigation.getActiveRouteWithoutParams(), |
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 think this needs to be removed maybe?
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.39-8 🚀
|
Details
Remove MoneyRequestDescriptionPage and EditRequestDescriptionPage and only use IOURequestStepDescription for all description pages
Fixed Issues
$ #34609
PROPOSAL: #34609 (comment)
Tests
Offline tests
Same above
QA Steps
Same above
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.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
Android: Native
a1.mp4
a2.mp4
Android: mWeb Chrome
c.mp4
iOS: Native
i.mp4
iOS: mWeb Safari
s.mp4
MacOS: Chrome / Safari
w.mp4
MacOS: Desktop
d.mp4