Skip to content
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

[$250] Submit expense RHP doesn't include workspaces from Track flow #51552

Open
shawnborton opened this issue Oct 28, 2024 · 28 comments
Open

[$250] Submit expense RHP doesn't include workspaces from Track flow #51552

shawnborton opened this issue Oct 28, 2024 · 28 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review

Comments

@shawnborton
Copy link
Contributor

shawnborton commented Oct 28, 2024

Problem:
When you Track an expense, you can then submit it to someone. However, the list of contacts shown on this screen differs from the same contacts you would see if you first chose Submit expense from global create.

Track sees this:
image

Submit sees this:
image

Solution:
Let's make sure the Submit expense RHP flow looks identical no matter if you chose Track or Submit. This will fix the inconsistency in the product, and it also helps our chances for conversion as it unhides submitting an expense to a workspace from this flow.

cc @anmurali @JmillsExpensify to file this one, I think it is a #convert issue

We should also fix #52249 (comment) as part of this issue

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021850835832011853233
  • Upwork Job ID: 1850835832011853233
  • Last Price Increase: 2024-10-28
  • Automatic offers:
    • FitseTLT | Contributor | 104698445
Issue OwnerCurrent Issue Owner: @hoangzinh
@shawnborton shawnborton added External Added to denote the issue can be worked on by a contributor Bug Something is broken. Auto assigns a BugZero manager. labels Oct 28, 2024
@melvin-bot melvin-bot bot changed the title Submit expense RHP doesn't include workspaces from Track flow [$250] Submit expense RHP doesn't include workspaces from Track flow Oct 28, 2024
Copy link

melvin-bot bot commented Oct 28, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021850835832011853233

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 28, 2024
Copy link

melvin-bot bot commented Oct 28, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (External)

Copy link

melvin-bot bot commented Oct 28, 2024

