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

[HOLD for payment 2024-12-20] [HOLD for payment 2024-12-19] [$250] Updating report action button in the case of held expenses #52569

Closed
JmillsExpensify opened this issue Nov 14, 2024 · 56 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2

Comments

@JmillsExpensify
Copy link

JmillsExpensify commented Nov 14, 2024

Based on this internal Slack discussion, we've decided that the approve button should be grey when all expenses on a report are held. This new feature makes sense for a couple of reasons:

  • We already use this grey button pattern for Submit when a workspace has automatic scheduled submit settings
  • When all expenses on a report a held, then the report is not GBRed for the admin, and as a result there is no required action on their part.
  • Conversely, when a report has a mix of held and non-held expenses, we do show GBR for the admin because they can (and probably should) action on the expenses that can be actioned on.

As a result, let's do the following:

  1. In the report thread, let's make the Approve or Pay buttons grey when all expenses on that report are held. Here's an example.
    image

  2. On the Search page, let's do the exact same thing, should a user end up seeing/finding this reports there instead.
    image

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021857475710560245957
  • Upwork Job ID: 1857475710560245957
  • Last Price Increase: 2024-11-15
  • Automatic offers:
    • NJ-2020 | Contributor | 105028413
Issue OwnerCurrent Issue Owner: @JmillsExpensify
Issue OwnerCurrent Issue Owner: @JmillsExpensify
@JmillsExpensify JmillsExpensify added Weekly KSv2 NewFeature Something to build that is a new item. labels Nov 14, 2024
@JmillsExpensify JmillsExpensify self-assigned this Nov 14, 2024
Copy link

melvin-bot bot commented Nov 14, 2024

Current assignee @JmillsExpensify is eligible for the NewFeature assigner, not assigning anyone new.

Copy link

melvin-bot bot commented Nov 14, 2024

⚠️ It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time ⚠️

Copy link

melvin-bot bot commented Nov 14, 2024

Triggered auto assignment to Design team member for new feature review - @dubielzyk-expensify (NewFeature)

@JmillsExpensify
Copy link
Author

Jon - please correct anything you don't agree with or would like to tweak in the OP. Once we're good, then I'll open up this issue to the community. Or @luacmartins let me know if this is better to take internal.

@daledah
Copy link
Contributor

daledah commented Nov 14, 2024

Edited by proposal-police: This proposal was edited at 2024-11-14 14:51:31 UTC.

Proposal

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

What is the root cause of that problem?

New feature

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

  1. Create the new util function named areAllTransactionsOnHold, it's use isOnHold inside
  2. In ReportPreview create the new variable:
const shouldDisablePayment = areAllTransactionsOnHold(transactions)
  1. Pass shouldDisablePayment to AnimatedSettlementButton and SettlementButton
  2. In SettlementButton, use shouldDisablePayment to disable all options in paymentButtonOptions and isDisabled

Do the same in MoneyReportHeader and other places

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 14, 2024
Copy link
Contributor

[@username] Your proposal will be dismissed because you did not follow the proposal template.

@luacmartins
Copy link
Contributor

I think this can be external

@dubielzyk-expensify
Copy link
Contributor

Feels right to me. Just minor update to making sure the search icon is still there and the system message is correct:
image

@NJ-2020
Copy link
Contributor

NJ-2020 commented Nov 15, 2024

Proposal

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

Show a grey approve/pay button when all expenses on a report are held

What is the root cause of that problem?

New feature

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

  • Create new variable inside ReportPreview to check if there's hold transactions using ReportUtils.hasHeldExpenses function
const hasHeldExpenses = ReportUtils.hasHeldExpenses(iouReportID);
  • Create new success prop inside Settlement button to determine if we should use success style for the button
    <ButtonWithDropdownMenu<PaymentType>
    success
  • We should use success style if there's no held expenses, else we will use the gray style
// ReportPreview.tsx
{shouldShowSettlementButton && (
    <AnimatedSettlementButton
        success={!hasHeldExpenses}
        onlyShowPayElsewhere={onlyShowPayElsewhere}


// SettlementButton.tsx
function SettlementButton({
    success = true,
    ...
}) {
    ...
    return (
        ...
        {(triggerKYCFlow, buttonRef) => (
            <ButtonWithDropdownMenu<PaymentType>
                success={success}
    )
}

And we can do the same approach for MoneyReportHeader and we will use moneyRequestReport?.reportID for iouReportID

const hasHeldExpenses = ReportUtils.hasHeldExpenses(moneyRequestReport?.reportID);

And for the Search page, we will do the same approach we will add new success prop to ActionCell component and we will pass true if it's not on hold

<ActionCell
action={item.action}

// TransactionListItemRow.tsx
const isOnHold = useMemo(() => TransactionUtils.isOnHold(item), [item]);

<ActionCell
    success={!isOnHold}

// ActionCell.tsx
function ActionCell({success = true, action = CONST.SEARCH.ACTION_TYPES.VIEW, isLargeScreenWidth = true, isSelected = false, goToItem, isChildListItem = false, parentAction = ''}: ActionCellProps) {
    ...
    <Button
        text={translate(actionTranslationsMap[CONST.SEARCH.ACTION_TYPES.VIEW])}
        success={success}    

Btw i am not seeing any approve button inside the search page, but if there's we can do like the above one

Result

Screen.Recording.2024-11-14.at.21.14.41.mov

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.

Show a gray approve/pay button if all the expenses are on hold.

What is the root cause of that problem?

Feature request.

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

First, create a new prop for SettlementButton called shouldUseSuccessStyle with a default value of true and use it as the success value here.

<ButtonWithDropdownMenu<PaymentType>
success

In MoneyReportHeader, pass !hasOnlyHeldExpenses to shouldUseSuccessStyle.

<SettlementButton
onlyShowPayElsewhere={onlyShowPayElsewhere}

shouldUseSuccessStyle={!hasOnlyHeldExpenses}

If we want to apply to report preview settlement button too, we can apply it the same here.

<AnimatedSettlementButton
onlyShowPayElsewhere={onlyShowPayElsewhere}

For search page, there is no action for approve/pay.

const actionTranslationsMap: Record<SearchTransactionAction, TranslationPaths> = {
view: 'common.view',
review: 'common.review',
done: 'common.done',
paid: 'iou.settledExpensify',
};

@luacmartins luacmartins self-assigned this Nov 15, 2024
@luacmartins luacmartins added the External Added to denote the issue can be worked on by a contributor label Nov 15, 2024
@melvin-bot melvin-bot bot changed the title Show a grey approve/pay button when all expenses on a report are held [$250] Show a grey approve/pay button when all expenses on a report are held Nov 15, 2024
Copy link

melvin-bot bot commented Nov 15, 2024

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

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

melvin-bot bot commented Nov 15, 2024

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

@mananjadhav
Copy link
Collaborator

Will review this by tomorrow.

@JmillsExpensify
Copy link
Author

JmillsExpensify commented Nov 19, 2024

Thanks, it'd be good to get this one going as it's affecting production customers.

@melvin-bot melvin-bot bot added the Overdue label Nov 19, 2024
@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Nov 19, 2024
@quinthar
Copy link
Contributor

Yep, this is a good one!

@mananjadhav
Copy link
Collaborator

@NJ-2020's proposal looks good to me.

🎀 👀 🎀 C+ reviewed.

@melvin-bot melvin-bot bot added the Weekly KSv2 label Dec 13, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-12-19] [$250] Updating report action button in the case of held expenses [HOLD for payment 2024-12-20] [HOLD for payment 2024-12-19] [$250] Updating report action button in the case of held expenses Dec 13, 2024
Copy link

melvin-bot bot commented Dec 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.75-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-12-20. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Dec 13, 2024

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@mananjadhav] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

@garrettmknight garrettmknight moved this from Bugs and Follow Up Issues to Hold for Payment in [#whatsnext] #expense Dec 17, 2024
@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Dec 18, 2024
@JmillsExpensify
Copy link
Author

JmillsExpensify commented Dec 20, 2024

Payment summary:

@melvin-bot melvin-bot bot removed the Overdue label Dec 20, 2024
@JmillsExpensify
Copy link
Author

Contributor has been paid, so all that remains is the BZ checklist.

@melvin-bot melvin-bot bot added the Overdue label Dec 23, 2024
Copy link

melvin-bot bot commented Dec 24, 2024

@JmillsExpensify, @mananjadhav, @luacmartins, @NJ-2020, @dubielzyk-expensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Dec 26, 2024

@JmillsExpensify, @mananjadhav, @luacmartins, @NJ-2020, @dubielzyk-expensify Huh... This is 4 days overdue. Who can take care of this?

@mananjadhav
Copy link
Collaborator

mananjadhav commented Dec 26, 2024

Apologies, I was out sick, still getting back.

I think this would be more of a feature request than a bug. We're also reverting this in a separate issue so I think we don't need a regression test here.

@JmillsExpensify I think this was involved in a regression.

Copy link

melvin-bot bot commented Dec 30, 2024

@JmillsExpensify, @mananjadhav, @luacmartins, @NJ-2020, @dubielzyk-expensify 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

@JmillsExpensify
Copy link
Author

@mananjadhav so you're saying that the correct payment summary is $125 each?

@melvin-bot melvin-bot bot removed the Overdue label Dec 30, 2024
@mananjadhav
Copy link
Collaborator

Yes @JmillsExpensify. The payout should be $125 each.

@JmillsExpensify
Copy link
Author

Updated above and processed the update via Upwork as well.

@NJ-2020
Copy link
Contributor

NJ-2020 commented Dec 30, 2024

Done

@JmillsExpensify
Copy link
Author

Thanks so much for the quick response!

@JmillsExpensify
Copy link
Author

@mananjadhav I'm going to close this for your part, though don't forget the BZ checklist before requesting payment.

@github-project-automation github-project-automation bot moved this from Hold for Payment to Done in [#whatsnext] #expense Dec 30, 2024
@mananjadhav
Copy link
Collaborator

I think this would be more of a feature request than a bug. We're also reverting this in a separate issue so I think we don't need a regression test here.

@JmillsExpensify Considering this is more towards a feature request and also being reverted, do we need a BZ checklist here?

@garrettmknight
Copy link
Contributor

$250 approved for @mananjadhav

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2
Projects
Status: Done
Development

No branches or pull requests

9 participants