mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Fix review comments
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state';
|
||||
import { Click, trackEvent } from '$lib/actions/analytics';
|
||||
import { Click } from '$lib/actions/analytics';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { HeaderAlert } from '$lib/layout';
|
||||
import { hideBillingHeaderRoutes, upgradeURL } from '$lib/stores/billing';
|
||||
import { currentPlan } from '$lib/stores/organization';
|
||||
import SelectProjectCloud from '$lib/components/billing/alerts/selectProjectCloud.svelte';
|
||||
import { BillingPlan } from '@appwrite.io/console';
|
||||
let showSelectProject = false;
|
||||
</script>
|
||||
|
||||
<SelectProjectCloud bind:showSelectProject />
|
||||
|
||||
{#if $currentPlan.$id === BillingPlan.Tier0 && !hideBillingHeaderRoutes.includes(page.url.pathname)}
|
||||
{#if $currentPlan && $currentPlan.projects > 0 && !hideBillingHeaderRoutes.includes(page.url.pathname)}
|
||||
<HeaderAlert title="Action required: You have more than {$currentPlan.projects} projects.">
|
||||
<svelte:fragment>
|
||||
Choose which projects to keep before [date] or upgrade to Pro. Projects over the limit
|
||||
@@ -26,11 +25,10 @@
|
||||
}}>Manage projects</Button>
|
||||
<Button
|
||||
href={$upgradeURL}
|
||||
on:click={() => {
|
||||
trackEvent(Click.OrganizationClickUpgrade, {
|
||||
from: 'button',
|
||||
source: 'projects_limit_banner'
|
||||
});
|
||||
event={Click.OrganizationClickUpgrade}
|
||||
eventData={{
|
||||
from: 'button',
|
||||
source: 'projects_limit_banner'
|
||||
}}
|
||||
secondary
|
||||
fullWidthMobile>
|
||||
|
||||
@@ -283,7 +283,8 @@ export function calculateTrialDay(org: Organization) {
|
||||
return days;
|
||||
}
|
||||
|
||||
export async function checkForProjectsLimit(org: Organization, projects: number) {
|
||||
export function checkForProjectsLimit(org: Organization, projects: number) {
|
||||
if (!isCloud) return;
|
||||
if (!org || !projects) return;
|
||||
const plan = get(plansInfo)?.get(org.billingPlan);
|
||||
if (!plan) return;
|
||||
|
||||
@@ -61,6 +61,4 @@ export const organizationList = derived(
|
||||
export const organization = derived(page, ($page) => $page.data?.organization as Organization);
|
||||
export const currentPlan = derived(page, ($page) => $page.data?.currentPlan as Plan);
|
||||
export const members = derived(page, ($page) => $page.data.members as Models.MembershipList);
|
||||
export const projectsCount = derived(page, ($page) => $page.data.projects?.length || 0);
|
||||
|
||||
export const regions = writable<Models.ConsoleRegionList>({ total: 0, regions: [] });
|
||||
|
||||
@@ -305,7 +305,7 @@
|
||||
if (currentOrganizationId === org.$id) return;
|
||||
if (isCloud) {
|
||||
currentOrganizationId = org.$id;
|
||||
await checkForProjectsLimit(org, data.projects?.length || 0);
|
||||
checkForProjectsLimit(org, data.projects?.length || 0);
|
||||
await checkForUsageLimit(org);
|
||||
checkForMarkedForDeletion(org);
|
||||
await checkForNewDevUpgradePro(org);
|
||||
|
||||
Reference in New Issue
Block a user