Skip to content

[Due for payment 2025-03-27] Add approvals switch is locked&disabled after reenabling Workflows when Smart limit is selected #57998

Closed

Description

@IuliiaHerets

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.1.10-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): applausetester+ps309@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Workspace has Expensify Card feature.
  • User has assigned a virtual card to themselves (Limit type should not be Smart limit).
  • Add approvals feature is enabled.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Expensify Card.
  3. Click on any card.
  4. Click Limit type.
  5. Select Smart limit and save it.
  6. Go to Workflows.
  7. Note that Add approvals switch is enabled and locked.
  8. Go to More features.
  9. Disable and reenable Workflows.
  10. Go to Workflows.

Expected Result:

Add approvals switch should not be locked.

Actual Result:

Add approvals switch is disabled and locked. User will have to change the Limit type in order to unlock the switch.

In this case, the message asks to change the limit type before "disabling" approvals, when it is already disabled and locked.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6763738_1741336218611.20250307_162316.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @MitchExpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerCashThis issue or pull request should block deployment
    on Mar 7, 2025
  2. melvin-bot commented on Mar 7, 2025

    @melvin-bot

    Triggered auto assignment to @MitchExpensify (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.

  3. melvin-bot commented on Mar 7, 2025

    @melvin-bot

    Triggered auto assignment to @cristipaval (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. melvin-bot commented on Mar 7, 2025

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on Mar 7, 2025

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. IuliiaHerets commented on Mar 7, 2025

    @IuliiaHerets
    Author

    Not repro on production

    screen-20250307-111250.mp4
  7. daledah commented on Mar 7, 2025

    @daledah
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-03-07 10:16:52 UTC.

    Proposal

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

    Add approvals switch is disabled and locked. User will have to change the Limit type in order to unlock the switch.

    What is the root cause of that problem?

    We don't have any logic to disable workflow button here

    {
    icon: Illustrations.Workflows,
    titleTranslationKey: 'workspace.moreFeatures.workflows.title',
    subtitleTranslationKey: 'workspace.moreFeatures.workflows.subtitle',
    isActive: policy?.areWorkflowsEnabled ?? false,
    pendingAction: policy?.pendingFields?.areWorkflowsEnabled,
    action: (isEnabled: boolean) => {
    if (!policyID) {
    return;
    }
    enablePolicyWorkflows(policyID, isEnabled);
    },
    },

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

    1. We should disbale workflow button while we have isSmartLimitEnabled
        const [cardList] = useOnyx(`${ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST}`);
        const workspaceCards = getAllCardsForWorkspace(workspaceAccountID, cardList);
        const isSmartLimitEnabled = isSmartLimitEnabledUtil(workspaceCards);
    
        ... 
    
            {
                icon: Illustrations.Workflows,
                disabled: isSmartLimitEnabled,
            },
    
    1. And we can add disabledAction to show warning modal like we did with others, the modal content will be confirmed later.

    const onDisabledOrganizeSwitchPress = useCallback(() => {
    if (!hasAccountingConnection) {
    return;
    }
    setIsOrganizeWarningModalOpen(true);
    }, [hasAccountingConnection]);

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

    None UI bug

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  8. daledah commented on Mar 7, 2025

    @daledah
    Contributor

    @cristipaval I can quickly raise a PR if needed.

  9. 70 remaining items

  10. daledah commented on Apr 1, 2025

    @daledah
    Contributor

    @daledah can you apply to this job as a next step please? https://www.upwork.com/jobs/~021907069798744476418

    When I click the job link, it shows:
    Image

    @MitchExpensify can you send an offer directly to me https://www.upwork.com/freelancers/~0138d999529f34d33f

    Thanks

  11. MitchExpensify commented on Apr 6, 2025

    @MitchExpensify
    Contributor
  12. daledah commented on Apr 7, 2025

    @daledah
    Contributor

    @MitchExpensify Accepted thx!

  13. MitchExpensify commented on Apr 8, 2025

    @MitchExpensify
    Contributor

    Paid, thank you!

  14. nkdengineer commented on Apr 24, 2025

    @nkdengineer
    Contributor

    @MitchExpensify i have not been paid in this issue as this comment. Could you please check again?

  15. dominictb commented on Apr 24, 2025

    @dominictb
    Contributor

    @MitchExpensify I also did not receive payment.

  16. MitchExpensify commented on May 5, 2025

    @MitchExpensify
    Contributor

    Oh apologies, I must have got my wires crossed!

    Offer sent @nkdengineer: https://www.upwork.com/nx/wm/offer/107183174

    What is your Upwork profile @dominictb ?

  17. nkdengineer commented on May 5, 2025

    @nkdengineer
    Contributor

    @MitchExpensify Accepted the offer, thanks for your help!

  18. dominictb commented on May 5, 2025

    @dominictb
    Contributor
  19. MitchExpensify commented on May 11, 2025

    @MitchExpensify
    Contributor
  20. dominictb commented on May 13, 2025

    @dominictb
    Contributor

    @MitchExpensify Accepted, thanks 🙏

  21. MitchExpensify commented on May 13, 2025

    @MitchExpensify
    Contributor

    Paid, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions