diff --git a/src/lib/components/billing/emptyCardCloud.svelte b/src/lib/components/billing/emptyCardCloud.svelte new file mode 100644 index 000000000..ff17d1174 --- /dev/null +++ b/src/lib/components/billing/emptyCardCloud.svelte @@ -0,0 +1,37 @@ + + + + +
+
Upgrade to add {service}
+

+ Upgrade to a {tierToPlan(BillingPlan.PRO).name} plan to add {service} to your organization +

+ + +
+
+
diff --git a/src/lib/components/billing/index.ts b/src/lib/components/billing/index.ts index 0d7a98daa..cfa72bd54 100644 --- a/src/lib/components/billing/index.ts +++ b/src/lib/components/billing/index.ts @@ -1,2 +1,3 @@ export { default as PaymentBoxes } from './paymentBoxes.svelte'; export { default as CouponInput } from './couponInput.svelte'; +export { default as EmptyCardCloud } from './emptyCardCloud.svelte'; diff --git a/src/lib/components/paginator.svelte b/src/lib/components/paginator.svelte index 36849247a..e40e95103 100644 --- a/src/lib/components/paginator.svelte +++ b/src/lib/components/paginator.svelte @@ -3,6 +3,7 @@ export let items = []; export let limit = 5; + export let hideFooter = false; let offset = 0; @@ -10,9 +11,11 @@ $: paginatedItems = items.slice(offset, offset + limit); - + -
-

Total results: {total}

- -
+{#if !hideFooter} +
+

Total results: {total}

+ +
+{/if} diff --git a/src/routes/console/organization-[organization]/usage/[[invoice]]/+page.svelte b/src/routes/console/organization-[organization]/usage/[[invoice]]/+page.svelte index 9bc13dc07..e2568ea13 100644 --- a/src/routes/console/organization-[organization]/usage/[[invoice]]/+page.svelte +++ b/src/routes/console/organization-[organization]/usage/[[invoice]]/+page.svelte @@ -14,6 +14,7 @@ import type { OrganizationUsage } from '$lib/sdk/billing'; import { BillingPlan } from '$lib/constants'; import { trackEvent } from '$lib/actions/analytics'; + import TotalMembers from './totalMembers.svelte'; export let data; @@ -298,6 +299,7 @@ {/if} +

Metrics are estimates updated every 24 hours and may not accurately reflect your invoice. diff --git a/src/routes/console/organization-[organization]/usage/[[invoice]]/+page.ts b/src/routes/console/organization-[organization]/usage/[[invoice]]/+page.ts index b1ef9a272..cb8264f1a 100644 --- a/src/routes/console/organization-[organization]/usage/[[invoice]]/+page.ts +++ b/src/routes/console/organization-[organization]/usage/[[invoice]]/+page.ts @@ -36,9 +36,10 @@ export const load: PageLoad = async ({ params, parent }) => { endDate = currentInvoice.to; } - const [invoices, usage] = await Promise.all([ + const [invoices, usage, organizationMembers] = await Promise.all([ sdk.forConsole.billing.listInvoices(org.$id, [Query.orderDesc('from')]), - sdk.forConsole.billing.listUsage(params.organization, startDate, endDate) + sdk.forConsole.billing.listUsage(params.organization, startDate, endDate), + sdk.forConsole.teams.listMemberships(params.organization) ]); const queries: string[] = []; @@ -58,6 +59,7 @@ export const load: PageLoad = async ({ params, parent }) => { organizationUsage: usage, projectNames: projectNames.projects, invoices, - currentInvoice + currentInvoice, + organizationMembers }; }; diff --git a/src/routes/console/organization-[organization]/usage/[[invoice]]/totalMembers.svelte b/src/routes/console/organization-[organization]/usage/[[invoice]]/totalMembers.svelte new file mode 100644 index 000000000..950b4c30e --- /dev/null +++ b/src/routes/console/organization-[organization]/usage/[[invoice]]/totalMembers.svelte @@ -0,0 +1,87 @@ + + + + Members + +

The number of members in your organization.

+ + {#if $organization.billingPlan !== BillingPlan.STARTER} +
+
+

+ {total} + Members +

+ +
+

+ Unlimited + +

+
+ + + + Members + Joined + + + {#each paginatedItems as member} + + +
+ + + {member.userName ? member.userName : member.userEmail} + +
+
+ + {member.joined + ? toLocaleDate(member.joined) + : toLocaleDate(member.$createdAt)} + +
+ {/each} +
+
+
+ {:else} + + {/if} +
+