diff --git a/src/lib/layout/containerHeader.svelte b/src/lib/layout/containerHeader.svelte index 0f025c5fa..c74902178 100644 --- a/src/lib/layout/containerHeader.svelte +++ b/src/lib/layout/containerHeader.svelte @@ -11,7 +11,7 @@ import { Alert, DropList, Heading } from '$lib/components'; import { Pill } from '$lib/elements'; import { organization } from '$lib/stores/organization'; - import { isCloud } from '$lib/system'; + import { GRACE_PERIOD_OVERRIDE, isCloud } from '$lib/system'; import { createEventDispatcher, onMount } from 'svelte'; import { wizard } from '$lib/stores/wizard'; import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte'; @@ -59,7 +59,9 @@ $: isLimited = limit !== 0 && limit < Infinity; $: overflowingServices = limitedServices.filter((service) => service.value >= 0); $: isButtonDisabled = - buttonDisabled || $readOnly || (isLimited && total >= limit && !hasUsageFees); + buttonDisabled || + ($readOnly && !GRACE_PERIOD_OVERRIDE) || + (isLimited && total >= limit && !hasUsageFees); onMount(() => { dispatch('data', { isButtonDisabled, limit, tier }); diff --git a/src/lib/sdk/billing.ts b/src/lib/sdk/billing.ts index e6551ee5a..f18d062c9 100644 --- a/src/lib/sdk/billing.ts +++ b/src/lib/sdk/billing.ts @@ -185,7 +185,8 @@ export type AllowedRegions = | 'eu-nl' | 'ap-sg' | 'ap-ca' - | 'ap-au'; + | 'ap-au' + | 'default'; //TODO: remove after migration export type Region = { $id: AllowedRegions; diff --git a/src/lib/system.ts b/src/lib/system.ts index 3586468ef..16e26d13f 100644 --- a/src/lib/system.ts +++ b/src/lib/system.ts @@ -23,3 +23,4 @@ export const MODE = VARS.CONSOLE_MODE === Mode.CLOUD ? Mode.CLOUD : Mode.SELF_HO export const isCloud = MODE === Mode.CLOUD; export const isSelfHosted = MODE !== Mode.CLOUD; export const hasStripePublicKey = !!VARS.STRIPE_PUBLIC_KEY; +export const GRACE_PERIOD_OVERRIDE = true; diff --git a/src/routes/console/+layout.svelte b/src/routes/console/+layout.svelte index f36a8abcd..e4bd24327 100644 --- a/src/routes/console/+layout.svelte +++ b/src/routes/console/+layout.svelte @@ -265,14 +265,7 @@ }, INTERVAL); if (isCloud && hasStripePublicKey) { - console.log('Environment is Cloud and Stripe public key deteted'); $stripe = await loadStripe(VARS.STRIPE_PUBLIC_KEY); - console.log('Stripe loaded', $stripe); - } else { - console.log('Environment is not Cloud or Stripe public key not deteted'); - console.log('isCloud:', isCloud); - console.log('hasStripePublicKey:', hasStripePublicKey); - console.log('Stripe key:', VARS.STRIPE_PUBLIC_KEY); } }); diff --git a/src/routes/console/organization-[organization]/+page.svelte b/src/routes/console/organization-[organization]/+page.svelte index 07f143759..513fd7843 100644 --- a/src/routes/console/organization-[organization]/+page.svelte +++ b/src/routes/console/organization-[organization]/+page.svelte @@ -7,7 +7,7 @@ import CreateProject from './createProject.svelte'; import CreateOrganization from '../createOrganization.svelte'; import { wizard } from '$lib/stores/wizard'; - import { isCloud } from '$lib/system'; + import { GRACE_PERIOD_OVERRIDE, isCloud } from '$lib/system'; import { page } from '$app/stores'; import { registerCommands } from '$lib/commandCenter'; import { @@ -89,7 +89,7 @@ showCreate = true; }, keys: ['c'], - disabled: $readOnly, + disabled: $readOnly && !GRACE_PERIOD_OVERRIDE, group: 'projects', icon: 'plus' } @@ -141,7 +141,10 @@ Projects - diff --git a/src/routes/console/organization-[organization]/header.svelte b/src/routes/console/organization-[organization]/header.svelte index b3253e4e8..9e00b4315 100644 --- a/src/routes/console/organization-[organization]/header.svelte +++ b/src/routes/console/organization-[organization]/header.svelte @@ -17,14 +17,16 @@ organizationList } from '$lib/stores/organization'; import { wizard } from '$lib/stores/wizard'; - import { isCloud } from '$lib/system'; + import { GRACE_PERIOD_OVERRIDE, isCloud } from '$lib/system'; import CreateOrganizationCloud from '../createOrganizationCloud.svelte'; let areMembersLimited: boolean; $: organization.subscribe(() => { const limit = getServiceLimit('members') || Infinity; const isLimited = limit !== 0 && limit < Infinity; - areMembersLimited = isCloud && ($readOnly || (isLimited && $members?.total >= limit)); + areMembersLimited = + isCloud && + (($readOnly && !GRACE_PERIOD_OVERRIDE) || (isLimited && $members?.total >= limit)); }); let showDropdown = false; diff --git a/src/routes/console/organization-[organization]/members/+page.svelte b/src/routes/console/organization-[organization]/members/+page.svelte index f0f5aa556..1f12c8b30 100644 --- a/src/routes/console/organization-[organization]/members/+page.svelte +++ b/src/routes/console/organization-[organization]/members/+page.svelte @@ -22,7 +22,6 @@ import type { Models } from '@appwrite.io/console'; import type { PageData } from './$types'; import Delete from '../deleteMember.svelte'; - import { readOnly } from '$lib/stores/billing'; export let data: PageData; @@ -63,7 +62,6 @@ total={data.organizationMembers.total} buttonText="Invite" buttonMethod={() => newMemberModal.set(true)} - buttonDisabled={$readOnly} showAlert={false} /> diff --git a/src/routes/console/project-[project]/auth/+layout.svelte b/src/routes/console/project-[project]/auth/+layout.svelte index 7da5cc22e..cfb6a198b 100644 --- a/src/routes/console/project-[project]/auth/+layout.svelte +++ b/src/routes/console/project-[project]/auth/+layout.svelte @@ -3,6 +3,7 @@ import { page } from '$app/stores'; import { registerCommands, updateCommandGroupRanks } from '$lib/commandCenter'; import { readOnly } from '$lib/stores/billing'; + import { GRACE_PERIOD_OVERRIDE } from '$lib/system'; import { project } from '../store'; import { showCreateUser } from './+page.svelte'; import { showCreateTeam } from './teams/+page.svelte'; @@ -20,7 +21,7 @@ group: 'users', icon: 'plus', rank: $page.url.pathname.endsWith('auth') ? 10 : 0, - disabled: $readOnly + disabled: $readOnly && !GRACE_PERIOD_OVERRIDE }, { label: 'Create team', @@ -35,7 +36,7 @@ group: 'teams', icon: 'plus', rank: $page.url.pathname.endsWith('teams') ? 10 : 0, - disabled: $readOnly + disabled: $readOnly && !GRACE_PERIOD_OVERRIDE }, { label: 'Go to teams', diff --git a/src/routes/console/project-[project]/auth/+page.svelte b/src/routes/console/project-[project]/auth/+page.svelte index d0a0fda09..209c3d37d 100644 --- a/src/routes/console/project-[project]/auth/+page.svelte +++ b/src/routes/console/project-[project]/auth/+page.svelte @@ -31,8 +31,6 @@ import { writable } from 'svelte/store'; import type { PageData } from './$types'; import Create from './createUser.svelte'; - import { readOnly } from '$lib/stores/billing'; - import { isCloud } from '$lib/system'; import { tooltip } from '$lib/actions/tooltip'; export let data: PageData; @@ -44,12 +42,7 @@ - +
($showCreateUser = true)} event="create_user" - disabled={isCloud && $readOnly}> + disabled={isButtonDisabled}>
diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte index 189f64cc1..c58e09a96 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/executions/+page.svelte @@ -22,8 +22,7 @@ import { func } from '../store'; import type { Models } from '@appwrite.io/console'; import { organization } from '$lib/stores/organization'; - import { getServiceLimit, readOnly, showUsageRatesModal } from '$lib/stores/billing'; - import { isCloud } from '$lib/system'; + import { getServiceLimit, showUsageRatesModal } from '$lib/stores/billing'; import { project } from '$routes/console/project-[project]/store'; import Create from '../create.svelte'; import Execute from '../execute.svelte'; @@ -55,8 +54,7 @@ title="Executions" buttonText="Execute now" buttonEvent="execute_function" - buttonMethod={() => (selectedFunction = $func)} - buttonDisabled={isCloud && $readOnly}> + buttonMethod={() => (selectedFunction = $func)}>

