mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
add min macos version edited activitiy (#9607)
relates to https://github.com/fleetdm/fleet/issues/9352 adds an edited minimum mac os version activity to the UI **with team:**  **without team:**  - [x] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [x] Manual QA for all new/changed functionality
This commit is contained in:
parent
ffed7f8ebe
commit
68c4e69a57
3 changed files with 38 additions and 2 deletions
1
changes/issue-9352-add-min-macos-version-edit-activity
Normal file
1
changes/issue-9352-add-min-macos-version-edit-activity
Normal file
|
|
@ -0,0 +1 @@
|
|||
- add edited min macos version activity
|
||||
|
|
@ -31,6 +31,7 @@ export enum ActivityType {
|
|||
UserDeletedTeamRole = "deleted_user_team_role",
|
||||
MdmEnrolled = "mdm_enrolled",
|
||||
MdmUnenrolled = "mdm_unenrolled",
|
||||
EditedMacosMinVersion = "edited_macos_min_version",
|
||||
}
|
||||
export interface IActivity {
|
||||
created_at: string;
|
||||
|
|
@ -50,8 +51,8 @@ export interface IActivityDetails {
|
|||
query_id?: number;
|
||||
query_name?: string;
|
||||
query_sql?: string;
|
||||
team_id?: number;
|
||||
team_name?: string;
|
||||
team_id?: number | null;
|
||||
team_name?: string | null;
|
||||
teams?: ITeamSummary[];
|
||||
targets_count?: number;
|
||||
specs?: IQuery[] | IPolicy[];
|
||||
|
|
@ -63,4 +64,6 @@ export interface IActivityDetails {
|
|||
host_serial?: string;
|
||||
host_display_name?: string;
|
||||
installed_from_dep?: boolean;
|
||||
minimum_version?: string;
|
||||
deadline?: string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,6 +170,35 @@ const TAGGED_TEMPLATES = {
|
|||
</>
|
||||
);
|
||||
},
|
||||
editedMacosMinVersion: (activity: IActivity) => {
|
||||
const editedActivity =
|
||||
activity.details?.minimum_version === "" ? "removed" : "updated";
|
||||
|
||||
const versionSection = activity.details?.minimum_version ? (
|
||||
<>
|
||||
to <b>{activity.details.minimum_version}</b>
|
||||
</>
|
||||
) : null;
|
||||
|
||||
const deadlineSection = activity.details?.deadline ? (
|
||||
<>(deadline: {activity.details.deadline})</>
|
||||
) : null;
|
||||
|
||||
const teamSection = activity.details?.team_id ? (
|
||||
<>
|
||||
the <b>{activity.details.team_name}</b> team
|
||||
</>
|
||||
) : (
|
||||
<>no team</>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{editedActivity} the minimum macOS version {versionSection}{" "}
|
||||
{deadlineSection} on hosts assigned to {teamSection}.
|
||||
</>
|
||||
);
|
||||
},
|
||||
|
||||
defaultActivityTemplate: (activity: IActivity) => {
|
||||
const entityName = find(activity.details, (_, key) =>
|
||||
|
|
@ -248,6 +277,9 @@ const getDetail = (
|
|||
case ActivityType.MdmUnenrolled: {
|
||||
return TAGGED_TEMPLATES.mdmUnenrolled(activity);
|
||||
}
|
||||
case ActivityType.EditedMacosMinVersion: {
|
||||
return TAGGED_TEMPLATES.editedMacosMinVersion(activity);
|
||||
}
|
||||
default: {
|
||||
return TAGGED_TEMPLATES.defaultActivityTemplate(activity);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue