Fleet UI: Microsoft.CompanyPortal > Company Portal (#38958)
This commit is contained in:
+5
-3
@@ -22,6 +22,7 @@ import softwareAPI from "services/entities/software";
|
||||
import deviceUserAPI from "services/entities/device_user";
|
||||
|
||||
import InventoryVersions from "pages/hosts/details/components/InventoryVersions";
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
|
||||
import Modal from "components/Modal";
|
||||
import ModalFooter from "components/ModalFooter";
|
||||
@@ -374,9 +375,10 @@ export const SoftwareInstallDetailsModal = ({
|
||||
<div className={`${baseClass}__modal-content`}>
|
||||
<StatusMessage
|
||||
installResult={installResultWithHostDisplayName}
|
||||
softwareName={
|
||||
hostSoftware?.display_name || hostSoftware?.name || "Software"
|
||||
} // will always be defined at this point
|
||||
softwareName={getDisplayedSoftwareName(
|
||||
hostSoftware?.name,
|
||||
hostSoftware?.display_name
|
||||
)}
|
||||
isMyDevicePage={!!deviceAuthToken}
|
||||
contactUrl={contactUrl}
|
||||
/>
|
||||
|
||||
@@ -7,6 +7,7 @@ import CustomLink from "components/CustomLink";
|
||||
import TooltipWrapper from "components/TooltipWrapper";
|
||||
import { getPathWithQueryParams } from "utilities/url";
|
||||
import paths from "router/paths";
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
|
||||
interface IPlatformSelectorProps {
|
||||
baseClass?: string;
|
||||
@@ -47,7 +48,10 @@ export const PlatformSelector = ({
|
||||
if (!installSoftware) {
|
||||
return null;
|
||||
}
|
||||
const softwareName = installSoftware.display_name || installSoftware.name;
|
||||
const softwareName = getDisplayedSoftwareName(
|
||||
installSoftware.name,
|
||||
installSoftware.display_name
|
||||
);
|
||||
const softwareId = installSoftware.software_title_id.toString();
|
||||
const softwareLink = getPathWithQueryParams(
|
||||
paths.SOFTWARE_TITLE_DETAILS(softwareId),
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import React from "react";
|
||||
import { InjectedRouter } from "react-router";
|
||||
|
||||
import { getSelfServiceTooltip } from "pages/SoftwarePage/helpers";
|
||||
import {
|
||||
getSelfServiceTooltip,
|
||||
getDisplayedSoftwareName,
|
||||
} from "pages/SoftwarePage/helpers";
|
||||
|
||||
import TooltipWrapper from "components/TooltipWrapper";
|
||||
import Icon from "components/Icon";
|
||||
@@ -177,13 +180,14 @@ const SoftwareNameCell = ({
|
||||
isAndroidPlayStoreApp = false,
|
||||
previewIcon,
|
||||
}: ISoftwareNameCellProps) => {
|
||||
const softwareDisplayName = getDisplayedSoftwareName(name, display_name);
|
||||
const icon = previewIcon || (
|
||||
<SoftwareIcon name={name} source={source} url={iconUrl} />
|
||||
);
|
||||
// My device page > Software fake link as entire row opens a modal
|
||||
if (pageContext === "deviceUser" && !isSelfService) {
|
||||
return (
|
||||
<LinkCell tooltipTruncate prefix={icon} value={display_name || name} />
|
||||
<LinkCell tooltipTruncate prefix={icon} value={softwareDisplayName} />
|
||||
);
|
||||
}
|
||||
|
||||
@@ -193,7 +197,7 @@ const SoftwareNameCell = ({
|
||||
<div className={baseClass}>
|
||||
<TooltipTruncatedTextCell
|
||||
prefix={icon}
|
||||
value={display_name || name}
|
||||
value={softwareDisplayName}
|
||||
className="software-name"
|
||||
/>
|
||||
</div>
|
||||
@@ -213,7 +217,7 @@ const SoftwareNameCell = ({
|
||||
tooltipTruncate
|
||||
customOnClick={onClickSoftware}
|
||||
prefix={icon}
|
||||
value={display_name || name}
|
||||
value={softwareDisplayName}
|
||||
suffix={
|
||||
hasInstaller ? (
|
||||
<InstallIconWithTooltip
|
||||
|
||||
@@ -34,6 +34,7 @@ export interface IGetSoftwareByIdResponse {
|
||||
// check to see if we still need this.
|
||||
export interface ISoftware {
|
||||
id: number;
|
||||
/** All software names displayed by UI is ran through getDisplayedSoftwareName */
|
||||
name: string; // e.g., "Figma.app"
|
||||
/** Custom name set per team by admin */
|
||||
display_name?: string; // e.g. "Figma for Desktop"
|
||||
@@ -161,6 +162,7 @@ export const isSoftwarePackage = (
|
||||
|
||||
export interface ISoftwareTitle {
|
||||
id: number;
|
||||
/** All software names displayed by UI is ran through getDisplayedSoftwareName */
|
||||
name: string;
|
||||
/** Custom name set per team by admin */
|
||||
display_name?: string;
|
||||
@@ -178,6 +180,7 @@ export interface ISoftwareTitle {
|
||||
|
||||
export interface ISoftwareTitleDetails {
|
||||
id: number;
|
||||
/** All software names displayed by UI is ran through getDisplayedSoftwareName */
|
||||
name: string;
|
||||
/** Custom name set per team by admin */
|
||||
display_name?: string;
|
||||
@@ -212,6 +215,7 @@ export interface ISoftwareVulnerability {
|
||||
|
||||
export interface ISoftwareVersion {
|
||||
id: number;
|
||||
/** All software names displayed by UI is ran through getDisplayedSoftwareName */
|
||||
name: string; // e.g., "Figma.app"
|
||||
/** Custom name set per team by admin */
|
||||
display_name?: string; // e.g. "Figma for Desktop"
|
||||
@@ -545,6 +549,7 @@ export interface IHostAppStoreApp {
|
||||
|
||||
export interface IHostSoftware {
|
||||
id: number;
|
||||
/** All software names displayed by UI is ran through getDisplayedSoftwareName */
|
||||
name: string; // e.g., "mock software.app"
|
||||
/** Custom name set per team by admin */
|
||||
display_name?: string; // e.g. "Mock Software"
|
||||
|
||||
@@ -34,6 +34,7 @@ import SoftwareUninstallDetailsModal, {
|
||||
ISWUninstallDetailsParentState,
|
||||
} from "components/ActivityDetails/InstallDetails/SoftwareUninstallDetailsModal/SoftwareUninstallDetailsModal";
|
||||
import { IShowActivityDetailsData } from "components/ActivityItem/ActivityItem";
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
|
||||
import GlobalActivityItem from "./GlobalActivityItem";
|
||||
import ActivityAutomationDetailsModal from "./components/ActivityAutomationDetailsModal";
|
||||
@@ -251,8 +252,10 @@ const ActivityFeed = ({
|
||||
case ActivityType.UninstalledSoftware:
|
||||
setPackageUninstallDetails({
|
||||
...details,
|
||||
softwareName:
|
||||
details?.software_display_name || details?.software_title || "",
|
||||
softwareName: getDisplayedSoftwareName(
|
||||
details?.software_title,
|
||||
details?.software_display_name
|
||||
),
|
||||
uninstallStatus: resolveUninstallStatus(details?.status),
|
||||
scriptExecutionId: details?.script_execution_id || "",
|
||||
hostDisplayName: details?.host_display_name,
|
||||
@@ -384,10 +387,10 @@ const ActivityFeed = ({
|
||||
{ipaPackageInstallDetails && (
|
||||
<SoftwareIpaInstallDetailsModal
|
||||
details={{
|
||||
appName:
|
||||
ipaPackageInstallDetails.software_display_name ||
|
||||
ipaPackageInstallDetails.software_title ||
|
||||
"",
|
||||
appName: getDisplayedSoftwareName(
|
||||
ipaPackageInstallDetails.software_title,
|
||||
ipaPackageInstallDetails.software_display_name
|
||||
),
|
||||
fleetInstallStatus: (ipaPackageInstallDetails.status ||
|
||||
"pending_install") as SoftwareInstallUninstallStatus,
|
||||
hostDisplayName: ipaPackageInstallDetails.host_display_name || "",
|
||||
@@ -406,10 +409,10 @@ const ActivityFeed = ({
|
||||
{vppInstallDetails && (
|
||||
<VppInstallDetailsModal
|
||||
details={{
|
||||
appName:
|
||||
vppInstallDetails.software_display_name ||
|
||||
vppInstallDetails.software_title ||
|
||||
"",
|
||||
appName: getDisplayedSoftwareName(
|
||||
vppInstallDetails.software_title,
|
||||
vppInstallDetails.software_display_name
|
||||
),
|
||||
fleetInstallStatus: (vppInstallDetails.status ||
|
||||
"pending_install") as SoftwareInstallUninstallStatus,
|
||||
hostDisplayName: vppInstallDetails.host_display_name || "",
|
||||
|
||||
+6
-1
@@ -8,6 +8,8 @@ import { isAndroid } from "interfaces/platform";
|
||||
import Modal from "components/Modal";
|
||||
import Button from "components/buttons/Button";
|
||||
import DataSet from "components/DataSet";
|
||||
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
import {
|
||||
TargetTitle,
|
||||
TargetValue,
|
||||
@@ -38,7 +40,10 @@ const AppStoreDetailsModal = ({
|
||||
<div className={`${baseClass}__modal-content`}>
|
||||
<DataSet
|
||||
title="Name"
|
||||
value={details.software_display_name || details.software_title}
|
||||
value={getDisplayedSoftwareName(
|
||||
details.software_title,
|
||||
details.software_display_name
|
||||
)}
|
||||
/>
|
||||
<DataSet
|
||||
title={
|
||||
|
||||
+5
-1
@@ -2,6 +2,7 @@ import React from "react";
|
||||
|
||||
import { IActivityDetails } from "interfaces/activity";
|
||||
import { ILabelSoftwareTitle } from "interfaces/label";
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
|
||||
import Modal from "components/Modal";
|
||||
import Button from "components/buttons/Button";
|
||||
@@ -90,7 +91,10 @@ const LibrarySoftwareDetailsModal = ({
|
||||
<div className={`${baseClass}__modal-content`}>
|
||||
<DataSet
|
||||
title="Name"
|
||||
value={details.software_display_name || details.software_title}
|
||||
value={getDisplayedSoftwareName(
|
||||
details.software_title,
|
||||
details.software_display_name
|
||||
)}
|
||||
/>
|
||||
<DataSet title="Package name" value={details.software_package} />
|
||||
<DataSet
|
||||
|
||||
+7
-2
@@ -30,7 +30,10 @@ import SoftwareIcon from "pages/SoftwarePage/components/icons/SoftwareIcon";
|
||||
import TableCount from "components/TableContainer/TableCount";
|
||||
import Spinner from "components/Spinner";
|
||||
|
||||
import { isSafeImagePreviewUrl } from "pages/SoftwarePage/helpers";
|
||||
import {
|
||||
getDisplayedSoftwareName,
|
||||
isSafeImagePreviewUrl,
|
||||
} from "pages/SoftwarePage/helpers";
|
||||
import SoftwareDetailsSummary from "pages/SoftwarePage/components/cards/SoftwareDetailsSummary/SoftwareDetailsSummary";
|
||||
import { BasicSoftwareTable } from "pages/SoftwarePage/components/modals/CategoriesEndUserExperienceModal/CategoriesEndUserExperienceModal";
|
||||
import SelfServicePreview from "pages/SoftwarePage/components/cards/SelfServicePreview";
|
||||
@@ -553,6 +556,8 @@ const EditIconModal = ({
|
||||
/>
|
||||
);
|
||||
|
||||
const defaultDisplayName = getDisplayedSoftwareName(previewInfo.titleName);
|
||||
|
||||
const renderForm = () => (
|
||||
<>
|
||||
<InputField
|
||||
@@ -564,7 +569,7 @@ const EditIconModal = ({
|
||||
helpText={
|
||||
<>
|
||||
Optional. If left blank, Fleet will use{" "}
|
||||
<strong>{previewInfo.titleName}</strong>.
|
||||
<strong>{defaultDisplayName}</strong>.
|
||||
</>
|
||||
}
|
||||
autofocus
|
||||
|
||||
+10
-4
@@ -13,6 +13,7 @@ import {
|
||||
IAppStoreApp,
|
||||
} from "interfaces/software";
|
||||
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
import Card from "components/Card";
|
||||
import SoftwareDetailsSummary from "pages/SoftwarePage/components/cards/SoftwareDetailsSummary";
|
||||
import TitleVersionsTable from "./TitleVersionsTable";
|
||||
@@ -57,6 +58,11 @@ const SoftwareSummaryCard = ({
|
||||
setShowEditAutoUpdateConfigModal,
|
||||
] = useState(false);
|
||||
|
||||
const softwareDisplayName = getDisplayedSoftwareName(
|
||||
softwareTitle.name,
|
||||
softwareTitle.display_name
|
||||
);
|
||||
|
||||
// Hide versions table for tgz_packages, sh_packages, & ps1_packages and when no hosts have the
|
||||
// software installed
|
||||
const showVersionsTable =
|
||||
@@ -70,7 +76,7 @@ const SoftwareSummaryCard = ({
|
||||
<>
|
||||
<Card borderRadiusSize="xxlarge" className={baseClass}>
|
||||
<SoftwareDetailsSummary
|
||||
displayName={softwareTitle.display_name || softwareTitle.name}
|
||||
displayName={softwareDisplayName}
|
||||
type={formatSoftwareType(softwareTitle)}
|
||||
versions={softwareTitle.versions?.length ?? 0}
|
||||
hostCount={softwareTitle.hosts_count}
|
||||
@@ -128,7 +134,7 @@ const SoftwareSummaryCard = ({
|
||||
<>
|
||||
<Card borderRadiusSize="xxlarge" className={baseClass}>
|
||||
<SoftwareDetailsSummary
|
||||
displayName={softwareTitle.display_name || softwareTitle.name}
|
||||
displayName={softwareDisplayName}
|
||||
type={formatSoftwareType(softwareTitle)}
|
||||
versions={softwareTitle.versions?.length ?? 0}
|
||||
hostCount={softwareTitle.hosts_count}
|
||||
@@ -178,7 +184,7 @@ const SoftwareSummaryCard = ({
|
||||
setIconUploadedAt={setIconUploadedAt}
|
||||
installerType={installerType}
|
||||
previewInfo={{
|
||||
name: softwareTitle.display_name || softwareTitle.name,
|
||||
name: softwareDisplayName,
|
||||
titleName: softwareTitle.name,
|
||||
type: formatSoftwareType(softwareTitle),
|
||||
source: softwareTitle.source,
|
||||
@@ -201,7 +207,7 @@ const SoftwareSummaryCard = ({
|
||||
openViewYamlModal={onToggleViewYaml}
|
||||
isIosOrIpadosApp={isIosOrIpadosApp}
|
||||
name={softwareTitle.name}
|
||||
displayName={softwareTitle.display_name || softwareTitle.name}
|
||||
displayName={softwareDisplayName}
|
||||
source={softwareTitle.source}
|
||||
iconUrl={softwareTitle.icon_url}
|
||||
/>
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
SCRIPT_PACKAGE_SOURCES,
|
||||
ISoftwarePackage,
|
||||
} from "interfaces/software";
|
||||
import { getDisplayedSoftwareName } from "../helpers";
|
||||
|
||||
export interface InstallerCardInfo {
|
||||
softwareTitleName: string;
|
||||
@@ -41,7 +42,10 @@ export const getInstallerCardInfo = (
|
||||
|
||||
return {
|
||||
softwareTitleName: softwareTitle.name,
|
||||
softwareDisplayName: softwareTitle.display_name || softwareTitle.name,
|
||||
softwareDisplayName: getDisplayedSoftwareName(
|
||||
softwareTitle.name,
|
||||
softwareTitle.display_name
|
||||
),
|
||||
softwareInstaller: installerData,
|
||||
name: (isPackage && installerData.name) || softwareTitle.name,
|
||||
version:
|
||||
|
||||
+5
-3
@@ -38,6 +38,7 @@ import SoftwareDetailsSummary from "../components/cards/SoftwareDetailsSummary";
|
||||
import SoftwareVulnerabilitiesTable from "../components/tables/SoftwareVulnerabilitiesTable";
|
||||
import DetailsNoHosts from "../components/cards/DetailsNoHosts";
|
||||
import { VulnsNotSupported } from "../components/tables/SoftwareVulnerabilitiesTable/SoftwareVulnerabilitiesTable";
|
||||
import { getDisplayedSoftwareName } from "../helpers";
|
||||
|
||||
const baseClass = "software-version-details-page";
|
||||
|
||||
@@ -179,9 +180,10 @@ const SoftwareVersionDetailsPage = ({
|
||||
className={`${baseClass}__summary-section`}
|
||||
>
|
||||
<SoftwareDetailsSummary
|
||||
displayName={`${
|
||||
softwareVersion.display_name || softwareVersion.name
|
||||
}, ${softwareVersion.version}`}
|
||||
displayName={`${getDisplayedSoftwareName(
|
||||
softwareVersion.name,
|
||||
softwareVersion.display_name
|
||||
)}, ${softwareVersion.version}`}
|
||||
type={formatSoftwareType(softwareVersion)}
|
||||
hostCount={hostsCount}
|
||||
queryParams={{
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
import {
|
||||
getSelfServiceTooltip,
|
||||
getAutomaticInstallPoliciesCount,
|
||||
getDisplayedSoftwareName,
|
||||
} from "./helpers";
|
||||
|
||||
describe("getSelfServiceTooltip", () => {
|
||||
@@ -141,3 +142,38 @@ describe("getAutomaticInstallPoliciesCount", () => {
|
||||
expect(getAutomaticInstallPoliciesCount(hostSoftware)).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe("getDisplayedSoftwareName", () => {
|
||||
it("returns display_name when provided (custom name wins)", () => {
|
||||
expect(
|
||||
getDisplayedSoftwareName("Microsoft.CompanyPortal", "My Custom Portal")
|
||||
).toBe("My Custom Portal");
|
||||
});
|
||||
|
||||
it("normalizes a known raw name when display_name is not provided", () => {
|
||||
expect(getDisplayedSoftwareName("Microsoft.CompanyPortal", null)).toBe(
|
||||
"Company Portal"
|
||||
);
|
||||
});
|
||||
|
||||
it("normalizes a known raw name case-insensitively", () => {
|
||||
expect(getDisplayedSoftwareName("microsoft.companyportal", undefined)).toBe(
|
||||
"Company Portal"
|
||||
);
|
||||
});
|
||||
|
||||
it("returns the raw name when it is not in WELL_KNOWN_SOFTWARE_TITLES", () => {
|
||||
expect(getDisplayedSoftwareName("Some Other App", null)).toBe(
|
||||
"Some Other App"
|
||||
);
|
||||
});
|
||||
|
||||
it("returns the raw name when display_name is empty", () => {
|
||||
expect(getDisplayedSoftwareName("Some App", "")).toBe("Some App");
|
||||
});
|
||||
|
||||
it("returns a default when neither name nor display_name is provided", () => {
|
||||
expect(getDisplayedSoftwareName(undefined, undefined)).toBe("Software");
|
||||
expect(getDisplayedSoftwareName(null, null)).toBe("Software");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -258,3 +258,34 @@ export const isSafeImagePreviewUrl = (url?: string | null) => {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: When software directories are restructured, move this to /software/helpers.tsx
|
||||
// TODO: Naming conversion should be server-side in future iteration to be compatible with server-side sort
|
||||
/** Map of known awkward software titles to more human-readable names */
|
||||
const WELL_KNOWN_SOFTWARE_TITLES: Record<string, string> = {
|
||||
"microsoft.companyportal": "Company Portal",
|
||||
};
|
||||
|
||||
/** Prioritizes display_name over name and converts awkward software titles
|
||||
* listed in WELL_KNOWN_SOFTWARE_TITLES to more human readable names */
|
||||
export const getDisplayedSoftwareName = (
|
||||
name?: string | null,
|
||||
display_name?: string | null
|
||||
): string => {
|
||||
// 1. End-user custom name always wins.
|
||||
if (display_name) {
|
||||
return display_name;
|
||||
}
|
||||
|
||||
if (name) {
|
||||
// 2. Normalize known titles only from the raw name.
|
||||
const key = name.toLowerCase();
|
||||
if (WELL_KNOWN_SOFTWARE_TITLES[key]) {
|
||||
return WELL_KNOWN_SOFTWARE_TITLES[key];
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
// This should not happen
|
||||
return "Software";
|
||||
};
|
||||
|
||||
@@ -94,6 +94,7 @@ import SoftwareUninstallDetailsModal, {
|
||||
ISWUninstallDetailsParentState,
|
||||
} from "components/ActivityDetails/InstallDetails/SoftwareUninstallDetailsModal/SoftwareUninstallDetailsModal";
|
||||
import { IShowActivityDetailsData } from "components/ActivityItem/ActivityItem";
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
|
||||
import CommandResultsModal from "pages/hosts/components/CommandDetailsModal";
|
||||
|
||||
@@ -791,7 +792,10 @@ const HostDetailsPage = ({
|
||||
fleetInstallStatus: details?.status as SoftwareInstallUninstallStatus,
|
||||
hostDisplayName:
|
||||
host?.display_name || details?.host_display_name || "",
|
||||
appName: details.software_display_name || details?.name || "", // TODO: Confirm correct field
|
||||
appName: getDisplayedSoftwareName(
|
||||
details.software_title,
|
||||
details.software_display_name
|
||||
),
|
||||
commandUuid: details?.command_uuid,
|
||||
});
|
||||
} else if (SCRIPT_PACKAGE_SOURCES.includes(details?.source || "")) {
|
||||
@@ -817,8 +821,10 @@ const HostDetailsPage = ({
|
||||
case "uninstalled_software":
|
||||
setPackageUninstallDetails({
|
||||
...details,
|
||||
softwareName:
|
||||
details?.software_display_name || details?.software_title || "",
|
||||
softwareName: getDisplayedSoftwareName(
|
||||
details?.software_title,
|
||||
details?.software_display_name
|
||||
),
|
||||
uninstallStatus: resolveUninstallStatus(details?.status),
|
||||
scriptExecutionId: details?.script_execution_id || "",
|
||||
hostDisplayName: host?.display_name || details?.host_display_name,
|
||||
@@ -826,8 +832,10 @@ const HostDetailsPage = ({
|
||||
break;
|
||||
case "installed_app_store_app":
|
||||
setActivityVPPInstallDetails({
|
||||
appName:
|
||||
details?.software_display_name || details?.software_title || "",
|
||||
appName: getDisplayedSoftwareName(
|
||||
details?.software_title,
|
||||
details?.software_display_name
|
||||
),
|
||||
fleetInstallStatus: (details?.status ||
|
||||
"pending_install") as SoftwareInstallUninstallStatus,
|
||||
commandUuid: details?.command_uuid || "",
|
||||
|
||||
+5
-2
@@ -1,6 +1,7 @@
|
||||
import React from "react";
|
||||
|
||||
import ActivityItem from "components/ActivityItem";
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
import { IHostActivityItemComponentProps } from "../../ActivityConfig";
|
||||
|
||||
const baseClass = "canceled-install-software-activity-item";
|
||||
@@ -18,8 +19,10 @@ const CanceledInstallSoftwareActivityItem = ({
|
||||
<>
|
||||
<b>{activity.actor_full_name}</b> canceled{" "}
|
||||
<b>
|
||||
{activity.details.software_display_name ||
|
||||
activity.details.software_title}
|
||||
{getDisplayedSoftwareName(
|
||||
activity.details.software_title,
|
||||
activity.details.software_display_name
|
||||
)}
|
||||
</b>{" "}
|
||||
install on this host.
|
||||
</>
|
||||
|
||||
+5
-2
@@ -1,6 +1,7 @@
|
||||
import React from "react";
|
||||
|
||||
import ActivityItem from "components/ActivityItem";
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
|
||||
import { IHostActivityItemComponentProps } from "../../ActivityConfig";
|
||||
|
||||
@@ -19,8 +20,10 @@ const CanceledUninstallSoftwareActivtyItem = ({
|
||||
<>
|
||||
<b>{activity.actor_full_name}</b> canceled{" "}
|
||||
<b>
|
||||
{activity.details.software_display_name ||
|
||||
activity.details.software_title}
|
||||
{getDisplayedSoftwareName(
|
||||
activity.details.software_title,
|
||||
activity.details.software_display_name
|
||||
)}
|
||||
</b>{" "}
|
||||
uninstall on this host.
|
||||
</>
|
||||
|
||||
@@ -40,6 +40,7 @@ import VppInstallDetailsModal from "components/ActivityDetails/InstallDetails/Vp
|
||||
import SoftwareUninstallDetailsModal, {
|
||||
ISWUninstallDetailsParentState,
|
||||
} from "components/ActivityDetails/InstallDetails/SoftwareUninstallDetailsModal/SoftwareUninstallDetailsModal";
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
|
||||
import { generateHostSWLibraryTableHeaders } from "./HostSoftwareLibraryTable/HostSoftwareLibraryTableConfig";
|
||||
import HostSoftwareLibraryTable from "./HostSoftwareLibraryTable";
|
||||
@@ -626,9 +627,10 @@ const HostSoftwareLibrary = ({
|
||||
details={{
|
||||
hostDisplayName,
|
||||
fleetInstallStatus: selectedHostSWIpaInstallDetails.status,
|
||||
appName:
|
||||
selectedHostSWIpaInstallDetails.display_name ||
|
||||
appName: getDisplayedSoftwareName(
|
||||
selectedHostSWIpaInstallDetails.name,
|
||||
selectedHostSWIpaInstallDetails.display_name
|
||||
),
|
||||
commandUuid:
|
||||
selectedHostSWIpaInstallDetails.software_package?.last_install
|
||||
?.install_uuid, // slightly redundant, see explanation in `SoftwareInstallDetailsModal
|
||||
@@ -661,9 +663,10 @@ const HostSoftwareLibrary = ({
|
||||
details={{
|
||||
fleetInstallStatus: selectedVPPInstallDetails.status,
|
||||
hostDisplayName,
|
||||
appName:
|
||||
selectedVPPInstallDetails.display_name ||
|
||||
appName: getDisplayedSoftwareName(
|
||||
selectedVPPInstallDetails.name,
|
||||
selectedVPPInstallDetails.display_name
|
||||
),
|
||||
commandUuid: selectedVPPInstallDetails.commandUuid,
|
||||
platform,
|
||||
}}
|
||||
|
||||
@@ -20,6 +20,7 @@ import Spinner from "components/Spinner";
|
||||
import TooltipWrapper from "components/TooltipWrapper";
|
||||
import Button from "components/buttons/Button";
|
||||
import { ISWUninstallDetailsParentState } from "components/ActivityDetails/InstallDetails/SoftwareUninstallDetailsModal/SoftwareUninstallDetailsModal";
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
import {
|
||||
getLastInstall,
|
||||
getLastUninstall,
|
||||
@@ -473,7 +474,10 @@ const InstallStatusCell = ({
|
||||
if (lastUninstall) {
|
||||
if ("script_execution_id" in lastUninstall) {
|
||||
onShowUninstallDetails({
|
||||
softwareName: software.display_name || software.name || "",
|
||||
softwareName: getDisplayedSoftwareName(
|
||||
software.name,
|
||||
software.display_name
|
||||
),
|
||||
softwarePackageName,
|
||||
uninstallStatus: (software.status ||
|
||||
"pending_uninstall") as SoftwareUninstallStatus,
|
||||
|
||||
@@ -34,6 +34,7 @@ import SoftwareInstallDetailsModal from "components/ActivityDetails/InstallDetai
|
||||
import SoftwareIpaInstallDetailsModal from "components/ActivityDetails/InstallDetails/SoftwareIpaInstallDetailsModal";
|
||||
import SoftwareScriptDetailsModal from "components/ActivityDetails/InstallDetails/SoftwareScriptDetailsModal";
|
||||
import { VppInstallDetailsModal } from "components/ActivityDetails/InstallDetails/VppInstallDetailsModal/VppInstallDetailsModal";
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
|
||||
import UpdatesCard from "./components/UpdatesCard/UpdatesCard";
|
||||
import SelfServiceCard from "./SelfServiceCard/SelfServiceCard";
|
||||
@@ -743,9 +744,10 @@ const SoftwareSelfService = ({
|
||||
details={{
|
||||
hostDisplayName,
|
||||
fleetInstallStatus: selectedHostSWIpaInstallDetails.status,
|
||||
appName:
|
||||
selectedHostSWIpaInstallDetails.display_name ||
|
||||
appName: getDisplayedSoftwareName(
|
||||
selectedHostSWIpaInstallDetails.name,
|
||||
selectedHostSWIpaInstallDetails.display_name
|
||||
),
|
||||
commandUuid:
|
||||
selectedHostSWIpaInstallDetails.software_package?.last_install
|
||||
?.install_uuid, // slightly redundant, see explanation in `SoftwareInstallDetailsModal
|
||||
@@ -776,9 +778,10 @@ const SoftwareSelfService = ({
|
||||
details={{
|
||||
fleetInstallStatus: selectedVPPInstallDetails.status,
|
||||
hostDisplayName,
|
||||
appName:
|
||||
selectedVPPInstallDetails.display_name ||
|
||||
appName: getDisplayedSoftwareName(
|
||||
selectedVPPInstallDetails.name,
|
||||
selectedVPPInstallDetails.display_name
|
||||
),
|
||||
commandUuid: selectedVPPInstallDetails.commandUuid,
|
||||
}}
|
||||
hostSoftware={selectedVPPInstallDetails}
|
||||
|
||||
+5
-1
@@ -9,6 +9,7 @@ import CustomLink from "components/CustomLink";
|
||||
import SoftwareIcon from "pages/SoftwarePage/components/icons/SoftwareIcon";
|
||||
import TooltipTruncatedText from "components/TooltipTruncatedText";
|
||||
import Spinner from "components/Spinner";
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
import TileActionStatus from "../TileActionStatus";
|
||||
|
||||
const baseClass = "self-service-tiles-list";
|
||||
@@ -69,7 +70,10 @@ const SelfServiceTiles = ({
|
||||
<div className={`${tileBaseClass}__item-name`}>
|
||||
<TooltipTruncatedText
|
||||
isMobileView
|
||||
value={software.display_name || software.name}
|
||||
value={getDisplayedSoftwareName(
|
||||
software.name,
|
||||
software.display_name
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className={`${tileBaseClass}__item-version`}>
|
||||
|
||||
+3
-1
@@ -9,6 +9,7 @@ import Modal from "components/Modal";
|
||||
import IconStatusMessage from "components/IconStatusMessage";
|
||||
import ModalFooter from "components/ModalFooter";
|
||||
import InventoryVersions from "pages/hosts/details/components/InventoryVersions";
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
|
||||
const baseClass = "software-update-modal";
|
||||
|
||||
@@ -96,6 +97,7 @@ const SoftwareUpdateModal = ({
|
||||
} = software;
|
||||
const installerName = software_package?.name || "";
|
||||
const installerVersion = software_package?.version || app_store_app?.version;
|
||||
const softwareDisplayName = getDisplayedSoftwareName(name, display_name);
|
||||
|
||||
const onClickUpdate = () => {
|
||||
onUpdate(id);
|
||||
@@ -115,7 +117,7 @@ const SoftwareUpdateModal = ({
|
||||
hostDisplayName={hostDisplayName}
|
||||
isDeviceUser={isDeviceUser}
|
||||
softwareStatus={status}
|
||||
softwareName={display_name || name}
|
||||
softwareName={softwareDisplayName}
|
||||
installerName={installerName}
|
||||
installerVersion={installerVersion}
|
||||
/>
|
||||
|
||||
+5
-1
@@ -19,6 +19,7 @@ import SoftwareIcon from "pages/SoftwarePage/components/icons/SoftwareIcon";
|
||||
import TooltipTruncatedText from "components/TooltipTruncatedText";
|
||||
import Spinner from "components/Spinner";
|
||||
import TooltipWrapper from "components/TooltipWrapper";
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
|
||||
import { HostInstallerActionButton } from "../../../../../HostSoftwareLibrary/HostInstallerActionCell/HostInstallerActionCell";
|
||||
import {
|
||||
@@ -75,7 +76,10 @@ const InstallerInfo = ({ software }: IInstallerInfoProps) => {
|
||||
<div className={`${baseClass}__item-name-version`}>
|
||||
<div className={`${baseClass}__item-name`}>
|
||||
<TooltipTruncatedText
|
||||
value={display_name || name || installerPackage?.name}
|
||||
value={
|
||||
getDisplayedSoftwareName(name, display_name) ||
|
||||
installerPackage?.name
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div className={`${baseClass}__item-version`}>
|
||||
|
||||
+9
-3
@@ -14,6 +14,7 @@ import { IPaginatedListHandle } from "components/PaginatedList";
|
||||
import { DEFAULT_USE_QUERY_OPTIONS } from "utilities/constants";
|
||||
import { getPathWithQueryParams } from "utilities/url";
|
||||
import { getExtensionFromFileName } from "utilities/file/fileUtils";
|
||||
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
|
||||
|
||||
// @ts-ignore
|
||||
import Dropdown from "components/forms/fields/Dropdown";
|
||||
@@ -181,7 +182,9 @@ const InstallSoftwareModal = ({
|
||||
const foundTitle = titlesAvailableForInstall?.find(
|
||||
(title) => title.id === value
|
||||
);
|
||||
return foundTitle ? foundTitle.display_name || foundTitle.name : "";
|
||||
return foundTitle
|
||||
? getDisplayedSoftwareName(foundTitle.name, foundTitle.display_name)
|
||||
: "";
|
||||
};
|
||||
|
||||
return {
|
||||
@@ -202,7 +205,7 @@ const InstallSoftwareModal = ({
|
||||
)
|
||||
.map((title) => {
|
||||
return {
|
||||
label: title.display_name || title.name,
|
||||
label: getDisplayedSoftwareName(title.name, title.display_name),
|
||||
value: title.id,
|
||||
helpText: generateSoftwareOptionHelpText(title),
|
||||
};
|
||||
@@ -236,7 +239,10 @@ const InstallSoftwareModal = ({
|
||||
if (currentSoftware) {
|
||||
options = [
|
||||
{
|
||||
label: currentSoftware.display_name || currentSoftware.name,
|
||||
label: getDisplayedSoftwareName(
|
||||
currentSoftware.name,
|
||||
currentSoftware.display_name
|
||||
),
|
||||
value: currentSoftware.id,
|
||||
helpText: generateSoftwareOptionHelpText(currentSoftware),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user