Skip to content
Snippets Groups Projects
Unverified Commit 105a1ebd authored by gabriellsh's avatar gabriellsh Committed by GitHub
Browse files

fix: Engagement Dashboard and Device Management admin pages loading indefinitely (#32284)

parent 86ec6f75
No related branches found
No related tags found
No related merge requests found
---
"@rocket.chat/meteor": patch
---
fixed Engagement Dashboard and Device Management admin pages loading indefinitely
...@@ -14,7 +14,7 @@ const DeviceManagementAdminRoute = (): ReactElement => { ...@@ -14,7 +14,7 @@ const DeviceManagementAdminRoute = (): ReactElement => {
const t = useTranslation(); const t = useTranslation();
const router = useRouter(); const router = useRouter();
const setModal = useSetModal(); const setModal = useSetModal();
const isModalOpen = useCurrentModal() !== null; const isModalOpen = !!useCurrentModal();
const hasDeviceManagement = useHasLicenseModule('device-management') as boolean; const hasDeviceManagement = useHasLicenseModule('device-management') as boolean;
const canViewDeviceManagement = usePermission('view-device-management'); const canViewDeviceManagement = usePermission('view-device-management');
...@@ -25,6 +25,7 @@ const DeviceManagementAdminRoute = (): ReactElement => { ...@@ -25,6 +25,7 @@ const DeviceManagementAdminRoute = (): ReactElement => {
if (shouldShowUpsell) { if (shouldShowUpsell) {
setModal( setModal(
<GenericUpsellModal <GenericUpsellModal
aria-label={t('Device_Management')}
title={t('Device_Management')} title={t('Device_Management')}
img={getURL('images/device-management.png')} img={getURL('images/device-management.png')}
subtitle={t('Ensure_secure_workspace_access')} subtitle={t('Ensure_secure_workspace_access')}
......
...@@ -25,7 +25,7 @@ const EngagementDashboardRoute = (): ReactElement | null => { ...@@ -25,7 +25,7 @@ const EngagementDashboardRoute = (): ReactElement | null => {
const t = useTranslation(); const t = useTranslation();
const canViewEngagementDashboard = usePermission('view-engagement-dashboard'); const canViewEngagementDashboard = usePermission('view-engagement-dashboard');
const setModal = useSetModal(); const setModal = useSetModal();
const isModalOpen = useCurrentModal() !== null; const isModalOpen = !!useCurrentModal();
const router = useRouter(); const router = useRouter();
const tab = useRouteParameter('tab'); const tab = useRouteParameter('tab');
...@@ -39,6 +39,7 @@ const EngagementDashboardRoute = (): ReactElement | null => { ...@@ -39,6 +39,7 @@ const EngagementDashboardRoute = (): ReactElement | null => {
if (shouldShowUpsell) { if (shouldShowUpsell) {
setModal( setModal(
<GenericUpsellModal <GenericUpsellModal
aria-label={t('Engagement_Dashboard')}
title={t('Engagement_Dashboard')} title={t('Engagement_Dashboard')}
img={getURL('images/engagement.png')} img={getURL('images/engagement.png')}
subtitle={t('Analyze_practical_usage')} subtitle={t('Analyze_practical_usage')}
......
...@@ -29,6 +29,38 @@ test.describe.parallel('administration', () => { ...@@ -29,6 +29,38 @@ test.describe.parallel('administration', () => {
}); });
}); });
test.describe('Engagement dashboard', () => {
test('Should show upsell modal', async ({ page }) => {
test.skip(IS_EE);
await page.goto('/admin/engagement/users');
await expect(page.locator('role=dialog[name="Engagement dashboard"]')).toBeVisible();
});
test('Should show engagement dashboard', async ({ page }) => {
test.skip(!IS_EE);
await page.goto('/admin/engagement/users');
await expect(page.locator('h1 >> text="Engagement"')).toBeVisible();
});
});
test.describe('Device management', () => {
test('Should show upsell modal', async ({ page }) => {
test.skip(IS_EE);
await page.goto('/admin/device-management');
await expect(page.locator('role=dialog[name="Device management"]')).toBeVisible();
});
test('Should show device management page', async ({ page }) => {
test.skip(!IS_EE);
await page.goto('/admin/device-management');
await expect(page.locator('h1 >> text="Device management"')).toBeVisible();
});
});
test.describe('Users', () => { test.describe('Users', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await page.goto('/admin/users'); await page.goto('/admin/users');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment