fix: alert messages, modals

This commit is contained in:
Arman
2023-12-11 13:17:41 +01:00
parent f85660c6e1
commit b1fa5a1fd0
3 changed files with 26 additions and 11 deletions
+4 -4
View File
@@ -87,10 +87,10 @@
{:else}
<Alert type={alertType} isStandalone>
<span class="text">
You've reached the {services} limit for the {tier} plan. You won't be able to
create additional resources until you {#if $organization?.billingPlan === 'tier-0'}
<Button link on:click={upgradeMethod}>upgrade</Button>.
{/if}
You've reached the {services} limit for the {tier} plan. <Button
link
on:click={upgradeMethod}>Upgrade</Button> your organization for additional
resources.
</span>
</Alert>
{/if}
@@ -41,20 +41,31 @@
users: totUsers > plan.users ? totUsers - plan.users : 0,
executions:
usage?.executions[0] > plan.executions ? usage.executions[0] - plan.executions : 0,
members: members.total > plan.members ? members.total - (plan.members || Infinity) : 0
members: members?.total > plan.members ? members.total - (plan.members || Infinity) : 0
};
}
$: if (show) calculateExcess();
</script>
<Modal bind:show title="Limit reached">
<svelte:fragment slot="title">
Your usage exceeds the {tierToPlan($organization.billingPlan).name} plan limits
</svelte:fragment>
<p class="text">
Usage for <b>{$organization.name}</b> organization has reached the limits of the {tierToPlan(
$organization.billingPlan
).name} plan. Consider upgrading to increase your resource usage.
</p>
{#if $organization.billingPlan === 'tier-0'}
<p class="text">
Usage for <b>{$organization.name}</b> organization has reached the limits of the {tierToPlan(
$organization.billingPlan
).name} plan. Consider upgrading to increase your resource usage.
</p>
{:else}
<p class="text">
Usage for <b>{$organization.name}</b> organization has reached the limits of the {tierToPlan(
$organization.billingPlan
).name} plan. Excess usage fees will apply.
</p>
{/if}
<PlanExcess {excess} currentTier={$organization.billingPlan} />
<svelte:fragment slot="footer">
<div class="u-flex u-main-space-between u-width-full-line">
@@ -31,7 +31,11 @@
<Alert type="error">
<svelte:fragment slot="title">
Changing your plan now will result in removal of organization members and more
{#if currentTier === 'tier-0'}
Your usage exceeds the {plan.name} plan limits
{:else}
Changing your plan now will result in removal of organization members and more
{/if}
</svelte:fragment>
{#if excess?.members > 0}