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] Expensify Card - "Add shipping details" button still appears when the card is deactivated #50693

Open
6 tasks done
IuliiaHerets opened this issue Oct 13, 2024 · 15 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 Reviewing Has a PR in review Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Oct 13, 2024

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.48-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  • User has assigned a physical card to self.
  • Private details have not been added.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Expensify Card.
  3. Click on the Expensify Card that is assigned to yourself.
  4. Click Deactivate card.
  5. Deactivate the card.
  6. Go to workspace chat.

Expected Result:

"Add shipping details" button will not appear since the card is deactivated.

Actual Result:

"Add shipping details" button still appears when the card is deactivated.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6633297_1728811970050.20241013_172918.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021846577574853745828
  • Upwork Job ID: 1846577574853745828
  • Last Price Increase: 2024-10-16
  • Automatic offers:
    • hoangzinh | Reviewer | 104523414
    • truph01 | Contributor | 104523417
Issue OwnerCurrent Issue Owner: @hoangzinh
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 13, 2024
Copy link

melvin-bot bot commented Oct 13, 2024

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

@IuliiaHerets
Copy link
Author

We think that this bug might be related to #wave-collect - Release 2

@IuliiaHerets
Copy link
Author

@zanyrenney FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@truph01
Copy link
Contributor

truph01 commented Oct 13, 2024

Edited by proposal-police: This proposal was edited at 2024-10-16 16:42:03 UTC.

Proposal

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

"Add shipping details" button still appears when the card is deactivated.

What is the root cause of that problem?

  • We show the "Add shipping card" butotn without checking if the card is deactivated or not:

const shouldShowAddMissingDetailsButton = action?.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS && missingDetails && isAssigneeCurrentUser;

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

  • Should check whether the card is existed/actived or not:
  const cardIssuedActionOriginalMessage = ReportActionsUtils.isActionOfType(
        action,
        CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED,
        CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED_VIRTUAL,
        CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS,
    )
        ? ReportActionsUtils.getOriginalMessage(action)
        : undefined;
    const cardID = cardIssuedActionOriginalMessage?.cardID ?? -1;
    const isPolicyAdmin = PolicyUtils.isPolicyAdmin(PolicyUtils.getPolicy(policyID));
    const card = isPolicyAdmin ? cardsList?.[cardID] : cardList[cardID];
    const shouldShowAddMissingDetailsButton = !isEmptyObject(card) && action?.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS && missingDetails && isAssigneeCurrentUser;

What alternative solutions did you explore? (Optional)

@zanyrenney
Copy link
Contributor

Agreed, this button shouldn't be there!

@zanyrenney zanyrenney added the External Added to denote the issue can be worked on by a contributor label Oct 16, 2024
@melvin-bot melvin-bot bot changed the title Expensify Card - "Add shipping details" button still appears when the card is deactivated [$250] Expensify Card - "Add shipping details" button still appears when the card is deactivated Oct 16, 2024
Copy link

melvin-bot bot commented Oct 16, 2024

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

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

melvin-bot bot commented Oct 16, 2024

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

@SWS-5007
Copy link

Hi, Here is my suggestion.

  1. Check card Status:
    Before rendering the "Add shipping details" button, we should check the status of the card if it is active or deactivated.
    We can add conditional statement that checks the card's activate status.

  2. Check Backend:
    We should ensure that Backend properly sends the card's status in the response.

  3. Modify Frontend:
    In the Frontend, we can update code handling the display of button like below:

// Assuming `card` is the card object and `card.status` indicates if it's active
const shouldShowAddShippingDetailsButton = (card) => {
    return card.status === 'active' && !card.hasShippingDetails;
};

if (shouldShowAddShippingDetailsButton(card)) {
    // Show the button
} else {
    // Hide the button
}
  1. Update Existing Logic:
    Maybe, we can add an additional condition in the existing card rendering functions or React Components.

If we discuss more details about current issue and help me to check your codebase as soon, I can provide with better solution.
Good luck!

Copy link

melvin-bot bot commented Oct 16, 2024

📣 @SWS-5007! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@hoangzinh
Copy link
Contributor

@SWS-5007 Thanks for your proposal. Please follow proposal template here https://github.com/Expensify/App/blob/main/contributingGuides/PROPOSAL_TEMPLATE.md

@hoangzinh
Copy link
Contributor

@truph01's proposal looks good to me.

Link to proposal #50693 (comment)

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Oct 18, 2024

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

Copy link

melvin-bot bot commented Oct 21, 2024

@hoangzinh, @jasperhuangg, @zanyrenney Whoops! This issue is 2 days overdue. Let's get this updated quick!

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

melvin-bot bot commented Oct 21, 2024

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

Offer link
Upwork job

Copy link

melvin-bot bot commented Oct 21, 2024

📣 @truph01 🎉 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 📖

@melvin-bot melvin-bot bot removed the Overdue label Oct 21, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review and removed Daily KSv2 labels Oct 22, 2024
@melvin-bot melvin-bot bot added the Weekly KSv2 label Oct 22, 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 Reviewing Has a PR in review Weekly KSv2
Projects
Status: Release 3: Fall 2024 (Nov)
Development

No branches or pull requests

6 participants