Final plan changes

This commit is contained in:
ernstmul committed 2024-10-03 14:28:40 +02:00
1 parent bad56508e8
commit 0be3489e18
4 files changed
+17 -6

No files matched your search

+7
View File
@@ -77,6 +77,8 @@ export function tierToPlan(tier: Tier) {
return tierPro;
case BillingPlan.SCALE:
return tierScale;
case BillingPlan.GITHUB_EDUCATION:
return tierGitHubEducation;
default:
return tierFree;
}
@@ -173,6 +175,11 @@ export const tierFree: TierData = {
description: 'For personal hobby projects of small scale and students.'
};
export const tierGitHubEducation: TierData = {
name: 'GitHub Education',
description: 'For members of GitHub student developers program.'
};
export const tierPro: TierData = {
name: 'Pro',
description: 'For pro developers and production projects that need the ability to scale.'
+5 -1
View File
@@ -41,5 +41,9 @@ export const organizationList = derived(
page,
($page) => $page.data.organizations as Models.TeamList<Record<string, unknown>>
);
export const organization = derived(page, ($page) => $page.data?.organization as Organization);
// TODO: remove override to tier-3 when BE PR, https://github.com/appwrite-labs/cloud/pull/816, has been merged and deployed -->
export const organization = derived(page, ($page) => {
return { ...($page.data?.organization as Organization), billingPlan: 'tier-3' as Tier };
});
export const members = derived(page, ($page) => $page.data.members as Models.MembershipList);
@@ -58,7 +58,7 @@
{isTrial ? formatCurrency(0) : formatCurrency(currentPlan?.price)}
</div>
</CollapsibleItem>
{#if $organization?.billingPlan !== BillingPlan.FREE && extraUsage > 0}
{#if $organization?.billingPlan !== BillingPlan.FREE && $organization?.billingPlan !== BillingPlan.GITHUB_EDUCATION && extraUsage > 0}
<CollapsibleItem isInfo gap={8}>
<svelte:fragment slot="beforetitle">
<span class="body-text-2"><b>Add-ons</b></span><span class="inline-tag"
@@ -147,7 +147,8 @@
}}></span>
</span>
<div class="body-text-2 u-margin-inline-start-auto">
{$organization?.billingPlan === BillingPlan.FREE
{$organization?.billingPlan === BillingPlan.FREE ||
$organization?.billingPlan === BillingPlan.GITHUB_EDUCATION
? formatCurrency(0)
: formatCurrency(currentInvoice?.amount ?? 0)}
</div>
@@ -171,7 +172,7 @@
Upgrade
</Button>
</div>
{:else}
{:else if $organization?.billingPlan !== BillingPlan.GITHUB_EDUCATION}
<div class="u-flex u-gap-16 u-flex-wrap">
<Button
text
@@ -110,8 +110,7 @@
<span class="u-trim">
{$organization.name}
</span>
<!-- TODO: remove true check below when API change, https://github.com/appwrite-labs/cloud/pull/816, has been merged and deployed -->
{#if isCloud && (true || $organization?.billingPlan === BillingPlan.GITHUB_EDUCATION)}
{#if isCloud && $organization?.billingPlan === BillingPlan.GITHUB_EDUCATION}
<Pill class="eyebrow-heading-3"
><span class="icon-github" aria-hidden="true" /> EDUCATION</Pill>
{:else if isCloud && $organization?.billingPlan === BillingPlan.FREE}