Skip to content

Commit

Permalink
regression(Marketplace): Restore changes lost in rebase (#33514)
Browse files Browse the repository at this point in the history
* regression(Marketplace): Restore missing button on empty state

* regression(Marketplace): Restore missing text in `AppsUsageCard`

* regression(Marketplace):  Fix misalignment on marketplace header

* regression(Marketplace): Fix wrong import on uninstall app modal

* regression(Marketplace): Restore link to uninstall app modal
  • Loading branch information
MartinSchoeler authored Oct 11, 2024
1 parent e6f5a02 commit 9ddc11f
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import AppsUsageCard from './AppsUsageCard';
const appRoot = mockAppRoot().withTranslations('en', 'core', {
Apps_InfoText_limited:
'Community workspaces can enable up to {{marketplaceAppsMaxCount}} marketplace apps. Private apps can only be enabled in <1>premium plans</1>.',
Apps_InfoText:
'Community allows up to {{privateAppsMaxCount}} private apps and {{marketplaceAppsMaxCount}} marketplace apps to be enabled',
});

it('should render a skeleton if no data', () => {
Expand Down Expand Up @@ -80,5 +78,7 @@ it('should render a full progress bar with private apps disabled', async () => {

await userEvent.click(screen.getByRole('button', { name: 'Click_here_for_more_info' }));

expect(screen.getByText('Community allows up to 0 private apps and 5 marketplace apps to be enabled')).toBeInTheDocument();
expect(
screen.getByText('Community workspaces can enable up to 5 marketplace apps. Private apps can only be enabled in premium plans.'),
).toBeInTheDocument();
});
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,16 @@ const AppsUsageCard = ({ privateAppsLimit, marketplaceAppsLimit }: AppsUsageCard

const card: CardProps = {
title: t('Apps'),
infoText:
privateAppsCount > 0 ? (
<Trans i18nKey='Apps_InfoText_limited' tOptions={{ marketplaceAppsMaxCount }}>
Community workspaces can enable up to {{ marketplaceAppsMaxCount }} marketplace apps. Private apps can only be enabled in{' '}
<Box is='a' href='https://www.rocket.chat/pricing' target='_blank' color='info'>
premium plans
</Box>
.
</Trans>
) : (
t('Apps_InfoText', { privateAppsMaxCount, marketplaceAppsMaxCount })
),
infoText: (
<Trans i18nKey='Apps_InfoText_limited' tOptions={{ marketplaceAppsMaxCount }}>
Community workspaces can enable up to {{ marketplaceAppsMaxCount }} marketplace apps. Private apps can only be enabled in{' '}
<Box is='a' href='https://www.rocket.chat/pricing' target='_blank' color='info'>
premium plans
</Box>
.
</Trans>
),

...(marketplaceAppsAboveWarning && {
upgradeButton: (
<UpgradeButton target='app-usage-card' action='upgrade' small>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const AppsFilters = ({
const fixFiltersSize = breakpoints.includes('lg') ? { maxWidth: 'x200', minWidth: 'x200' } : null;

return (
<Box pi={24} mbe={4}>
<Box pi={24}>
<FilterByText placeholder={appsSearchPlaceholders[context]} onChange={setText}>
{!isPrivateAppsPage && (
<RadioDropDown group={freePaidFilterStructure} onSelected={freePaidFilterOnSelected} flexGrow={1} {...fixFiltersSize} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
import { States, StatesIcon, StatesTitle, StatesSubtitle, StatesActions } from '@rocket.chat/fuselage';
import { States, StatesIcon, StatesTitle, StatesSubtitle, StatesActions, Button } from '@rocket.chat/fuselage';
import { usePermission } from '@rocket.chat/ui-contexts';
import React from 'react';
import { useTranslation } from 'react-i18next';

import { useExternalLink } from '../../../hooks/useExternalLink';
import UpgradeButton from '../../admin/subscription/components/UpgradeButton';
import { PRICING_LINK } from '../../admin/subscription/utils/links';

const PrivateEmptyStateUpgrade = () => {
const { t } = useTranslation();
const isAdmin = usePermission('manage-apps');

const handleOpenLink = useExternalLink();

return (
<States>
<StatesIcon name='lightning' />
<StatesTitle>{t('Private_apps_upgrade_empty_state_title')}</StatesTitle>
<StatesSubtitle>{t('Private_apps_upgrade_empty_state_description')}</StatesSubtitle>
{isAdmin && (
<StatesActions>
<StatesActions>
{isAdmin && (
<UpgradeButton primary icon={undefined} target='private-apps-header' action='upgrade'>
{t('Upgrade')}
</UpgradeButton>
</StatesActions>
)}
)}
{!isAdmin && (
<Button onClick={() => handleOpenLink(PRICING_LINK)} role='link'>
{t('Learn_more')}
</Button>
)}
</StatesActions>
</States>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 =
Expand All @@ -35,6 +35,12 @@ const UninstallGrandfatheredAppModal = ({ context, limit, appName, handleUninsta
<MarkdownText content={modalContent} />
</Modal.Content>
<Modal.Footer>
<Modal.FooterAnnotation>
{/* TODO: Move the link to a go link when available */}
<a target='_blank' rel='noopener noreferrer' href='https://docs.rocket.chat/docs/rocketchat-marketplace'>
{t('Learn_more')}
</a>
</Modal.FooterAnnotation>
<Modal.FooterControllers>
<Button onClick={handleClose}>{t('Cancel')}</Button>
<Button danger onClick={handleUninstall}>
Expand Down
1 change: 0 additions & 1 deletion packages/i18n/src/locales/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -6532,7 +6532,6 @@
"MAC_InfoText": "(MAC) the number of unique omnichannel contacts engaged with during the billing month.",
"CountMAC_InfoText": "(MAC) the number of unique omnichannel contacts engaged with during the calendar month.",
"ActiveSessions_InfoText": "Total concurrent connections. A single user can be connected multiple times. User presence service is disabled at 200 or more to prevent performance issues.",
"Apps_InfoText": "Community allows up to {{privateAppsMaxCount}} private apps and {{marketplaceAppsMaxCount}} marketplace apps to be enabled",
"Apps_InfoText_limited": "Community workspaces can enable up to {{marketplaceAppsMaxCount}} marketplace apps. Private apps can only be enabled in <1>premium plans</1>.",
"Remove_RocketChat_Watermark_InfoText": "Watermark is automatically removed when a paid license is active.",
"Remove_RocketChat_Watermark": "Remove Rocket.Chat watermark",
Expand Down
1 change: 0 additions & 1 deletion packages/i18n/src/locales/es.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -5064,7 +5064,6 @@
"MAC_InfoText": "Contactos Activos Mensuales (MAC). El número de contactos únicos de Omnichannel con quienes se interactuó durante un mes de facturación",
"CountMAC_InfoText": "Contactos Activos Mensuales (MAC). El número de contactos únicos de Omnichannel con quienes se interactuó durante un mes calendario",
"ActiveSessions_InfoText": "Total de conexiones concurrentes. Un usuario puede estar conectado varias veces. El servicio de presencia de usuario se deshabilita cuando el total llega a 200 conexiones para prevenir problemas de rendimiento",
"Apps_InfoText": "Comunidad permite hasta {{privateAppsMaxCount}} aplicaciones privadas y {{marketplaceAppsMaxCount}} aplicaciones de la tienda ser habilitadas",
"Remove_RocketChat_Watermark_InfoText": "La marca de agua es removida automticamente cuando una licencia de paga es activada",
"Remove_RocketChat_Watermark": "Remover marca de agua de Rocket.Chat",
"High_scalabaility": "Alta escalabilidad",
Expand Down
1 change: 0 additions & 1 deletion packages/i18n/src/locales/hi-IN.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -6105,7 +6105,6 @@
"MAC_InfoText": "(मैक) बिलिंग माह के दौरान जुड़े अद्वितीय सर्वचैनल संपर्कों की संख्या।",
"CountMAC_InfoText": "(मैक) कैलेंडर माह के दौरान जुड़े अद्वितीय ओमनीचैनल संपर्कों की संख्या।",
"ActiveSessions_InfoText": "कुल समवर्ती कनेक्शन. एक ही यूजर को कई बार कनेक्ट किया जा सकता है। प्रदर्शन समस्याओं को रोकने के लिए उपयोगकर्ता उपस्थिति सेवा 200 या उससे अधिक पर अक्षम है।",
"Apps_InfoText": "समुदाय {{privateAppsMaxCount}} निजी ऐप्स और {{marketplaceAppsMaxCount}} मार्केटप्लेस ऐप्स को सक्षम करने की अनुमति देता है",
"Remove_RocketChat_Watermark_InfoText": "सशुल्क लाइसेंस सक्रिय होने पर वॉटरमार्क स्वचालित रूप से हटा दिया जाता है।",
"Remove_RocketChat_Watermark": "रॉकेट.चैट वॉटरमार्क हटाएँ",
"High_scalabaility": "उच्च मापनीयता",
Expand Down
1 change: 0 additions & 1 deletion packages/i18n/src/locales/pl.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -5418,7 +5418,6 @@
"UpgradeToGetMore_accessibility-certification_Body": "Zgodność ze standardami WCAG i BITV dzięki programowi dostępności Rocket.Chat.",
"UpgradeToGetMore_engagement-dashboard_Title": "Analityka",
"UpgradeToGetMore_auditing_Title": "Audyt wiadomości",
"Apps_InfoText": "Wersja Community umożliwia włączenie do {{privateAppsMaxCount}} aplikacji prywatnych i {{marketplaceAppsMaxCount}} aplikacji marketplace",
"Anyone_can_react_to_messages": "Każdy może reagować na wiadomości",
"Anyone_can_access": "Każdy może uzyskać dostęp",
"Broadcast_hint_enabled": "Tylko właściciele {{roomType}} mogą pisać nowe wiadomości, ale każdy może odpowiadać w wątku",
Expand Down

0 comments on commit 9ddc11f

Please sign in to comment.