-
Notifications
You must be signed in to change notification settings - Fork 161
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
base: main
Are you sure you want to change the base?
Conversation
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2025-04-03 08:12:26 CET |
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2025-04-03 08:12:27 CET |
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2025-04-03 08:12:27 CET |
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2025-04-03 08:12:27 CET |
src/routes/(console)/organization-[organization]/change-plan/+page.svelte
Show resolved
Hide resolved
(team) => !$plansInfo.get((team as Organization).billingPlan)?.premiumSupport | ||
); | ||
|
||
$: upgradeURL = `${base}/organization-${freeOrganization.$id}/change-plan`; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
$: hasPremiumSupport = $currentPlan?.premiumSupport ?? allOrgsHavePremiumSupport ?? false; | ||
|
||
$: allOrgsHavePremiumSupport = $organizationList.teams.every( | ||
(team) => $plansInfo.get((team as Organization).billingPlan)?.premiumSupport | ||
); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
- On project or Org routes, we know what to check for premium support checks
- 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 -
- Have Project or Org access > Show normal flow > Premium support or Get premium support
- 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?
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.