App icon indicating copy to clipboard operation
App copied to clipboard

[Hold for E/E #399936] Add plan changes to Subscriptions

Open garrettmknight opened this issue 1 year ago • 6 comments

Part of the Workspace Downgrades project

Main issue: https://github.com/Expensify/Expensify/issues/399936 Project: Workspace Downgrades

Feature Description

  1. Update the Your plan section of the Subscriptions page to show both plan types with the current, highest plan type the account is an admin of highlighted/selected.
  2. If the user selects the other plan type, we'll check whether they're an admin on one or more workspaces:
  • If they're only an admin of one workspace we can just upgrade or downgrade that workspace from here we'll:
    • If the user is on Collect and selects Control, we'll launch the Upgrade RHP
    • If the user is on Control and selects Collect, we'll launch the Downgrade RHP
  • If they're an admin on multiple workspaces, they'll need to upgrade or downgrade their workspaces individually:
    • If the user is on Collect and selects Control, we'll launch an RHP directing the user to workspaces to upgrade
    • If the user is on Control and selects Collect, we'll launch an RHP directing the user to workspaces to downgrade

Copy for options above in this Figma here

Manual Test Steps

Single Workspace Upgrade

  1. Create a new account
  2. Create a workspace
  3. Navigate to subscriptions
  4. Click on 'Control'
  5. Confirm Upgrade RHP opens
  6. Click 'Upgrade'
  7. Confirm your workspace has been upgraded

Single Workspace Downgrade (follow Single Workspace Upgrade steps first)

  1. Navigate to subscriptions
  2. Click on 'Collect'
  3. Confirm Downgrade RHP opens
  4. Click 'Downgrade'
  5. Confirm your workspace has been downgraded

Multi Workspace Upgrade (follow Single Workspace Upgrade + Downgrade steps first)

  1. Create an additional workspace
  2. Navigate to subscriptions
  3. Click on 'Control'
  4. Confirm Upgrade RHP opens for multi workspaces
  5. Click 'Go to Workspaces'
  6. Confirm you're sent to workspace page
  7. Upgrade a workspace
  8. Navigate back to Subscriptions and confirm 'Control' is selected

Multi Workspace Upgrade (follow Multi Workspace Upgrade steps first)

  1. Navigate to subscriptions
  2. Click on 'Collect'
  3. Confirm Downgrade RHP opens for multi workspaces
  4. Click 'Go to Workspaces'
  5. Confirm you're sent to workspace page
  6. Downgrade the Control workspace
  7. Navigate back to Subscriptions and confirm 'Collect' is selected

Automated Tests

N/A

garrettmknight avatar Nov 14 '24 17:11 garrettmknight

Triggered auto assignment to @joekaufmanexpensify (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

melvin-bot[bot] avatar Nov 14 '24 17:11 melvin-bot[bot]

Still very excited for this one.

JmillsExpensify avatar Nov 19 '24 12:11 JmillsExpensify

Hoping to prioritize this week while things are quiet.

garrettmknight avatar Nov 26 '24 17:11 garrettmknight

Sweet - got a minute to work through some copy options for when the user is an admin on multiple workspaces here.

garrettmknight avatar Nov 28 '24 15:11 garrettmknight

Alright - OP is updated, now we're just waiting for the main issue to complete to open this one up.

garrettmknight avatar Dec 03 '24 18:12 garrettmknight

Quick clarification about the HOLD here:

  • We already have the upgrade command in ND
  • We're working on the downgrade command in https://github.com/Expensify/Expensify/issues/399936
  • Once we have the downgrade command, we should be able to open this up externally since it's more of a FE change that just calls our BE command.

garrettmknight avatar Dec 06 '24 11:12 garrettmknight

@jayeshmangwani Hey Jayesh, here's another issue we need to work on to really complete the full upgrades/downgrades project. Seems like a natural progression for you to take over this issue too, let me know if there are any questions.

I do have one question for you: we need to implement a check for whether the admin manages multiple workspaces or not. Do we have a way to check for that in the FE? Probably not, but thought I'd ask. If not, what kind of changes would you need from the BE (as in, what command or response would you like to see changed and how)?

carlosmiceli avatar Dec 11 '24 16:12 carlosmiceli

Seems like a natural progression for you to take over this issue too, let me know if there are any questions.

Yes, that sounds good. I will start working on this issue once we merge PR for the downgrade workspace UI and new downgrade API.

@carlosmiceli @garrettmknight I will also need access to Figma, as I cannot find this section in the design doc.

jayeshmangwani avatar Dec 11 '24 19:12 jayeshmangwani

@carlosmiceli For the multiple workspaces admin front-end check, I think we already have a function that can be used here. The getOwnedPaidPolicies function takes all policies and a user ID, then returns all the collect and control workspaces (paid workspaces) where the user is an admin.

https://github.com/Expensify/App/blob/ec76adcc1627caf6bac62ce26182e979e55fe52f/src/libs/PolicyUtils.ts#L391-L393

jayeshmangwani avatar Dec 11 '24 19:12 jayeshmangwani

Boom! Looks like we're good here @garrettmknight 💪 @jayeshmangwani great news, we're waiting for the final BE review and we're good to go, will report as soon as it's merged 👍

carlosmiceli avatar Dec 11 '24 19:12 carlosmiceli

will report as soon as it's merged 👍

Thanks 🙌

jayeshmangwani avatar Dec 11 '24 19:12 jayeshmangwani

BE is merged 🙌

carlosmiceli avatar Dec 11 '24 21:12 carlosmiceli

Small BE change requested by our contributors has both PRs in review, which should completely unblock @jayeshmangwani from completing the plan page work.

carlosmiceli avatar Dec 16 '24 23:12 carlosmiceli

Both BE PRs have been merged.

carlosmiceli avatar Dec 17 '24 16:12 carlosmiceli

Not Overdue, we will handle it after this PR

jayeshmangwani avatar Dec 20 '24 11:12 jayeshmangwani

@garrettmknight Whenever you get a chance, please help in get access to the Figma design/ Screenshots here

jayeshmangwani avatar Dec 20 '24 11:12 jayeshmangwani

Not overdue, it can now be worked on since the downgrade feature PR ahs been merged.

carlosmiceli avatar Dec 23 '24 20:12 carlosmiceli

Since we can now work on these changes, @carlosmiceli could you please provide the UI screenshots that need to be implemented?

jayeshmangwani avatar Dec 24 '24 07:12 jayeshmangwani

To be honest I'm not sure where those are, let's wait for @garrettmknight to provide them.

carlosmiceli avatar Dec 26 '24 20:12 carlosmiceli

@carlosmiceli, @garrettmknight, @jayeshmangwani Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Dec 30 '24 09:12 melvin-bot[bot]

@jayeshmangwani

Single Upgrade:

image

image

Multi Upgrade:

image

image

Single Downgrade:

image

image

Multi Downgrade:

image

image

carlosmiceli avatar Dec 30 '24 15:12 carlosmiceli

@jayeshmangwani just a note that when the RHP is up, there should be a shadow on the rest of the screen.

garrettmknight avatar Dec 30 '24 15:12 garrettmknight

Thanks for the mockups, @carlosmiceli! I’ll start working on the PR today.

jayeshmangwani avatar Dec 30 '24 15:12 jayeshmangwani

@carlosmiceli , @garrettmknight ,New plan type design looks good on web (screenshot added below for comparison with other devices).

web: chrome Screenshot 2024-12-31 at 9 50 25 PM
However, on native mobile devices and narrow web layouts, it doesn't look as polished. I've attached screenshots from iOS and Safari on mobile web for reference.

Should we update the layout to display the plan type in a column format for narrow layouts? Or would it be better to get input from the design team on this?

iOS

Simulator Screenshot - iPhone 15 Pro Max - 2024-12-31 at 21 50 03

mweb: safari

Simulator Screenshot - iPhone 15 Pro Max - 2024-12-31 at 21 49 31

I tried using the column layout for mobile devices, but that doesn’t look great either. Since the Plan type cards have some height, they end up taking over the whole screen. I've attached a screenshot below for reference.

iOS: column flex direction

Simulator Screenshot - iPhone 15 Pro Max - 2024-12-31 at 21 55 12

jayeshmangwani avatar Dec 31 '24 16:12 jayeshmangwani

I can help review this as C+ @carlosmiceli @jayeshmangwani.

parasharrajat avatar Dec 31 '24 19:12 parasharrajat

Oh, sorry, I think this should be @DylanDylann as the C+ reviewer.

carlosmiceli avatar Dec 31 '24 19:12 carlosmiceli

But let's wait for @garrettmknight's input on the UI above.

carlosmiceli avatar Dec 31 '24 19:12 carlosmiceli

cc @Expensify/design for a review of the UI above

I think the idea was that on mobile, these would be stacked (aka flex column). The web screenshots look good to me though.

shawnborton avatar Jan 02 '25 09:01 shawnborton

Just catching up from NY. I like the stacked option, let's go with that.

garrettmknight avatar Jan 02 '25 10:01 garrettmknight

Agree with the mobile stacking Shawn called out. Is it just me or does this look a bit cramped here? Is that our regular line-height? If so, maybe we should add just a tad more padding between the plan price paragraph and the name of the plan itself? CleanShot 2025-01-06 at 15 11 34@2x

dubielzyk-expensify avatar Jan 06 '25 05:01 dubielzyk-expensify