Skip to content

Commit c4b3089

Browse files
authored
Fleet UI: Managed account > Host details page modal + Activity feeds (#43353)
1 parent d5228ac commit c4b3089

19 files changed

Lines changed: 729 additions & 2 deletions

File tree

frontend/interfaces/activity.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ export enum ActivityType {
162162
AddedMicrosoftEntraTenant = "added_microsoft_entra_tenant",
163163
DeletedMicrosoftEntraTenant = "deleted_microsoft_entra_tenant",
164164
ClearedPasscode = "cleared_passcode",
165+
EnabledManagedLocalAccount = "enabled_managed_local_account",
166+
DisabledManagedLocalAccount = "disabled_managed_local_account",
167+
ViewedManagedLocalAccount = "read_managed_local_account",
168+
CreatedManagedLocalAccount = "created_managed_local_account",
165169
}
166170

167171
/** This is a subset of ActivityType that are shown only for the host past activities */
@@ -184,7 +188,9 @@ export type IHostPastActivityType =
184188
| ActivityType.CanceledSetupExperience
185189
| ActivityType.InstalledCertificate
186190
| ActivityType.ResentCertificate
187-
| ActivityType.ClearedPasscode;
191+
| ActivityType.ClearedPasscode
192+
| ActivityType.ViewedManagedLocalAccount
193+
| ActivityType.CreatedManagedLocalAccount;
188194

189195
/** This is a subset of ActivityType that are shown only for the host upcoming activities */
190196
export type IHostUpcomingActivityType =
@@ -466,4 +472,9 @@ export const ACTIVITY_TYPE_TO_FILTER_LABEL: Record<ActivityType, string> = {
466472
[ActivityType.InstalledCertificate]: "Installed certificate",
467473
[ActivityType.EditedEnrollSecrets]: "Edited enroll secrets",
468474
[ActivityType.ClearedPasscode]: "Cleared passcode",
475+
[ActivityType.EnabledManagedLocalAccount]: "Turned on managed local account",
476+
[ActivityType.DisabledManagedLocalAccount]:
477+
"Turned off managed local account",
478+
[ActivityType.ViewedManagedLocalAccount]: "Viewed managed account",
479+
[ActivityType.CreatedManagedLocalAccount]: "Created managed account",
469480
};

frontend/interfaces/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ export interface IMdmConfig {
8484
require_all_software_macos: boolean | null;
8585
lock_end_user_info: boolean | null;
8686
};
87+
macos_setup: {
88+
enable_managed_local_account?: boolean;
89+
};
8790
macos_migration: IMacOsMigrationSettings;
8891
windows_updates: {
8992
deadline_days: number | null;

frontend/interfaces/host.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ export interface IOSSettings {
129129
detail: string;
130130
password_available: boolean;
131131
};
132+
managed_local_account?: {
133+
status: string | null;
134+
password_available: boolean;
135+
};
132136
certificates: IHostAndroidCert[];
133137
}
134138

@@ -258,6 +262,15 @@ export interface IHostRecoveryLockPasswordResponse {
258262
};
259263
}
260264

265+
export interface IHostManagedAccountPasswordResponse {
266+
host_id: number;
267+
managed_account_password: {
268+
username: string;
269+
password: string;
270+
updated_at: string;
271+
};
272+
}
273+
261274
export interface IHostIssues {
262275
total_issues_count: number;
263276
critical_vulnerabilities_count?: number; // Premium

frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tsx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,54 @@ const TAGGED_TEMPLATES = {
512512
</>
513513
);
514514
},
515+
enabledManagedLocalAccount: (activity: IActivity) => {
516+
return (
517+
<>
518+
{" "}
519+
enabled managed local accounts for hosts assigned to the{" "}
520+
{activity.details?.team_name ? (
521+
<>
522+
<b>{activity.details.team_name}</b> fleet.
523+
</>
524+
) : (
525+
"hosts with no fleet."
526+
)}
527+
</>
528+
);
529+
},
530+
disabledManagedLocalAccount: (activity: IActivity) => {
531+
return (
532+
<>
533+
{" "}
534+
disabled managed local accounts for hosts assigned to the{" "}
535+
{activity.details?.team_name ? (
536+
<>
537+
<b>{activity.details.team_name}</b> fleet.
538+
</>
539+
) : (
540+
"hosts with no fleet."
541+
)}
542+
</>
543+
);
544+
},
545+
viewedManagedLocalAccount: (activity: IActivity) => {
546+
return (
547+
<>
548+
{" "}
549+
viewed the managed local account on{" "}
550+
<b>{activity.details?.host_display_name}</b>.
551+
</>
552+
);
553+
},
554+
createdManagedLocalAccount: (activity: IActivity) => {
555+
return (
556+
<>
557+
{" "}
558+
created a managed local account for{" "}
559+
<b>{activity.details?.host_display_name}</b>.
560+
</>
561+
);
562+
},
515563
createdAppleOSProfile: (activity: IActivity, isPremiumTier: boolean) => {
516564
const profileName = activity.details?.profile_name;
517565
return (
@@ -1916,6 +1964,18 @@ const getDetail = (activity: IActivity, isPremiumTier: boolean) => {
19161964
case ActivityType.RotatedHostRecoveryLockPassword: {
19171965
return TAGGED_TEMPLATES.rotatedHostRecoveryLockPassword(activity);
19181966
}
1967+
case ActivityType.EnabledManagedLocalAccount: {
1968+
return TAGGED_TEMPLATES.enabledManagedLocalAccount(activity);
1969+
}
1970+
case ActivityType.DisabledManagedLocalAccount: {
1971+
return TAGGED_TEMPLATES.disabledManagedLocalAccount(activity);
1972+
}
1973+
case ActivityType.ViewedManagedLocalAccount: {
1974+
return TAGGED_TEMPLATES.viewedManagedLocalAccount(activity);
1975+
}
1976+
case ActivityType.CreatedManagedLocalAccount: {
1977+
return TAGGED_TEMPLATES.createdManagedLocalAccount(activity);
1978+
}
19191979
case ActivityType.CreatedAppleOSProfile: {
19201980
return TAGGED_TEMPLATES.createdAppleOSProfile(activity, isPremiumTier);
19211981
}

0 commit comments

Comments
 (0)