Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.57k stars 2.91k forks source link

Expensify Card - "Assigned cards is missing in profile unless Expensify Card is opened first #52951

Open IuliiaHerets opened 6 hours ago

IuliiaHerets commented 6 hours ago

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.0.65-4 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: applausetester+kh081111@applause.expensifail.com Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Members.
  3. Click on self profile.
  4. Note that there is Assigned cards section.
  5. Log out and log in.
  6. Go to workspace settings > Members.
  7. Click on self profile.
  8. Note that Assigned cards section is missing.
  9. Go to Expensify Card.
  10. Repeat Step 6 and 7.
  11. Now Assigned cards section shows up.

Expected Result:

In Step 8. Assigned cards section should appear without having to visit Expensify Card page first.

Actual Result:

In Step 8. Assigned cards section does not appear when Expensify Card page is not visited first. It only appears after visiting Expensify Card page in Step 11.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/4e96e8c1-df06-4041-ab88-43461c8ea6ac

View all open jobs on GitHub

melvin-bot[bot] commented 6 hours ago

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.

mkzie2 commented 5 hours ago

Proposal

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

Assigned cards only appears after visiting Expensify Card page.

What is the root cause of that problem?

OpenWorkspaceMembersPage does not return the cardList for that workspace.

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

We need to manually call OpenPolicyExpensifyCardsPage API in either workspace members page or workspace member details page.

https://github.com/Expensify/App/blob/a8154c46aaadca4f78d3bdf1747177ef4927eea9/src/pages/workspace/WorkspaceMembersPage.tsx#L190-L196

https://github.com/Expensify/App/blob/7b790110a0ecb46a8816b50d1cae60e8edef4e3e/src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx#L88-L90

etCoderDysto commented 4 hours ago

Edited by proposal-police: This proposal was edited at 2024-11-22 11:59:31 UTC.

Proposal

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

Assigned cards is missing in profile unless Expensify Card is opened first

What is the root cause of that problem?

When the user opens WorkspaceMemberDetailsPage before opening ExpensifyCardsPage, expensifyCards becomes undefined since Policy.openPolicyExpensifyCardsPage is not called yet. https://github.com/Expensify/App/blob/2166dffba5b3f0283d5cf2d9f0b700749c8fdcf1/src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx#L65 And assigned cards won't be displayed https://github.com/Expensify/App/blob/2166dffba5b3f0283d5cf2d9f0b700749c8fdcf1/src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx#L311-L319

There are more similar issues:

  1. On More features' page of a workspaceExpensify Cardradio button won't be locked sinceONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST` is not loaded yet. https://github.com/Expensify/App/blob/2166dffba5b3f0283d5cf2d9f0b700749c8fdcf1/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx#L114-L118
  2. On Profile page of a workspace This will remove all card feeds and assigned cards. message on Delete workspace modal won't be displayed since ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST is not loaded yet.

https://github.com/Expensify/App/blob/2166dffba5b3f0283d5cf2d9f0b700749c8fdcf1/src/pages/workspace/WorkspaceProfilePage.tsx#L63

Video for the other issues https://github.com/user-attachments/assets/e5942780-38d8-47ef-9999-a1e97cf2949e

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

https://github.com/user-attachments/assets/7a11b354-26e0-495e-951f-387b67062317