Disk encryption loose ends (#10541)

## Addresses #9402, #9404

## Implements

- Hides the disk encryption aggregate table while API is WIP (#9434)
- Conditionally hits a different endpoint when setting disk encryption
for team_id = 0
<img width="1282" alt="Screenshot 2023-03-16 at 3 17 18 PM"
src="https://user-images.githubusercontent.com/61553566/225764940-afce847d-bac9-4d01-a17d-5a56c2ebf3b5.png">

## Checklist for submitter

If some of the following don't apply, delete the relevant line.
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
Jacob Shandling 2023-03-16 15:31:24 -07:00 committed by GitHub
parent aadfb12d51
commit 92f47c7716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -77,7 +77,8 @@ const DiskEncryption = ({ currentTeamId }: IDiskEncryptionProps) => {
<PremiumFeatureMessage />
) : (
<>
{showAggregate ? (
{/* remove && false to show the table once the API is finished */}
{showAggregate && false ? (
<DiskEncryptionTable currentTeamId={currentTeamId} />
) : null}
<Checkbox

View File

@ -87,9 +87,18 @@ export default {
},
updateAppleMdmSettings: (enableDiskEncryption: boolean, teamId?: number) => {
const { MDM_UPDATE_APPLE_SETTINGS } = endpoints;
return sendRequest("PATCH", MDM_UPDATE_APPLE_SETTINGS, {
const {
MDM_UPDATE_APPLE_SETTINGS: teamsEndpoint,
CONFIG: noTeamsEndpoint,
} = endpoints;
if (teamId === 0) {
return sendRequest("PATCH", noTeamsEndpoint, {
mdm: {
macos_settings: { enable_disk_encryption: enableDiskEncryption },
},
});
}
return sendRequest("PATCH", teamsEndpoint, {
enable_disk_encryption: enableDiskEncryption,
team_id: teamId,
});