-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat: add reimbursable toggle to create expense flow #59209
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
Conversation
Currently facing some troubles building Android, I'll upload the screenshot later. |
cc @Expensify/design for review too |
The toggle in the create expense flow is looking good to me, but I'm also curious about why it's not in the details view after the expense has been created. |
100% should be there when applicable.
Then there's some rules around when it can be edited on the expense... The toggle should abide by the same permission logic as the date and amount fields when it comes to editing, which I believe is as follows:
|
🚧 @trjExpensify has triggered a test app build. You can view the workflow run here. |
@trjExpensify @Expensify/design in those situations where it should be there but it's not editable, should we still show it, but show it with the lock? I feel like that's how I would expect it to show up (since we also still show the other non-editable fields in those views). |
Yeah, I think that makes sense to me too |
Yeah, I think we can show it with a lock if we want. Equally, we could just have it disabled from editing displaying as on/off depending on what it was before moving into a state where you can't edit it anymore. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
Oh yeah, the lock makes sense to me in those instances |
@trjExpensify Should I implement the toggle in the report details now? In the issue we agreed that this is out of scope so I didn't make any changes. If we decide to implement the toggle, as in my proposal:
So we're gonna need some BE changes |
Oh, must have misunderstood that comment. When you said inside the "expense report" I thought you were talking about some new feature at the expense report level. We for sure need to add the toggle at the "expense" level. |
I also misunderstood your comment the @daledah. I like @trjExpensify suggestion of showing the toggle disabled from editing displaying as on/off depending on what it was before moving into a state where you can't edit it anymore. |
@trjExpensify @flaviadefaria So the next step here should be:
Does that look correct to you? Also, should the point 4 above be applied for create expense flow as well? Or should we keep current behavior? |
Looks good to me @daledah! Regarding:
I believe we should keep the current behavior. A user should be able to toggle off reimbursable expenses unless there is a special setting enabled (such as force non-reimbursable for cards or always reimbursable/always non-reimbursable). Does this make sense? Does this sound correct @trjExpensify? |
On OldDot we don't show the toggle (checkbox) at all if the setting is Always Reimbursable or Always non-reimbursable. I think the design team suggestion was to use the lock for the cases where the selection can no longer be changed. I.e a submitter after their report is approved by at least one person. |
Just to confirm, are we blocked here on the backend changes? |
Yea, we'll need backend changes to implement this. I've reached out to Issa and pointed to my comment here: #58588 (comment) |
Cool, I also tagged them on the weekly updated in Slack but saw they were OoO. Hopefully they'll respond today when they're back. |
Hiya, Will provide an update once it makes it to staging, so daledah can keep working on it. |
Hi @inimaga, just checking in - has BE changes made it to production yet? I'm ready to continue my FE work once it's live. |
Will review 👍 |
seems like we've a conflict @daledah |
@daledah think you can handle this today? I'd love to get this merged by tomorrow. |
@flaviadefaria @getusha Sorry for the delay, conflicts resolved. Note that |
@daledah I think, the toggle should be enabled by default, regardless of whether it's explicitly set to 'Default Reimbursable' from oldDot. |
These are the options we have in NewDot and how they should map in NewDot: |
If all looks correct now, then it would be great to get this merged today. |
I think we're well-aligned with design now |
@getusha any other concerns here? |
@daledah can you resolve the ESLint issues and complete the author checklist so this can be merged ASAP. |
Okay noted. Re-ran the check and all good. Proceeding with merge. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
@inimaga looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Yes, maybe i misunderstood but even for new workspaces Reimbursable isn't enabled by default. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Oh that's a good catch, I agree that reimbursable should be enabled by default for a new workspace. |
Regarding failing test from @MelvinBot, failing as per comment here: #59209 (comment), failing due to |
@daledah we'll need to handle this in a separate PR as this one is now merged. |
@inimaga I've handled this in this commit - policy created has |
@daledah could you invite a member and test from the non-admin side? |
In this case I think we should make BE changes to send correct |
Explanation of Change
Fixed Issues
$ #58588
PROPOSAL: #58588 (comment)
Tests
Cross-platform consistency test:
In OD, go to Workspace -> Expenses
Change the field Cash expenses are to different values
Verify the changes in ND matches the condition:
If
Default reimbursable
is set via OldDot, show the toggle enabled by default on expense creation.If
Default non-reimbursable
is set via OldDot, show the toggle disabled by default on expense creation.If
Always non-reimbursable
is set via OldDot, don't show the toggle at all and create the cash expense as non-reimbursable.If
Always reimbursable
is set via OldDot, don't show the toggle at all and create the cash expense as reimbursable.Offline tests
QA Steps
Cross-platform consistency test:
In OD, go to Workspace -> Expenses
Change the field Cash expenses are to different values
Verify the changes in ND matches the condition:
If
Default reimbursable
is set via OldDot, show the toggle enabled by default on expense creation.If
Default non-reimbursable
is set via OldDot, show the toggle disabled by default on expense creation.If
Always non-reimbursable
is set via OldDot, don't show the toggle at all and create the cash expense as non-reimbursable.If
Always reimbursable
is set via OldDot, don't show the toggle at all and create the cash expense as reimbursable.PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.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 and/or tagged@Expensify/design
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
Android: mWeb Chrome
Screen.Recording.2025-03-27.at.18.28.10.mov
iOS: Native
Screen.Recording.2025-03-27.at.18.29.58.mov
iOS: mWeb Safari
Screen.Recording.2025-03-27.at.18.30.53.mov
MacOS: Chrome / Safari
Screen.Recording.2025-03-27.at.18.35.59.mp4
Screen.Recording.2025-03-27.at.18.39.10.mp4
MacOS: Desktop
Screen.Recording.2025-03-27.at.18.31.20.mp4