-
Notifications
You must be signed in to change notification settings - Fork 146
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
Add check to which plan the org is changing when applying the credits #1574
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: 2024-12-20 10:28:30 CET |
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2024-12-20 10:28:38 CET |
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2024-12-20 10:28:34 CET |
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2024-12-20 10:28:42 CET |
} | ||
} | ||
|
||
$: billingPlan = getNewBillingPlan(selectedOrg); |
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.
@ArmanNik and @TorstenDittmann might now more on Svelte best practices, but I don't think we need to create a new function for this. You can put an if statement directly here like:
console/src/lib/layout/logs.svelte
Lines 66 to 68 in 4145174
$: if (execution?.errors) { | |
selectedResponse = 'errors'; | |
} |
if (organization?.billingPlan === BillingPlan.SCALE) { | ||
return BillingPlan.SCALE; |
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'm still a bit hesitant to hardcode stuff here. For example, enterprise plans will run into a problem with this logic.
Maybe we can rely on the plan order (after it gets fixed for the education plan)?
What does this PR do?
Applying credits can make an organisation switch plans. This additional check prevents an organisation from downgrading when applying credits.
Have you read the Contributing Guidelines on issues?
✅