Triggered auto assignment to @sonialiap (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added the Daily KSv2 label Oct 28, 2024
@NJ-2020
Copy link
Contributor

NJ-2020 commented Oct 28, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Submit expense RHP doesn't include workspaces from Track flow

What is the root cause of that problem?

We do not include here for track expense

includeOwnedWorkspaceChats: (iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.CREATE || iouType === CONST.IOU.TYPE.SPLIT) && action !== CONST.IOU.ACTION.SUBMIT,

What changes do you think we should make in order to solve the problem?

We should include track expense as well

includeOwnedWorkspaceChats: (iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.CREATE || iouType === CONST.IOU.TYPE.SPLIT || iouType === CONST.IOU.TYPE.TRACK) && action !== CONST.IOU.ACTION.SUBMIT,

Result

Screenshot 2024-10-28 at 03 07 00

What alternative solutions did you explore? (Optional)

@bernhardoj
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

The Submit to someone track option opens a participant page without including workplace chat.

What is the root cause of that problem?

We are currently excluding workspace from the participant list if the ACTION is SUBMIT.

includeOwnedWorkspaceChats: (iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.CREATE || iouType === CONST.IOU.TYPE.SPLIT) && action !== CONST.IOU.ACTION.SUBMIT,

What changes do you think we should make in order to solve the problem?

Remove the action SUBMIT condition

includeOwnedWorkspaceChats: (iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.CREATE || iouType === CONST.IOU.TYPE.SPLIT) && action !== CONST.IOU.ACTION.SUBMIT,

&& action !== CONST.IOU.ACTION.SUBMIT

But I have a concern. The action currently reads "Submit it to someone". Is workspace considered "someone"? If not, I think we should rephrase it.
image

@FitseTLT
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Submit expense RHP doesn't include workspaces from Track flow

What is the root cause of that problem?

We are currently not allowing workspaces through the Submit it to someone operation so we disallow the option for distance requests if P2P distance is not enabled

...(!TransactionUtils.isDistanceRequest(TransactionUtils.getTransaction(transactionID ?? '-1')) || canUseP2PDistanceRequests

and in participants we are not including workspaces if the action is submit
includeOwnedWorkspaceChats: (iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.CREATE || iouType === CONST.IOU.TYPE.SPLIT) && action !== CONST.IOU.ACTION.SUBMIT,

What changes do you think we should make in order to solve the problem?

  1. we need to remove this condition here to allow the option to be visible for distance requests even if the P2P is disabled

    ...(!TransactionUtils.isDistanceRequest(TransactionUtils.getTransaction(transactionID ?? '-1')) || canUseP2PDistanceRequests

  2. remove the submit action condition here

    includeOwnedWorkspaceChats: (iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.CREATE || iouType === CONST.IOU.TYPE.SPLIT) && action !== CONST.IOU.ACTION.SUBMIT,

            includeOwnedWorkspaceChats: iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.CREATE || iouType === CONST.IOU.TYPE.SPLIT,

What alternative solutions did you explore? (Optional)

@hoangzinh
Copy link
Contributor

we need to remove this condition here to allow the option to be visible for distance requests even if the P2P is disabled

Hi, @FitseTLT could you elaborate on this one? I'm unable to create a track expense with Distance request

Screenshot 2024-10-29 at 17 39 56

@FitseTLT
Copy link
Contributor

@hoangzinh Quite odd, I can create a distance track expense even without enabling beta

2024-10-29.14-27-05.mp4

@hoangzinh
Copy link
Contributor

My bad, I adjusted the code in Permission file 😮‍💨. Hey @FitseTLT, instead of removing above condition, is it better if we pass the iouType here

const {canUseP2PDistanceRequests} = usePermissions();

@FitseTLT
Copy link
Contributor

I am not following you @hoangzinh Why would we need to pass the iouType?

@hoangzinh
Copy link
Contributor

Because we're allowing P2PDistanceRequests if it's a track request

function canUseP2PDistanceRequests(betas: OnyxEntry<Beta[]>, iouType: IOUType | undefined): boolean {
// Allow using P2P distance request for TrackExpense outside of the beta, because that project doesn't want to be limited by the more cautious P2P distance beta
return !!betas?.includes(CONST.BETAS.P2P_DISTANCE_REQUESTS) || canUseAllBetas(betas) || iouType === CONST.IOU.TYPE.TRACK;
}

@FitseTLT
Copy link
Contributor

@hoangzinh Here is some detail for context:
Submit it to someone button was intended to create requests to personal/DM users not workspaces so if the tracked expense is a distance request it wouldn't make sense to have the submit it to someone button even if we had it, it would lead us to the participants page with empty list because we don't allow P2P distance requests unless the beta is enabled

includeP2P: (canUseP2PDistanceRequests || iouRequestType !== CONST.IOU.REQUEST_TYPE.DISTANCE) && !isCategorizeOrShareAction,

but now that, in this issue, we are allowing worspaces, we can allow the submit it to someone button whether the beta is enabled or not.
I hope this will clear it up for you.

@hoangzinh
Copy link
Contributor

hoangzinh commented Oct 30, 2024

I saw your point. Thanks @FitseTLT Agreed we can remove that condition

@hoangzinh
Copy link
Contributor

hoangzinh commented Oct 30, 2024

@FitseTLT's proposal looks good to me. He pointed out the correct root cause. Also provided a solution that would solve all Track type

Link to proposal #51552 (comment)

🎀👀🎀 C+ reviewed

@hoangzinh
Copy link
Contributor

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Oct 30, 2024

Triggered auto assignment to @luacmartins, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@FitseTLT
Copy link
Contributor

FitseTLT commented Nov 1, 2024

bump for assignment @luacmartins

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 1, 2024
Copy link

melvin-bot bot commented Nov 1, 2024

📣 @FitseTLT 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@FitseTLT
Copy link
Contributor

FitseTLT commented Nov 1, 2024

@luacmartins I think now the copy Submit it to someone doesn't make sense as we are including workspaces in this issue so it should be changed to something like Submit it WDYT. Whatever text you recommend we will need a translation, so can you add the Waiting for copy label? Thx

@luacmartins
Copy link
Contributor

IMO that still makes sense since you submit it to someone in your company. I think we can leave the copy as is for now.

@melvin-bot melvin-bot bot added the Overdue label Nov 4, 2024
@FitseTLT
Copy link
Contributor

FitseTLT commented Nov 4, 2024

@shawnborton WDYT about the ^

@shawnborton
Copy link
Contributor Author

I don't feel strongly, I can see an argument to just shorten the copy to "Submit it" but I think the idea is to match the exact copy used in the whisper, which is "Submit it to someone" right?

@FitseTLT
Copy link
Contributor

FitseTLT commented Nov 4, 2024

I don't feel strongly, I can see an argument to just shorten the copy to "Submit it" but I think the idea is to match the exact copy used in the whisper, which is "Submit it to someone" right?

I am talking about the whisper, should we change it?

Copy link

melvin-bot bot commented Nov 4, 2024

@hoangzinh, @sonialiap, @luacmartins, @FitseTLT Whoops! This issue is 2 days overdue. Let's get this updated quick!

@shawnborton
Copy link
Contributor Author

I think we just leave the copy as it is for now. cc @jamesdeanexpensify @anmurali @danielrvidal in case you have strong feelings. Tldr; is that @FitseTLT is suggesting to change "Submit it to someone" to be just "Submit it" from the whisper (and now details view once this issue is implemented):
CleanShot 2024-11-05 at 09 04 22@2x

I don't feel strongly.

@jamesdeanexpensify
Copy link
Contributor

I think it's fine to keep as is

@luacmartins
Copy link
Contributor

We should also fix this bug as part of this issue

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Nov 29, 2024
Copy link

melvin-bot bot commented Nov 29, 2024

This issue has not been updated in over 15 days. @hoangzinh, @sonialiap, @luacmartins, @FitseTLT eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot added the Monthly KSv2 label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

8 participants