The {tier} plan has limits

    diff --git a/src/routes/console/project-[project]/settings/migrations/+page.svelte b/src/routes/console/project-[project]/settings/migrations/+page.svelte index 1375c9c17..2a7877a02 100644 --- a/src/routes/console/project-[project]/settings/migrations/+page.svelte +++ b/src/routes/console/project-[project]/settings/migrations/+page.svelte @@ -15,7 +15,7 @@ import { isSameDay, toLocaleDate } from '$lib/helpers/date'; import { Container } from '$lib/layout'; import { sdk } from '$lib/stores/sdk'; - import { isSelfHosted } from '$lib/system'; + import { GRACE_PERIOD_OVERRIDE, isSelfHosted } from '$lib/system'; import { onMount } from 'svelte'; import { project } from '../../store'; import { openImportWizard } from './(import)'; @@ -227,7 +227,7 @@ class="u-margin-block-start-20" secondary on:click={openImportWizard} - disabled={$readOnly}> + disabled={$readOnly && !GRACE_PERIOD_OVERRIDE}> Import data diff --git a/src/routes/console/project-[project]/storage/bucket-[bucket]/+page.svelte b/src/routes/console/project-[project]/storage/bucket-[bucket]/+page.svelte index be8f3613a..752390929 100644 --- a/src/routes/console/project-[project]/storage/bucket-[bucket]/+page.svelte +++ b/src/routes/console/project-[project]/storage/bucket-[bucket]/+page.svelte @@ -40,7 +40,7 @@ import { uploader } from '$lib/stores/uploader'; import { wizard } from '$lib/stores/wizard'; import { tooltip } from '$lib/actions/tooltip'; - import { readOnly, showUsageRatesModal } from '$lib/stores/billing'; + import { showUsageRatesModal } from '$lib/stores/billing'; import { sdk } from '$lib/stores/sdk.js'; import Create from './create-file/create.svelte'; import DeleteFile from './deleteFile.svelte'; @@ -80,12 +80,7 @@ - +
    - @@ -248,14 +252,16 @@ id="name" label="Name" placeholder="Enter name" - readonly={$readOnly} + readonly={$readOnly && !GRACE_PERIOD_OVERRIDE} bind:value={bucketName} /> @@ -308,7 +314,8 @@ @@ -422,7 +429,9 @@ - + diff --git a/src/routes/console/project-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte b/src/routes/console/project-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte index ad1bda90f..b771463dc 100644 --- a/src/routes/console/project-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte +++ b/src/routes/console/project-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte @@ -7,7 +7,7 @@ import { getServiceLimit, readOnly, tierToPlan } from '$lib/stores/billing'; import { organization } from '$lib/stores/organization'; import { wizard } from '$lib/stores/wizard'; - import { isCloud } from '$lib/system'; + import { GRACE_PERIOD_OVERRIDE, isCloud } from '$lib/system'; import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte'; import { bucket } from '../store'; import { updateBucket } from './+page.svelte'; @@ -65,7 +65,7 @@ fullWidth id="size" label="Size" - disabled={$readOnly} + disabled={$readOnly && !GRACE_PERIOD_OVERRIDE} placeholder={$bucket.maximumFileSize.toString()} min={0} max={isCloud ? service : Infinity} @@ -81,7 +81,10 @@ -