From a2ea94427867aa9193e66764e0de2457ae81e4a4 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 --- apps/meteor/client/providers/AppsProvider/AppsProvider.tsx | 2 +- .../UninstallGrandfatheredAppModal.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/meteor/client/providers/AppsProvider/AppsProvider.tsx b/apps/meteor/client/providers/AppsProvider/AppsProvider.tsx index df96b0f2f01fe..b2145a07fb7ad 100644 --- a/apps/meteor/client/providers/AppsProvider/AppsProvider.tsx +++ b/apps/meteor/client/providers/AppsProvider/AppsProvider.tsx @@ -116,7 +116,7 @@ const AppsProvider = ({ children }: AppsProviderProps) => { await Promise.all([queryClient.invalidateQueries(['marketplace'])]); }, orchestrator: AppClientOrchestratorInstance, - privateAppsEnabled: (limits?.privateApps?.max ?? 0) !== 0, + privateAppsEnabled: (limits?.privateApps?.max ?? 0) > 0, }} /> ); diff --git a/apps/meteor/client/views/marketplace/components/UninstallGrandfatheredAppModal/UninstallGrandfatheredAppModal.tsx b/apps/meteor/client/views/marketplace/components/UninstallGrandfatheredAppModal/UninstallGrandfatheredAppModal.tsx index 13d71cc2108b1..04cd241eaf102 100644 --- a/apps/meteor/client/views/marketplace/components/UninstallGrandfatheredAppModal/UninstallGrandfatheredAppModal.tsx +++ b/apps/meteor/client/views/marketplace/components/UninstallGrandfatheredAppModal/UninstallGrandfatheredAppModal.tsx @@ -1,6 +1,6 @@ import { Button, Modal } from '@rocket.chat/fuselage'; -import { useTranslation } from '@rocket.chat/ui-contexts'; import React from 'react'; +import { useTranslation } from 'react-i18next'; import MarkdownText from '../../../../components/MarkdownText'; import type { MarketplaceRouteContext } from '../../hooks/useAppsCountQuery'; @@ -15,7 +15,7 @@ type UninstallGrandfatheredAppModalProps = { }; const UninstallGrandfatheredAppModal = ({ context, limit, appName, handleUninstall, handleClose }: UninstallGrandfatheredAppModalProps) => { - const t = useTranslation(); + const { t } = useTranslation(); const privateAppsEnabled = usePrivateAppsEnabled(); const modalContent =