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

Company cards - After enabling company card, tapping new card directs to hmm not here page #56372

Open
3 of 8 tasks
lanitochka17 opened this issue Feb 4, 2025 · 3 comments
Open
3 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Overdue

Comments

@lanitochka17
Copy link

lanitochka17 commented Feb 4, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.94-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Go to workspace settings - more features - enable company card
  3. Tap members
  4. Tap admin - new card

Expected Result:

After enabling company card, tapping new card must not direct to hmm not here page

Actual Result:

After enabling company card, tapping new card directs to hmm not here page

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

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

Screenshots/Videos

Add any screenshot/video evidence
Bug6733491_1738693864435.Screenrecorder-2025-02-04-23-55-59-605.mp4

View all open jobs on GitHub

@lanitochka17 lanitochka17 added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Feb 4, 2025
Copy link

melvin-bot bot commented Feb 4, 2025

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

@Shahidullah-Muffakir
Copy link
Contributor

Shahidullah-Muffakir commented Feb 4, 2025

Proposal

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

After enabling company card, tapping new card directs to hmm not here page.

What is the root cause of that problem?

  1. The New Card button is shown based on these conditions:
    shouldShowCardsSection

    <MenuItem
    title={translate('workspace.expensifyCard.newCard')}
    icon={Expensicons.Plus}
    onPress={handleIssueNewCard}
    />

    The issue is that !!policy?.areExpensifyCardsEnabled is false.

  2. The IssueNewCardPage is only displayed if !!policy?.areExpensifyCardsEnabled is true:

    featureName={CONST.POLICY.MORE_FEATURES.ARE_EXPENSIFY_CARDS_ENABLED}

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

  1. Add a condition to show the New Card button only if !!policy?.areExpensifyCardsEnabled is true, like:
{!!policy?.areExpensifyCardsEnabled && (
    <MenuItem
        title={translate('workspace.expensifyCard.newCard')}
        icon={Expensicons.Plus}
        onPress={handleIssueNewCard}
    />
)}

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

We can write test for the WorkspaceMemberDetailsPage if the !!policy?.areExpensifyCardsEnabled is false, then the New Card button should not be displayed

What alternative solutions did you explore? (Optional)

Alternative 1:
If the !!policy?.areExpensifyCardsEnabled is false, we can disable the new card button, instead of hiding it.

Alternative 2:
If it is allowed for a user to add a new card if the !!policy?.areCompanyCardsEnabled is true, then we can add this condition here :

featureName={CONST.POLICY.MORE_FEATURES.ARE_EXPENSIFY_CARDS_ENABLED}

like:

            featureName={CONST.POLICY.MORE_FEATURES.ARE_EXPENSIFY_CARDS_ENABLED ||CONST.POLICY.MORE_FEATURES.ARE_COMPANY_CARDS_ENABLED }

@Krishna2323
Copy link
Contributor

Krishna2323 commented Feb 4, 2025

Proposal

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

Company cards - After enabling company card, tapping new card directs to hmm not here page

What is the root cause of that problem?

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

  • We should only show the "New card" button when hasMultipleFeeds or areExpensifyCardsEnabled is true.
{(policy.areExpensifyCardsEnabled || hasMultipleFeeds) && (
    <MenuItem
        title={translate('workspace.expensifyCard.newCard')}
        icon={Expensicons.Plus}
        onPress={handleIssueNewCard}
    />
)}
  • In addition, we also need to update the shouldShowCardsSection condition, currently it checks !!cardFeeds which will be always true since it contains a object with isLoading property, so we should check for any property in cardFeeds, and I think we should just change it to !!cardFeeds?.settings.
    const shouldShowCardsSection = (hasWorkspaceCardsAssigned || !!cardFeeds) && (!!policy?.areExpensifyCardsEnabled || !!policy?.areCompanyCardsEnabled);

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

NA

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Feb 7, 2025
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. Daily KSv2 Overdue
Projects
None yet
Development

No branches or pull requests

4 participants