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

Fix: change-plan from account route #1777

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ItzNotABug
Copy link
Member

What does this PR do?

Change plan route would crash if navigated through Account > Support > Get premium support because there's no organization store or info. available. This PR fixes that.

Test Plan

Manual.

Screen.Recording.2025-04-03.at.10.06.38.AM.mov

Related PRs and Issues

N/A.

Have you read the Contributing Guidelines on issues?

Yes.

@ItzNotABug ItzNotABug self-assigned this Apr 3, 2025
@ItzNotABug ItzNotABug requested a review from stnguyen90 April 3, 2025 04:38
@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Apr 3, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-04-03 08:12:26 CET

@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Apr 3, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-04-03 08:12:27 CET

@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Apr 3, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-04-03 08:12:27 CET

@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Apr 3, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-04-03 08:12:27 CET

@ItzNotABug ItzNotABug requested a review from ernstmul April 3, 2025 04:38
@ItzNotABug ItzNotABug requested a review from ernstmul April 3, 2025 08:14
(team) => !$plansInfo.get((team as Organization).billingPlan)?.premiumSupport
);

$: upgradeURL = `${base}/organization-${freeOrganization.$id}/change-plan`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need the one in the billing store if we have this here? Maybe it would be best to consolidate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, we still need the other one because it uses the organization available from either page or the derived store. On account route, there's no organization access available. We could make this a function that has a default value but that goes outside the scope of this one and would require a refactor in some other places too.

Comment on lines +19 to +23
$: hasPremiumSupport = $currentPlan?.premiumSupport ?? allOrgsHavePremiumSupport ?? false;

$: allOrgsHavePremiumSupport = $organizationList.teams.every(
(team) => $plansInfo.get((team as Organization).billingPlan)?.premiumSupport
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend allowing premiums support if they have at least 1 org with premium support.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually cannot/should not.

The issue is that we have a very different flow on Project > Support & Account > Support.

  1. On project or Org routes, we know what to check for premium support checks
  2. On others where Org can be multiple and no access to them, we don't have a way to use that org for premium support because an issue could be tied to some other Project's org.

I'd recommend allowing premiums support if they have at least 1 org with premium support.

But then, if they have an issue with another organization, those projects won't show in the dropdown.


I'd rather suggest something like this if we don't want this -

  1. Have Project or Org access > Show normal flow > Premium support or Get premium support
  2. No access to Project or Org. > Show an Org selector dropdown > Based on selected Org, check if they have premium support > Support OR Get premium support.

WDYT?

@ItzNotABug ItzNotABug requested a review from stnguyen90 April 4, 2025 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants