Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import { ID } from '@appwrite.io/console';
import { createEventDispatcher } from 'svelte';
import { isCloud } from '$lib/system';
import { BillingPlan } from '$lib/constants';
import { organization } from '$lib/stores/organization';
import { currentPlan } from '$lib/stores/organization';
import { upgradeURL } from '$lib/stores/billing';
import CreatePolicy from './database-[database]/backups/createPolicy.svelte';
import { cronExpression, type UserBackupPolicy } from '$lib/helpers/backups';
Expand Down Expand Up @@ -132,7 +131,7 @@
<CustomId bind:show={showCustomId} name="Database" bind:id autofocus={false} />

{#if isCloud}
{#if $organization?.billingPlan === BillingPlan.FREE}
{#if !$currentPlan?.backupsEnabled}
<Alert.Inline title="This database won't be backed up" status="warning">
Upgrade your plan to ensure your data stays safe and backed up.
<svelte:fragment slot="actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import { Badge, Icon, Layout, Tag, Typography } from '@appwrite.io/pink-svelte';
import { goto } from '$app/navigation';
import { upgradeURL } from '$lib/stores/billing';
import { BillingPlan } from '$lib/constants';
import { organization } from '$lib/stores/organization';

export let isFlex = true;
export let title: string;
Expand Down Expand Up @@ -50,7 +48,7 @@
paddingBlock="var(--space-5, 12px)"
paddingInline="var(--space-6, 16px)"
resetListPadding>
{#if $organization?.billingPlan === BillingPlan.PRO}
{#if maxPolicies === 1}
<Tag
size="s"
style="white-space: nowrap; max-width: none;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
type UserBackupPolicy
} from '$lib/helpers/backups';
import { InputNumber } from '$lib/elements/forms/index.js';
import { organization } from '$lib/stores/organization';
import { BillingPlan } from '$lib/constants';
import { currentPlan } from '$lib/stores/organization';
import { Card, Icon, Layout, Link, Tag, Typography } from '@appwrite.io/pink-svelte';
import { IconPencil, IconTrash } from '@appwrite.io/pink-icons-svelte';
import { isSmallViewport } from '$lib/stores/viewport';
Expand Down Expand Up @@ -149,7 +148,7 @@
);

// pre-check the hourly if on pro plan
if ($organization.billingPlan === BillingPlan.PRO && isFromBackupsTab) {
if ($currentPlan?.backupPolicies === 1 && isFromBackupsTab) {
presetPolicies.update((all) =>
all.map((policy) => {
policy.id = ID.unique();
Expand All @@ -176,7 +175,7 @@
</script>

<div class="u-flex-vertical u-gap-16">
{#if $organization.billingPlan === BillingPlan.SCALE}
{#if $currentPlan?.backupPolicies > 1}
{#if title || subtitle}
<div class="body-text-2">
{#if title}
Expand All @@ -195,7 +194,7 @@
{/if}

<!-- because we show a set of pre-defined ones -->
{#if $organization.billingPlan === BillingPlan.PRO}
{#if $currentPlan?.backupPolicies === 1}
{@const dailyPolicy = $presetPolicies[1]}

{#if isFromBackupsTab}
Expand Down