-
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
Feat: Editable billable flag #27875
Feat: Editable billable flag #27875
Conversation
@robertKozik 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] |
Reviewer Checklist
Screenshots/Videos |
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.
Thanks for quick changes. Approving!
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.
Just a few minor requests to code changes, however, could you also include the system message code in this PR as well? It should be a pretty light lift. The spec is:
If billable status is changed post request creation, we’ll add a system message in the request’s thread, so there’s a history of the change and who made it.
If changed to billable, the system message copy is
Changed the request to billable (previously non-billable.)
If changed to non-billable, the system message copy is
Changed the request to non-billable (previously billable.)
If you're not comfortable with that or have questions let me know! You can take a look at the changes in ReportUtils in https://github.com/Expensify/App/pull/27950/files for an idea of how to do it!
@amyevans Updated all your comments! |
Posted in our Slack thread as well, but am not seeing the appropriate system message when testing (offline for now, since backend changes are still pending). Could you take a look? |
@amyevans |
Ah I see where the disconnect is. The system message should appear on the transaction thread, not the expense report Screen.Recording.2023-09-26.at.8.23.28.AM.mov |
@amyevans Ahhh, get it, sorry for this disconnection.. |
Thanks! |
@amyevans Finally found that I was sending wrong reportID, from transaction, but not from report itself, thats why message was appearing in the expense report, now it works fine |
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.
Thanks! Just one minor update then good to go!
@amyevans Done! |
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.
🚀
✋ 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/amyevans in version: 1.3.75-0 🚀
|
@amyevans @robertKozik is this still behind beta? |
@kavimuru yes it's behind beta! |
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.75-12 🚀
|
🚀 Deployed to staging by https://github.com/amyevans in version: 1.3.76-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.76-6 🚀
|
@@ -225,6 +230,16 @@ function MoneyRequestView({report, betas, parentReport, policyCategories, should | |||
/> | |||
</OfflineWithFeedback> | |||
)} | |||
{shouldShowBillable && ( | |||
<View style={[styles.flexRow, styles.mb4, styles.justifyContentBetween, styles.alignItemsCenter, styles.ml5, styles.mr8]}> |
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 padding was inconsistent here. #30821
<Switch | ||
accessibilityLabel={translate('common.billable')} | ||
isOn={transactionBillable} | ||
onToggle={(value) => IOU.editMoneyRequest(transaction.transactionID, report.reportID, {billable: value})} |
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.
At the time of writing this code. IOU.editMoneyRequest
was only used for regular money requests. If we call this function on a distance money request it won't work as expected (regression: #31128). There was another function IOU.updateDistanceRequest
that we should have called in that case.
PS: Now IOU.editMoneyRequest
is unified to handle both regular and distance money requests.
@@ -225,6 +230,16 @@ function MoneyRequestView({report, betas, parentReport, policyCategories, should | |||
/> | |||
</OfflineWithFeedback> | |||
)} | |||
{shouldShowBillable && ( | |||
<View style={[styles.flexRow, styles.mb4, styles.justifyContentBetween, styles.alignItemsCenter, styles.ml5, styles.mr8]}> | |||
<Text color={!transactionBillable ? themeColors.textSupporting : undefined}>{translate('common.billable')}</Text> |
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 conditional color of the label here led to this issue:
which was fixed by removing the style completely.
Details
This PR is to view and edit a billable toggle on an already created money request.
To create a money request please insert this to App.js with your policyID you are testing:
And you need beta - newDotTags
Fixed Issues
$ #26793
PROPOSAL: #26793 (comment)
Tests
Offline tests
Same as tests
QA Steps
None
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)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android