mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
add activities for windows profiles (#15246)
relates to #14359 Add activities to fleet UI for windows profiles create, delete, and edit. - [x] Manual QA for all new/changed functionality
This commit is contained in:
parent
29671f4249
commit
fd40f3ddf7
@ -38,6 +38,9 @@ export enum ActivityType {
|
||||
CreatedMacOSProfile = "created_macos_profile",
|
||||
DeletedMacOSProfile = "deleted_macos_profile",
|
||||
EditedMacOSProfile = "edited_macos_profile",
|
||||
CreatedWindowsProfile = "created_windows_profile",
|
||||
DeletedWindowsProfile = "deleted_windows_profile",
|
||||
EditedWindowsProfile = "edited_windows_profile",
|
||||
EnabledMacDiskEncryption = "enabled_macos_disk_encryption",
|
||||
DisabledMacDiskEncryption = "disabled_macos_disk_encryption",
|
||||
AddedBootstrapPackage = "added_bootstrap_package",
|
||||
|
@ -32,16 +32,18 @@ const PREMIUM_ACTIVITIES = new Set([
|
||||
|
||||
const getProfileMessageSuffix = (
|
||||
isPremiumTier: boolean,
|
||||
platform: "darwin" | "windows",
|
||||
teamName?: string | null
|
||||
) => {
|
||||
let messageSuffix = <>all macOS hosts</>;
|
||||
const platformDisplayName = platform === "darwin" ? "macOS" : "Windows";
|
||||
let messageSuffix = <>all {platformDisplayName} hosts</>;
|
||||
if (isPremiumTier) {
|
||||
messageSuffix = teamName ? (
|
||||
<>
|
||||
macOS hosts assigned to the <b>{teamName}</b> team
|
||||
{platformDisplayName} hosts assigned to the <b>{teamName}</b> team
|
||||
</>
|
||||
) : (
|
||||
<>macOS hosts with no team</>
|
||||
<>{platformDisplayName} hosts with no team</>
|
||||
);
|
||||
}
|
||||
return messageSuffix;
|
||||
@ -318,7 +320,6 @@ const TAGGED_TEMPLATES = {
|
||||
</>
|
||||
);
|
||||
},
|
||||
|
||||
createMacOSProfile: (activity: IActivity, isPremiumTier: boolean) => {
|
||||
const profileName = activity.details?.profile_name;
|
||||
return (
|
||||
@ -330,12 +331,16 @@ const TAGGED_TEMPLATES = {
|
||||
) : (
|
||||
<>a configuration profile</>
|
||||
)}{" "}
|
||||
to {getProfileMessageSuffix(isPremiumTier, activity.details?.team_name)}
|
||||
to{" "}
|
||||
{getProfileMessageSuffix(
|
||||
isPremiumTier,
|
||||
"darwin",
|
||||
activity.details?.team_name
|
||||
)}
|
||||
.
|
||||
</>
|
||||
);
|
||||
},
|
||||
|
||||
deleteMacOSProfile: (activity: IActivity, isPremiumTier: boolean) => {
|
||||
const profileName = activity.details?.profile_name;
|
||||
return (
|
||||
@ -348,11 +353,15 @@ const TAGGED_TEMPLATES = {
|
||||
<>a configuration profile</>
|
||||
)}{" "}
|
||||
from{" "}
|
||||
{getProfileMessageSuffix(isPremiumTier, activity.details?.team_name)}.
|
||||
{getProfileMessageSuffix(
|
||||
isPremiumTier,
|
||||
"darwin",
|
||||
activity.details?.team_name
|
||||
)}
|
||||
.
|
||||
</>
|
||||
);
|
||||
},
|
||||
|
||||
editMacOSProfile: (activity: IActivity, isPremiumTier: boolean) => {
|
||||
return (
|
||||
<>
|
||||
@ -360,6 +369,63 @@ const TAGGED_TEMPLATES = {
|
||||
edited configuration profiles for{" "}
|
||||
{getProfileMessageSuffix(
|
||||
isPremiumTier,
|
||||
"darwin",
|
||||
activity.details?.team_name
|
||||
)}{" "}
|
||||
via fleetctl.
|
||||
</>
|
||||
);
|
||||
},
|
||||
createWindowsProfile: (activity: IActivity, isPremiumTier: boolean) => {
|
||||
const profileName = activity.details?.profile_name;
|
||||
return (
|
||||
<>
|
||||
{" "}
|
||||
added{" "}
|
||||
{profileName ? (
|
||||
<>configuration profile {profileName}</>
|
||||
) : (
|
||||
<>a configuration profile</>
|
||||
)}{" "}
|
||||
to{" "}
|
||||
{getProfileMessageSuffix(
|
||||
isPremiumTier,
|
||||
"windows",
|
||||
activity.details?.team_name
|
||||
)}
|
||||
.
|
||||
</>
|
||||
);
|
||||
},
|
||||
deleteWindowsProfile: (activity: IActivity, isPremiumTier: boolean) => {
|
||||
const profileName = activity.details?.profile_name;
|
||||
return (
|
||||
<>
|
||||
{" "}
|
||||
deleted{" "}
|
||||
{profileName ? (
|
||||
<>configuration profile {profileName}</>
|
||||
) : (
|
||||
<>a configuration profile</>
|
||||
)}{" "}
|
||||
from{" "}
|
||||
{getProfileMessageSuffix(
|
||||
isPremiumTier,
|
||||
"windows",
|
||||
activity.details?.team_name
|
||||
)}
|
||||
.
|
||||
</>
|
||||
);
|
||||
},
|
||||
editWindowsProfile: (activity: IActivity, isPremiumTier: boolean) => {
|
||||
return (
|
||||
<>
|
||||
{" "}
|
||||
edited configuration profiles for{" "}
|
||||
{getProfileMessageSuffix(
|
||||
isPremiumTier,
|
||||
"windows",
|
||||
activity.details?.team_name
|
||||
)}{" "}
|
||||
via fleetctl.
|
||||
@ -692,6 +758,15 @@ const getDetail = (
|
||||
case ActivityType.EditedMacOSProfile: {
|
||||
return TAGGED_TEMPLATES.editMacOSProfile(activity, isPremiumTier);
|
||||
}
|
||||
case ActivityType.CreatedWindowsProfile: {
|
||||
return TAGGED_TEMPLATES.createWindowsProfile(activity, isPremiumTier);
|
||||
}
|
||||
case ActivityType.DeletedWindowsProfile: {
|
||||
return TAGGED_TEMPLATES.deleteWindowsProfile(activity, isPremiumTier);
|
||||
}
|
||||
case ActivityType.EditedWindowsProfile: {
|
||||
return TAGGED_TEMPLATES.editWindowsProfile(activity, isPremiumTier);
|
||||
}
|
||||
case ActivityType.EnabledMacDiskEncryption: {
|
||||
return TAGGED_TEMPLATES.enableMacDiskEncryption(activity);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user