diff --git a/src/lib/images/promos/bulk-api-dark.png b/src/lib/images/promos/bulk-api-dark.png new file mode 100644 index 000000000..c4b94deb4 Binary files /dev/null and b/src/lib/images/promos/bulk-api-dark.png differ diff --git a/src/lib/images/promos/bulk-api-light.png b/src/lib/images/promos/bulk-api-light.png new file mode 100644 index 000000000..60ef70ef9 Binary files /dev/null and b/src/lib/images/promos/bulk-api-light.png differ diff --git a/src/lib/images/promos/csv-import-placeholder-dark.png b/src/lib/images/promos/csv-import-placeholder-dark.png deleted file mode 100644 index ed47ecee2..000000000 Binary files a/src/lib/images/promos/csv-import-placeholder-dark.png and /dev/null differ diff --git a/src/lib/images/promos/csv-import-placeholder-light.png b/src/lib/images/promos/csv-import-placeholder-light.png deleted file mode 100644 index 861b1bd08..000000000 Binary files a/src/lib/images/promos/csv-import-placeholder-light.png and /dev/null differ diff --git a/src/routes/(console)/bottomAlerts.ts b/src/routes/(console)/bottomAlerts.ts index 18ad41d33..0a6e367a0 100644 --- a/src/routes/(console)/bottomAlerts.ts +++ b/src/routes/(console)/bottomAlerts.ts @@ -6,43 +6,43 @@ import { setMobileSingleAlertLayout } from '$lib/stores/bottom-alerts'; -import CSVImportDark from '$lib/images/promos/csv-import-placeholder-dark.png'; -import CSVImportLight from '$lib/images/promos/csv-import-placeholder-light.png'; +import BulkApiDark from '$lib/images/promos/bulk-api-dark.png'; +import BulkApiLight from '$lib/images/promos/bulk-api-light.png'; const listOfPromotions: BottomModalAlertItem[] = []; if (isCloud) { - const csvImportPromo: BottomModalAlertItem = { - id: 'modal:csv_import_announcement', + const bulkApiPromo: BottomModalAlertItem = { + id: 'modal:bulk_api_announcement', src: { - dark: CSVImportDark, - light: CSVImportLight + dark: BulkApiDark, + light: BulkApiLight }, - title: 'Introducing CSV import', + title: 'Introducing Bulk API', message: - "We're introducing a new way to populate your Appwrite databases: document imports from CSV files.", + 'A new Appwrite Databases feature, explicitly designed to handle heavy write workloads.', plan: 'free', importance: 8, - scope: 'everywhere', + scope: 'project', cta: { text: 'Read announcement', - link: () => 'https://appwrite.io/blog/post/announcing-csv-imports', + link: () => 'https://appwrite.io/blog/post/announcing-bulk-api', external: true, hideOnClick: true }, show: true }; - listOfPromotions.push(csvImportPromo); + listOfPromotions.push(bulkApiPromo); setMobileSingleAlertLayout({ - title: csvImportPromo.title, - message: csvImportPromo.message, + title: bulkApiPromo.title, + message: bulkApiPromo.message, enabled: true, cta: { - link: csvImportPromo.cta.link, - external: csvImportPromo.cta.external, - hideOnClick: csvImportPromo.cta.hideOnClick + link: bulkApiPromo.cta.link, + external: bulkApiPromo.cta.external, + hideOnClick: bulkApiPromo.cta.hideOnClick } }); } diff --git a/src/routes/(console)/organization-[organization]/header.svelte b/src/routes/(console)/organization-[organization]/header.svelte index 01b2687aa..f114dcc22 100644 --- a/src/routes/(console)/organization-[organization]/header.svelte +++ b/src/routes/(console)/organization-[organization]/header.svelte @@ -7,7 +7,13 @@ import { toLocaleDate } from '$lib/helpers/date'; import { isTabSelected } from '$lib/helpers/load'; import { Cover } from '$lib/layout'; - import { daysLeftInTrial, getServiceLimit, plansInfo, readOnly } from '$lib/stores/billing'; + import { + daysLeftInTrial, + getServiceLimit, + plansInfo, + readOnly, + tierToPlan + } from '$lib/stores/billing'; import { members, newMemberModal, type Organization } from '$lib/stores/organization'; import { canSeeBilling, @@ -114,14 +120,25 @@ {/if} {#if $isOwner} - + +
+ +
+
+ {organization?.billingPlan === BillingPlan.FREE + ? 'Upgrade to add more members' + : `You've reached the members limit for the ${ + tierToPlan(organization?.billingPlan)?.name + } plan`} +
+
{/if} diff --git a/src/routes/(console)/organization-[organization]/members/+page.svelte b/src/routes/(console)/organization-[organization]/members/+page.svelte index c906ece51..abc2360b3 100644 --- a/src/routes/(console)/organization-[organization]/members/+page.svelte +++ b/src/routes/(console)/organization-[organization]/members/+page.svelte @@ -31,8 +31,11 @@ Icon, Typography, Popover, - ActionMenu + ActionMenu, + Tooltip } from '@appwrite.io/pink-svelte'; + import { BillingPlan } from '$lib/constants'; + import { tierToPlan } from '$lib/stores/billing'; export let data; @@ -41,6 +44,13 @@ let showEdit = false; let showDropdown = []; + // Calculate if button should be disabled and tooltip should show + $: memberCount = data.organizationMembers?.total ?? 0; + $: isFreeWithMembers = $organization?.billingPlan === BillingPlan.FREE && memberCount >= 1; + $: isButtonDisabled = isCloud + ? isFreeWithMembers || !$currentPlan?.addons?.seats?.supported + : false; + const resend = async (member: Models.Membership) => { try { await sdk.forConsole.teams.createMembership( @@ -70,14 +80,25 @@ Members - newMemberModal.set(true)} - disabled={isCloud ? !$currentPlan?.addons?.seats?.supported : false}> - - Invite - + +
+ newMemberModal.set(true)} + disabled={isButtonDisabled}> + + Invite + +
+
+ {$organization?.billingPlan === BillingPlan.FREE + ? 'Upgrade to add more members' + : `You've reached the members limit for the ${ + tierToPlan($organization?.billingPlan)?.name + } plan`} +
+
- Indicate whether this attribute is encrypted. Encrypted attributes - cannot be queried. + Protect attribute against data leaks for best privacy compliance. + Encrypted attributes cannot be queried.