mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #2599 from appwrite/manage-alerts
This commit is contained in:
@@ -41,6 +41,7 @@ import BudgetLimitAlert from '$routes/(console)/organization-[organization]/budg
|
||||
import TeamReadonlyAlert from '$routes/(console)/organization-[organization]/teamReadonlyAlert.svelte';
|
||||
import ProjectsLimit from '$lib/components/billing/alerts/projectsLimit.svelte';
|
||||
import EnterpriseTrial from '$routes/(console)/organization-[organization]/enterpriseTrial.svelte';
|
||||
import { ProfileMode, resolvedProfile } from '$lib/profiles/index.svelte';
|
||||
|
||||
export type Tier = 'tier-0' | 'tier-1' | 'tier-2' | 'auto-1' | 'cont-1' | 'ent-1';
|
||||
|
||||
@@ -572,6 +573,8 @@ export async function checkForMissingPaymentMethod() {
|
||||
|
||||
// Display upgrade banner for new users after 1 week for 30 days
|
||||
export async function checkForNewDevUpgradePro(org: Organization) {
|
||||
if (resolvedProfile.id !== ProfileMode.CONSOLE) return;
|
||||
|
||||
// browser or plan check.
|
||||
if (!browser || org?.billingPlan !== BillingPlan.FREE) return;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import BackupDatabase from '$lib/components/backupDatabaseAlert.svelte';
|
||||
import { shouldShowNotification } from '$lib/helpers/notifications';
|
||||
import { isCloud } from '$lib/system';
|
||||
import { currentPlan } from '$lib/stores/organization';
|
||||
import { ProfileMode, resolvedProfile } from '$lib/profiles/index.svelte';
|
||||
|
||||
export const database = derived(page, ($page) => $page.data?.database as Models.Database);
|
||||
|
||||
@@ -19,7 +20,10 @@ export async function checkForDatabaseBackupPolicies(
|
||||
projectId: string,
|
||||
database: Models.Database
|
||||
) {
|
||||
// fast path: return if user dismissed the banner
|
||||
// fast path: not the valid profile to show this!
|
||||
if (resolvedProfile.id !== ProfileMode.CONSOLE) return;
|
||||
|
||||
// fast path: return if user dismissed the banner.
|
||||
if (!shouldShowNotification(backupsBannerId)) return;
|
||||
|
||||
let total = 0;
|
||||
|
||||
@@ -3,6 +3,7 @@ import { isSameDay } from '$lib/helpers/date';
|
||||
import { type BottomModalAlertItem, showBottomModalAlert } from '$lib/stores/bottom-alerts';
|
||||
import DbOperatorsDark from '$lib/images/promos/db-operators-dark.png';
|
||||
import DbOperatorsLight from '$lib/images/promos/db-operators-light.png';
|
||||
import { ProfileMode, resolvedProfile } from '$lib/profiles/index.svelte';
|
||||
|
||||
const listOfPromotions: BottomModalAlertItem[] = [];
|
||||
|
||||
@@ -30,6 +31,9 @@ if (isCloud) {
|
||||
}
|
||||
|
||||
export function addBottomModalAlerts() {
|
||||
// fast path: not the valid profile to show this!
|
||||
if (resolvedProfile.id !== ProfileMode.CONSOLE) return;
|
||||
|
||||
listOfPromotions.forEach((promotion) => showBottomModalAlert(promotion));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user