From 8847dae7a44be7bf5f2552550c633bbc5cbb802b Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Tue, 1 Oct 2024 02:14:11 -0300 Subject: [PATCH] feat: New Private apps limitations (#33316) * feat: New empty state for upgrading private Apps * chore: Change Marketplace info modal text (#33239) * feat: New tooltips and color behavior for private apps bar (#33243) * feat: New tooltips and behavior for private apps bar * Create brown-pants-press.md * feat: new modal on Private Apps install (#33275) * feat: new modal on Private Apps install * add more variations * Create eleven-rockets-hug.md * chore: change grandfathered modal text (#33291) * chore: Use apps provider to check maxPrivateApps * fix: adds minor fixes to UI and changes requested on review * Update changeset * Replace negative boolean * Refactor `AppsUsageCard` * Add unit test for `AppsUsageCard` * Add unit test for `PrivateEmptyState` * Add unit test for `EnabledAppsCount` * Move tooltip logic away from `useAppsCountQuery` --------- Co-authored-by: Lucas Pelegrino Co-authored-by: Tasso --- .../marketplace/components/EnabledAppsCount.tsx | 14 ++++++++++++++ packages/i18n/src/locales/en.i18n.json | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/apps/meteor/client/views/marketplace/components/EnabledAppsCount.tsx b/apps/meteor/client/views/marketplace/components/EnabledAppsCount.tsx index 3aeac42fe637..299592827d2d 100644 --- a/apps/meteor/client/views/marketplace/components/EnabledAppsCount.tsx +++ b/apps/meteor/client/views/marketplace/components/EnabledAppsCount.tsx @@ -31,6 +31,20 @@ const EnabledAppsCount = ({ const percentage = limit === 0 ? 100 : Math.round((enabled * 100) / limit); + const variant = useMemo(() => { + if (enabled + 1 === limit) { + return 'warning'; + } + + if (limit === 0 || enabled >= limit) { + return 'danger'; + } + + return 'success'; + }, [enabled, limit]); + + const percentage = limit === 0 ? 100 : Math.round((enabled * 100) / limit); + return ( >>>>>> 9995639a46 (feat: New Private apps limitations (#33316)) "Graphql_CORS": "GraphQL CORS", "Graphql_Enabled": "GraphQL Enabled", "Graphql_Subscription_Port": "GraphQL Subscription Port",