mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Bugfix: fix many small bugs in activity actor and activity formatting (#26779)
This commit is contained in:
parent
452650c03a
commit
96fc994558
3 changed files with 16 additions and 4 deletions
|
|
@ -1352,7 +1352,9 @@ const GlobalActivityItem = ({
|
|||
const hasDetails = ACTIVITIES_WITH_DETAILS.has(activity.type);
|
||||
|
||||
const renderActivityPrefix = () => {
|
||||
const DEFAULT_ACTOR_DISPLAY = <b>{activity.actor_full_name ?? "Fleet"} </b>;
|
||||
const DEFAULT_ACTOR_DISPLAY = (
|
||||
<b>{activity.fleet_initiated ? "Fleet" : activity.actor_full_name} </b>
|
||||
);
|
||||
|
||||
switch (activity.type) {
|
||||
case ActivityType.UserLoggedIn:
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import { IHostActivityItemComponentPropsWithShowDetails } from "../../ActivityCo
|
|||
const baseClass = "installed-software-activity-item";
|
||||
|
||||
const InstalledSoftwareActivityItem = ({
|
||||
tab,
|
||||
activity,
|
||||
onShowDetails,
|
||||
hideCancel,
|
||||
|
|
@ -24,6 +25,12 @@ const InstalledSoftwareActivityItem = ({
|
|||
<b>{actorName ?? "Fleet"}</b>
|
||||
);
|
||||
|
||||
let installedSoftwarePrefix = getInstallStatusPredicate(status);
|
||||
if (tab !== "past" && activity.fleet_initiated) {
|
||||
installedSoftwarePrefix =
|
||||
status === "pending_uninstall" ? "will uninstall" : "will install";
|
||||
}
|
||||
|
||||
return (
|
||||
<ActivityItem
|
||||
className={baseClass}
|
||||
|
|
@ -31,8 +38,8 @@ const InstalledSoftwareActivityItem = ({
|
|||
hideCancel={hideCancel}
|
||||
onShowDetails={onShowDetails}
|
||||
>
|
||||
<>{actorDisplayName}</> {getInstallStatusPredicate(status)} <b>{title}</b>{" "}
|
||||
on this host {self_service && "(self-service)"}.{" "}
|
||||
<>{actorDisplayName}</> {installedSoftwarePrefix} <b>{title}</b> on this
|
||||
host{self_service && " (self-service)"}.{" "}
|
||||
</ActivityItem>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -15,7 +15,10 @@ const RanScriptActivityItem = ({
|
|||
isSoloActivity,
|
||||
hideCancel,
|
||||
}: IHostActivityItemComponentPropsWithShowDetails) => {
|
||||
const ranScriptPrefix = tab === "past" ? "ran" : "told Fleet to run";
|
||||
let ranScriptPrefix = tab === "past" ? "ran" : "told Fleet to run";
|
||||
if (tab !== "past" && activity.fleet_initiated) {
|
||||
ranScriptPrefix = "will run";
|
||||
}
|
||||
|
||||
return (
|
||||
<ActivityItem
|
||||
|
|
|
|||
Loading…
Reference in a new issue