Windows Migration: support the new activities in the UI (#24279)

This commit is contained in:
Martin Angers 2024-12-02 15:30:51 -05:00 committed by GitHub
parent 1677a0ae29
commit 4d732113e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions

View file

@ -69,6 +69,8 @@ export enum ActivityType {
TransferredHosts = "transferred_hosts",
EnabledWindowsMdm = "enabled_windows_mdm",
DisabledWindowsMdm = "disabled_windows_mdm",
EnabledWindowsMdmMigration = "enabled_windows_mdm_migration",
DisabledWindowsMdmMigration = "disabled_windows_mdm_migration",
RanScript = "ran_script",
AddedScript = "added_script",
DeletedScript = "deleted_script",

View file

@ -37,6 +37,8 @@ const PREMIUM_ACTIVITIES = new Set([
"enabled_macos_setup_end_user_auth",
"disabled_macos_setup_end_user_auth",
"tranferred_hosts",
"enabled_windows_mdm_migration",
"disabled_windows_mdm_migration",
]);
const getProfileMessageSuffix = (
@ -663,6 +665,24 @@ const TAGGED_TEMPLATES = {
disabledWindowsMdm: () => {
return <> told Fleet to turn off Windows MDM features.</>;
},
enabledWindowsMdmMigration: () => {
return (
<>
{" "}
told Fleet to automatically migrate Windows hosts connected to another
MDM solution.
</>
);
},
disabledWindowsMdmMigration: () => {
return (
<>
{" "}
told Fleet to stop migrating Windows hosts connected to another MDM
solution.
</>
);
},
// TODO: Combine ranScript template with host details page templates
// frontend/pages/hosts/details/cards/Activity/PastActivity/PastActivity.tsx and
// frontend/pages/hosts/details/cards/Activity/UpcomingActivity/UpcomingActivity.tsx
@ -1262,6 +1282,12 @@ const getDetail = (
case ActivityType.DisabledWindowsMdm: {
return TAGGED_TEMPLATES.disabledWindowsMdm();
}
case ActivityType.EnabledWindowsMdmMigration: {
return TAGGED_TEMPLATES.enabledWindowsMdmMigration();
}
case ActivityType.DisabledWindowsMdmMigration: {
return TAGGED_TEMPLATES.disabledWindowsMdmMigration();
}
case ActivityType.RanScript: {
return TAGGED_TEMPLATES.ranScript(activity, onDetailsClick);
}