From fef57fae07fd485321c2d48b1254d710f5dbe286 Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 4 Jul 2023 21:32:38 +0200 Subject: [PATCH] feat: budget caps --- .../billing/+page.svelte | 25 ++-- .../billing/budgetAlert.svelte | 121 ++++++++++++++++++ .../billing/budgetCap.svelte | 5 +- 3 files changed, 139 insertions(+), 12 deletions(-) create mode 100644 src/routes/console/organization-[organization]/billing/budgetAlert.svelte diff --git a/src/routes/console/organization-[organization]/billing/+page.svelte b/src/routes/console/organization-[organization]/billing/+page.svelte index 0b03584db..8717b98c3 100644 --- a/src/routes/console/organization-[organization]/billing/+page.svelte +++ b/src/routes/console/organization-[organization]/billing/+page.svelte @@ -1,25 +1,30 @@ - + + {#if $organization?.tier !== 'pro'} + + {/if} -{#if showPayment} + diff --git a/src/routes/console/organization-[organization]/billing/budgetAlert.svelte b/src/routes/console/organization-[organization]/billing/budgetAlert.svelte new file mode 100644 index 000000000..1f4f185c6 --- /dev/null +++ b/src/routes/console/organization-[organization]/billing/budgetAlert.svelte @@ -0,0 +1,121 @@ + + +
+ + Budget Alert Condition + +

+ Get notified by email when your organization meets or exceeds a percent of your + specified budget cap. You can set a maximum of 3 alerts. +

+ + + (search = selectedAlert.toString())} /> + + + + {#if alerts.length} + + + Alert at budget cap % + + + + {#each alerts as alert} + + + {alert} + + + + + + {/each} + +
+ {/if} +
+ + + + +
+
+ + diff --git a/src/routes/console/organization-[organization]/billing/budgetCap.svelte b/src/routes/console/organization-[organization]/billing/budgetCap.svelte index b0d287b27..d00353ff9 100644 --- a/src/routes/console/organization-[organization]/billing/budgetCap.svelte +++ b/src/routes/console/organization-[organization]/billing/budgetCap.svelte @@ -45,8 +45,9 @@ {#if $organization?.tier !== 'pro'} - Budget caps are a Pro plan feature + + Budget caps are a Pro plan feature + Upgrade to a Pro plan to set a budget cap for your organization. For more information on what you can do with a Pro plan,