Fleet UI: Update profile activities to not include host platform (#20696)

This commit is contained in:
RachelElysia 2024-07-24 15:27:34 -04:00 committed by GitHub
parent 600617f4c4
commit 010bc54677
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,19 +36,16 @@ const PREMIUM_ACTIVITIES = new Set([
const getProfileMessageSuffix = (
isPremiumTier: boolean,
platform: "apple" | "windows",
teamName?: string | null
) => {
const platformDisplayName =
platform === "apple" ? "macOS, iOS, and iPadOS" : "Windows";
let messageSuffix = <>all {platformDisplayName} hosts</>;
let messageSuffix = <>hosts</>;
if (isPremiumTier) {
messageSuffix = teamName ? (
<>
{platformDisplayName} hosts assigned to the <b>{teamName}</b> team
the <b>{teamName}</b> team
</>
) : (
<>{platformDisplayName} hosts with no team</>
<>hosts with no team</>
);
}
return messageSuffix;
@ -359,12 +356,7 @@ const TAGGED_TEMPLATES = {
) : (
<>a configuration profile</>
)}{" "}
to{" "}
{getProfileMessageSuffix(
isPremiumTier,
"apple",
activity.details?.team_name
)}
to {getProfileMessageSuffix(isPremiumTier, activity.details?.team_name)}
.
</>
);
@ -383,12 +375,7 @@ const TAGGED_TEMPLATES = {
<>a configuration profile</>
)}{" "}
from{" "}
{getProfileMessageSuffix(
isPremiumTier,
"apple",
activity.details?.team_name
)}
.
{getProfileMessageSuffix(isPremiumTier, activity.details?.team_name)}.
</>
);
},
@ -399,7 +386,6 @@ const TAGGED_TEMPLATES = {
edited configuration profiles for{" "}
{getProfileMessageSuffix(
isPremiumTier,
"apple",
activity.details?.team_name
)}{" "}
via fleetctl.
@ -419,12 +405,7 @@ const TAGGED_TEMPLATES = {
) : (
<>a configuration profile</>
)}{" "}
to{" "}
{getProfileMessageSuffix(
isPremiumTier,
"windows",
activity.details?.team_name
)}
to {getProfileMessageSuffix(isPremiumTier, activity.details?.team_name)}
.
</>
);
@ -443,12 +424,7 @@ const TAGGED_TEMPLATES = {
<>a configuration profile</>
)}{" "}
from{" "}
{getProfileMessageSuffix(
isPremiumTier,
"windows",
activity.details?.team_name
)}
.
{getProfileMessageSuffix(isPremiumTier, activity.details?.team_name)}.
</>
);
},
@ -459,7 +435,6 @@ const TAGGED_TEMPLATES = {
edited configuration profiles for{" "}
{getProfileMessageSuffix(
isPremiumTier,
"windows",
activity.details?.team_name
)}{" "}
via fleetctl.
@ -779,12 +754,7 @@ const TAGGED_TEMPLATES = {
added declaration (DDM) profile <b>
{activity.details?.profile_name}
</b>{" "}
to{" "}
{getProfileMessageSuffix(
isPremiumTier,
"apple",
activity.details?.team_name
)}
to {getProfileMessageSuffix(isPremiumTier, activity.details?.team_name)}
.
</>
);
@ -795,12 +765,7 @@ const TAGGED_TEMPLATES = {
{" "}
removed declaration (DDM) profile{" "}
<b>{activity.details?.profile_name}</b> from{" "}
{getProfileMessageSuffix(
isPremiumTier,
"apple",
activity.details?.team_name
)}
.
{getProfileMessageSuffix(isPremiumTier, activity.details?.team_name)}.
</>
);
},
@ -810,11 +775,7 @@ const TAGGED_TEMPLATES = {
{" "}
edited declaration (DDM) profiles{" "}
<b>{activity.details?.profile_name}</b> for{" "}
{getProfileMessageSuffix(
isPremiumTier,
"apple",
activity.details?.team_name
)}{" "}
{getProfileMessageSuffix(isPremiumTier, activity.details?.team_name)}{" "}
via fleetctl.
</>
);