mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
remove: enterprise trials.
This commit is contained in:
@@ -40,7 +40,6 @@ import { user } from './user';
|
||||
import BudgetLimitAlert from '$routes/(console)/organization-[organization]/budgetLimitAlert.svelte';
|
||||
import TeamReadonlyAlert from '$routes/(console)/organization-[organization]/teamReadonlyAlert.svelte';
|
||||
import ProjectsLimit from '$lib/components/billing/alerts/projectsLimit.svelte';
|
||||
import EnterpriseTrial from '$routes/(console)/organization-[organization]/enterpriseTrial.svelte';
|
||||
import { ProfileMode, resolvedProfile } from '$lib/profiles/index.svelte';
|
||||
import { isFreePlan } from '$lib/helpers/billing';
|
||||
|
||||
@@ -295,18 +294,6 @@ export function isServiceLimited(serviceId: PlanServices, plan: Tier, total: num
|
||||
return isLimited && total >= limit && !hasUsageFees;
|
||||
}
|
||||
|
||||
export function checkForEnterpriseTrial(org: Organization) {
|
||||
if (!org || !org.billingNextInvoiceDate) return;
|
||||
if (calculateEnterpriseTrial(org) > 0) {
|
||||
headerAlert.add({
|
||||
id: 'teamEnterpriseTrial',
|
||||
component: EnterpriseTrial,
|
||||
show: true,
|
||||
importance: 11
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function calculateEnterpriseTrial(org: Organization) {
|
||||
if (!org || !org.billingNextInvoiceDate) return 0;
|
||||
const endDate = new Date(org.billingNextInvoiceDate);
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
import Create from './createOrganization.svelte';
|
||||
import {
|
||||
calculateTrialDay,
|
||||
checkForEnterpriseTrial,
|
||||
checkForMandate,
|
||||
checkForMarkedForDeletion,
|
||||
checkForMissingPaymentMethod,
|
||||
@@ -302,7 +301,6 @@
|
||||
const orgProjectCount =
|
||||
data.currentOrgId === org.$id ? data.allProjectsCount : undefined;
|
||||
await checkForProjectsLimit(org, orgProjectCount);
|
||||
checkForEnterpriseTrial(org);
|
||||
await checkForUsageLimit(org);
|
||||
checkForMarkedForDeletion(org);
|
||||
await checkForNewDevUpgradePro(org);
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { calculateEnterpriseTrial, hideBillingHeaderRoutes } from '$lib/stores/billing';
|
||||
import { base } from '$app/paths';
|
||||
import GradientBanner from '$lib/components/billing/gradientBanner.svelte';
|
||||
import { Badge, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { activeHeaderAlert } from '../store';
|
||||
|
||||
$: upgradeUrl = `${base}/organization-${$organization?.$id}/change-plan`;
|
||||
$: remainingDays = calculateEnterpriseTrial($organization);
|
||||
|
||||
let show = true;
|
||||
|
||||
function handleClose() {
|
||||
show = false;
|
||||
const now = new Date().getTime();
|
||||
localStorage.setItem($activeHeaderAlert.id, now.toString());
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if $organization?.$id && remainingDays > 0 && !hideBillingHeaderRoutes.includes(page.url.pathname) && show}
|
||||
<GradientBanner variant="image" on:close={handleClose}>
|
||||
<div class="banner-fullwidth-grid">
|
||||
<Typography.Text color="--fgcolor-neutral-primary">
|
||||
Your enterprise trial expires in <Badge
|
||||
size="xs"
|
||||
variant="secondary"
|
||||
content={remainingDays.toString()} /> days
|
||||
</Typography.Text>
|
||||
|
||||
<Button size="xs" secondary fullWidthMobile href={upgradeUrl}>Upgrade</Button>
|
||||
</div>
|
||||
</GradientBanner>
|
||||
{/if}
|
||||
|
||||
<style lang="scss">
|
||||
.banner-fullwidth-grid {
|
||||
width: 100vw;
|
||||
display: grid;
|
||||
padding: 0 3rem;
|
||||
align-items: center;
|
||||
grid-template-columns: 1fr auto 1fr;
|
||||
|
||||
> :global(:first-child) {
|
||||
grid-column: 2;
|
||||
justify-self: center;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
grid-column: unset;
|
||||
}
|
||||
}
|
||||
|
||||
> :global(:last-child) {
|
||||
grid-column: 3;
|
||||
justify-self: end;
|
||||
margin-inline-end: 4px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
padding: unset;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user