From 2d45272bc834aa50e41c7f26aba0d3327fff1436 Mon Sep 17 00:00:00 2001 From: Gabriel Hernandez Date: Thu, 10 Apr 2025 14:01:06 +0100 Subject: [PATCH] show user card when needed on host details and my device page (#28073) Quick change to show the user card with user data on host details and my device page --- .../details/DeviceUserPage/DeviceUserPage.tsx | 42 +++---------------- .../HostDetailsPage/HostDetailsPage.tsx | 8 ++-- 2 files changed, 9 insertions(+), 41 deletions(-) diff --git a/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx b/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx index a36c2acc96..ed92913d23 100644 --- a/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx +++ b/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx @@ -388,38 +388,6 @@ const DeviceUserPage = ({ setSelectedCertificate(certificate); }; - const testEndUserData: IHostEndUser[] = [ - { - idp_id: "1234567890", - idp_username: "test", - idp_full_name: "Test User", - idp_info_updated_at: "2023-10-01T00:00:00Z", - // idp_info_updated_at: null, - idp_groups: [ - "apple", - "test group", - "Test Group 2", - "Test Group 3", - "test Group 4", - "kite", - ], - other_emails: [ - { - email: "another-email@test.com", - source: "google_chrome_profiles", - }, - { - email: "another-email-2@test.com", - source: "google_chrome_profiles", - }, - { - email: "custom-email@test.com", - source: "custom", - }, - ], - }, - ]; - const renderDeviceUserPage = () => { const failingPoliciesCount = host?.issues?.failing_policies_count || 0; @@ -445,10 +413,10 @@ const DeviceUserPage = ({ const isSoftwareEnabled = !!globalConfig?.features ?.enable_software_inventory; - const showUsersCard = false; - // host?.platform === "darwin" || - // generateChromeProfilesValues(host?.end_users ?? []).length > 0 || - // generateOtherEmailsValues(host?.end_users ?? []).length > 0; + const showUsersCard = + host?.platform === "darwin" || + generateChromeProfilesValues(host?.end_users ?? []).length > 0 || + generateOtherEmailsValues(host?.end_users ?? []).length > 0; return (
@@ -527,7 +495,7 @@ const DeviceUserPage = ({ 0 || - // generateOtherEmailsValues(host.end_users ?? []).length > 0; + const showUsersCard = + isDarwinHost || + generateChromeProfilesValues(host.end_users ?? []).length > 0 || + generateOtherEmailsValues(host.end_users ?? []).length > 0; const showActivityCard = !isAndroidHost; const showAgentOptionsCard = !isIosOrIpadosHost && !isAndroidHost; const showLocalUserAccountsCard = !isIosOrIpadosHost && !isAndroidHost;