Skip to content

Commit

Permalink
fix: Engagement Dashboard and Device Management admin pages loading i…
Browse files Browse the repository at this point in the history
…ndefinitely (#32284)
  • Loading branch information
gabriellsh authored Apr 24, 2024
1 parent 86ec6f7 commit 105a1eb
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/yellow-lies-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

fixed Engagement Dashboard and Device Management admin pages loading indefinitely
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const DeviceManagementAdminRoute = (): ReactElement => {
const t = useTranslation();
const router = useRouter();
const setModal = useSetModal();
const isModalOpen = useCurrentModal() !== null;
const isModalOpen = !!useCurrentModal();

const hasDeviceManagement = useHasLicenseModule('device-management') as boolean;
const canViewDeviceManagement = usePermission('view-device-management');
Expand All @@ -25,6 +25,7 @@ const DeviceManagementAdminRoute = (): ReactElement => {
if (shouldShowUpsell) {
setModal(
<GenericUpsellModal
aria-label={t('Device_Management')}
title={t('Device_Management')}
img={getURL('images/device-management.png')}
subtitle={t('Ensure_secure_workspace_access')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const EngagementDashboardRoute = (): ReactElement | null => {
const t = useTranslation();
const canViewEngagementDashboard = usePermission('view-engagement-dashboard');
const setModal = useSetModal();
const isModalOpen = useCurrentModal() !== null;
const isModalOpen = !!useCurrentModal();

const router = useRouter();
const tab = useRouteParameter('tab');
Expand All @@ -39,6 +39,7 @@ const EngagementDashboardRoute = (): ReactElement | null => {
if (shouldShowUpsell) {
setModal(
<GenericUpsellModal
aria-label={t('Engagement_Dashboard')}
title={t('Engagement_Dashboard')}
img={getURL('images/engagement.png')}
subtitle={t('Analyze_practical_usage')}
Expand Down
32 changes: 32 additions & 0 deletions apps/meteor/tests/e2e/administration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.beforeEach(async ({ page }) => {
await page.goto('/admin/users');
Expand Down

0 comments on commit 105a1eb

Please sign in to comment.