Skip to content

Submit button is green on the Reports page, when it should be grey/button color #55076

Closed

Description

@JmillsExpensify

Problem

We're showing conflicting colors for the Submit button based on the view. For instance, on the Reports page, you can see that this Submit button is green.

CleanShot 2025-01-10 at 15 54 09@2x

Clicking into the same report, the Submit button is correctly showing as grey/button color, as the report is scheduled to be automatically submitted.

CleanShot 2025-01-10 at 15 55 00@2x

Solution

The Search page should be using the grey/button color, consistent with the report header.

cc @luacmartins since we've messed with this logic recently. I'll still open this up for external unless you decide otherwise.

Issue OwnerCurrent Issue Owner: @parasharrajat

Activity

  1. added
    External
    Daily
    Bug
    on Jan 10, 2025
  2. added
    Help Wanted
    on Jan 10, 2025
  3. melvin-bot commented on Jan 10, 2025

    @melvin-bot

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

  4. melvin-bot commented on Jan 10, 2025

    @melvin-bot

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

  5. NJ-2020 commented on Jan 10, 2025

    @NJ-2020
    Contributor

    I think we need to hold for this #54732

  6. self-assigned this
    on Jan 10, 2025
  7. luacmartins commented on Jan 10, 2025

    @luacmartins
    Contributor

    Agree to put a hold for #54732

  8. changed the title [-]`Submit` button is green on the `Reports` page, when it should be grey/button color[/-] [+][HOLD App #54732] `Submit` button is green on the `Reports` page, when it should be grey/button color[/+] on Jan 10, 2025
  9. bernhardoj commented on Jan 10, 2025

    @bernhardoj
    Contributor

    Proposal

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

    Submit button is green on the Reports page even though it's scheduled to be automatically submitted.

    What is the root cause of that problem?

    We don't have any logic to turn it to gray when the expense is scheduled to be automatically submitted, compared to the money report header.

    const isWaitingForSubmissionFromCurrentUser = useMemo(
    () => chatReport?.isOwnPolicyExpenseChat && !policy?.harvesting?.enabled,
    [chatReport?.isOwnPolicyExpenseChat, policy?.harvesting?.enabled],
    );

    <Button
    success={isWaitingForSubmissionFromCurrentUser}

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

    The ActionCell already has a prop called shouldUseSuccessStyle (it will be removed in #54732 but we can just re-add it) which we can control to either show it as green or gray. The value depends on !policy?.harvesting?.enabled, just like on the report header.

    shouldUseSuccessStyle={!policy?.harvesting?.enabled}
    

    We need to apply it to all these places. The policy will be from the item.policyID

    {!isLargeScreenWidth && (
    <ExpenseItemHeaderNarrow
    participantFrom={participantFrom}
    participantFromDisplayName={participantFromDisplayName}
    participantTo={participantTo}
    participantToDisplayName={participantToDisplayName}
    action={reportItem.action}
    onButtonPress={handleOnButtonPress}
    containerStyle={[styles.ph3, styles.pt1half, styles.mb1half]}
    isLoading={reportItem.isActionLoading}
    shouldUseSuccessStyle={!hasHeldExpenses}
    />

    <ActionCell
    action={reportItem.action}
    shouldUseSuccessStyle={!hasHeldExpenses}

    shouldUseSuccessStyle={!isOnHold}

    <ActionCell
    action={item.action}
    shouldUseSuccessStyle={!isOnHold}

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    We can create a UI test to make sure it's shown as green if harvesting is disabled and gray otherwise.

  10. melvin-bot commented on Jan 14, 2025

    @melvin-bot

    @JmillsExpensify, @luacmartins, @parasharrajat Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  11. 13 remaining items

  12. parasharrajat commented on Feb 11, 2025

    @parasharrajat
    Member

    I will start reviewing on above confirmation.

  13. parasharrajat commented on Feb 12, 2025

    @parasharrajat
    Member

    @bernhardoj proposal looks good to me.

    🎀 👀 🎀 C+ reviewed

  14. melvin-bot commented on Feb 12, 2025

    @melvin-bot

    Current assignee @luacmartins is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

  15. luacmartins commented on Feb 12, 2025

    @luacmartins
    Contributor

    We're actually revamping the expected behavior for action buttons as part of the #migrate: Simplified Actions Framework for all Reports project. So I think we should just close this issue for now. @JmillsExpensify what do you think?

  16. melvin-bot commented on Feb 18, 2025

    @melvin-bot

    @JmillsExpensify, @luacmartins, @parasharrajat Huh... This is 4 days overdue. Who can take care of this?

  17. parasharrajat commented on Feb 18, 2025

    @parasharrajat
    Member

    @JmillsExpensify What do you think?

  18. melvin-bot commented on Feb 24, 2025

    @melvin-bot

    @JmillsExpensify, @luacmartins, @parasharrajat Huh... This is 4 days overdue. Who can take care of this?

  19. JmillsExpensify commented on Feb 26, 2025

    @JmillsExpensify
    ContributorAuthor

    Yes, agreed. Let's just close this one now.

  20. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyExternalHelp Wanted

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions