From 563699d54f69c60c88f186fa1cd76893eb4758c4 Mon Sep 17 00:00:00 2001 From: gillespi314 <73313222+gillespi314@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:02:15 -0500 Subject: [PATCH] Update host details UI for OS settings to display Windows disk encryption error detail (#14625) --- frontend/__mocks__/hostMock.ts | 1 + frontend/__mocks__/mdmMock.ts | 1 + frontend/interfaces/host.ts | 1 + .../MacSettingsTable/MacSettingsTableConfig.tsx | 5 ++++- .../pages/hosts/details/cards/HostSummary/HostSummary.tsx | 3 ++- frontend/pages/hosts/details/helpers.ts | 5 +++-- 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/frontend/__mocks__/hostMock.ts b/frontend/__mocks__/hostMock.ts index 6834d0c703..e415c944e2 100644 --- a/frontend/__mocks__/hostMock.ts +++ b/frontend/__mocks__/hostMock.ts @@ -56,6 +56,7 @@ const DEFAULT_HOST_MOCK: IHost = { os_settings: { disk_encryption: { status: null, + detail: "", }, }, macos_settings: { diff --git a/frontend/__mocks__/mdmMock.ts b/frontend/__mocks__/mdmMock.ts index 5ffebcdbc3..78408c7827 100644 --- a/frontend/__mocks__/mdmMock.ts +++ b/frontend/__mocks__/mdmMock.ts @@ -39,6 +39,7 @@ const DEFAULT_HOST_MDM_DATA: IHostMdmData = { os_settings: { disk_encryption: { status: "verified", + detail: "", }, }, macos_settings: { diff --git a/frontend/interfaces/host.ts b/frontend/interfaces/host.ts index ebfde247f4..bdfa84be12 100644 --- a/frontend/interfaces/host.ts +++ b/frontend/interfaces/host.ts @@ -96,6 +96,7 @@ type MacDiskEncryptionActionRequired = "log_out" | "rotate_key" | null; export interface IOSSettings { disk_encryption: { status: DiskEncryptionStatus | null; + detail: string; }; } diff --git a/frontend/pages/hosts/details/MacSettingsModal/MacSettingsTable/MacSettingsTableConfig.tsx b/frontend/pages/hosts/details/MacSettingsModal/MacSettingsTable/MacSettingsTableConfig.tsx index f8d66ef82d..06801237fa 100644 --- a/frontend/pages/hosts/details/MacSettingsModal/MacSettingsTable/MacSettingsTableConfig.tsx +++ b/frontend/pages/hosts/details/MacSettingsModal/MacSettingsTable/MacSettingsTableConfig.tsx @@ -108,7 +108,10 @@ const makeWindowsRows = ({ os_settings }: IHostMdmData) => { const rows: ITableRowOsSettings[] = []; rows.push( - generateWinDiskEncryptionProfile(os_settings.disk_encryption.status) + generateWinDiskEncryptionProfile( + os_settings.disk_encryption.status, + os_settings.disk_encryption.detail + ) ); return rows; diff --git a/frontend/pages/hosts/details/cards/HostSummary/HostSummary.tsx b/frontend/pages/hosts/details/cards/HostSummary/HostSummary.tsx index 0908532909..5686205a88 100644 --- a/frontend/pages/hosts/details/cards/HostSummary/HostSummary.tsx +++ b/frontend/pages/hosts/details/cards/HostSummary/HostSummary.tsx @@ -197,7 +197,8 @@ const HostSummary = ({ isWindowsDiskEncryptionStatus(osSettings.disk_encryption.status) ) { const winDiskEncryptionProfile: IHostMdmProfile = generateWinDiskEncryptionProfile( - osSettings.disk_encryption.status + osSettings.disk_encryption.status, + osSettings.disk_encryption.detail ); hostMdmProfiles = hostMdmProfiles ? [...hostMdmProfiles, winDiskEncryptionProfile] diff --git a/frontend/pages/hosts/details/helpers.ts b/frontend/pages/hosts/details/helpers.ts index 2c1283be18..1657722951 100644 --- a/frontend/pages/hosts/details/helpers.ts +++ b/frontend/pages/hosts/details/helpers.ts @@ -21,13 +21,14 @@ const convertWinDiskEncryptionStatusToProfileStatus = ( */ // eslint-disable-next-line import/prefer-default-export export const generateWinDiskEncryptionProfile = ( - diskEncryptionStatus: IWindowsDiskEncryptionStatus + diskEncryptionStatus: IWindowsDiskEncryptionStatus, + detail: string ): IHostMdmProfile => { return { profile_id: 0, // This s the only type of profile that can have this number name: "Disk Encryption", status: convertWinDiskEncryptionStatusToProfileStatus(diskEncryptionStatus), - detail: "", + detail, operation_type: null, }; };