Add activities for enabling/disabling "update new hosts to latest" (#37089)

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #37088

# Details

This just adds the new activities for use in the API handler and the
front-end. I neglected to include this in the spec so I'm putting up a
quick PR to keep from adding to the back-end ticket scope.

# Checklist for submitter

No checklist items apply here; it just needs to implement what's laid
out in https://github.com/fleetdm/fleet/pull/35777/files.

---------

Co-authored-by: Juan Fernandez <juan@fleetdm.com>
This commit is contained in:
Scott Gress
2025-12-12 11:04:36 -06:00
committed by GitHub
co-authored by Juan Fernandez
parent fffbef38ee
commit 9e12e3cb72
2 changed files with 74 additions and 0 deletions
+40
View File
@@ -137,6 +137,8 @@ var ActivityDetailsList = []ActivityDetails{
ActivityTypeEditedIOSMinVersion{},
ActivityTypeEditedIPadOSMinVersion{},
ActivityTypeEditedWindowsUpdates{},
ActivityTypeEnabledMacosUpdateNewHosts{},
ActivityTypeDisabledMacosUpdateNewHosts{},
ActivityTypeReadHostDiskEncryptionKey{},
@@ -1117,6 +1119,44 @@ func (a ActivityTypeEditedMacOSMinVersion) Documentation() (activity string, det
}`
}
type ActivityTypeEnabledMacosUpdateNewHosts struct {
TeamID *uint `json:"team_id"`
TeamName *string `json:"team_name"`
}
func (a ActivityTypeEnabledMacosUpdateNewHosts) ActivityName() string {
return "enabled_macos_update_new_hosts"
}
func (a ActivityTypeEnabledMacosUpdateNewHosts) Documentation() (activity string, details string, detailsExample string) {
return `Generated when a user turns on updates during macOS Setup Assistant for hosts that automatically enroll (ADE).`,
`This activity contains the following fields:
- "team_id": The ID of the team that the setting applies to, ` + "`null`" + ` if it applies to devices that are not in a team.
- "team_name": The name of the team that the setting applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{
"team_id": 123,
"team_name": "Workstations"
}`
}
type ActivityTypeDisabledMacosUpdateNewHosts struct {
TeamID *uint `json:"team_id"`
TeamName *string `json:"team_name"`
}
func (a ActivityTypeDisabledMacosUpdateNewHosts) ActivityName() string {
return "disabled_macos_update_new_hosts"
}
func (a ActivityTypeDisabledMacosUpdateNewHosts) Documentation() (activity string, details string, detailsExample string) {
return `Generated when a user turns off updates during macOS Setup Assistant for hosts that automatically enroll (ADE).`,
`This activity contains the following fields:
- "team_id": The ID of the team that the setting applies to, ` + "`null`" + ` if it applies to devices that are not in a team.
- "team_name": The name of the team that the setting applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{
"team_id": 123,
"team_name": "Workstations"
}`
}
type ActivityTypeEditedWindowsUpdates struct {
TeamID *uint `json:"team_id"`
TeamName *string `json:"team_name"`