2024-05-09 21:44:50 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import { InjectedRouter } from "react-router";
|
2025-05-13 17:41:44 +00:00
|
|
|
|
2026-01-30 01:59:27 +00:00
|
|
|
import {
|
|
|
|
|
getSelfServiceTooltip,
|
|
|
|
|
getDisplayedSoftwareName,
|
|
|
|
|
} from "pages/SoftwarePage/helpers";
|
2025-02-27 20:09:05 +00:00
|
|
|
|
2025-06-23 15:09:20 +00:00
|
|
|
import TooltipWrapper from "components/TooltipWrapper";
|
Update UI for software self-service features (#19244)
Issues https://github.com/fleetdm/fleet/issues/17587,
https://github.com/fleetdm/fleet/issues/18836,
https://github.com/fleetdm/fleet/issues/18837,
https://github.com/fleetdm/fleet/pull/18339, and
https://github.com/fleetdm/fleet/pull/18340
# TODOS
- Integrate backend
- Unit/integration tests
- Various todos noted in comments
- Cleanup styles and organization of components (de-duplicating and
consolidating where possible)
- Activity feed updates (if any)
# Checklist for submitter
If some of the following don't apply, delete the relevant line.
<!-- Note that API documentation changes are now addressed by the
product design team. -->
- [ ] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.
- [ ] Added/updated tests
- [ ] If database migrations are included, checked table schema to
confirm autoupdate
- For database migrations:
- [ ] Checked schema for all modified table for columns that will
auto-update timestamps during migration.
- [ ] Confirmed that updating the timestamps is acceptable, and will not
cause unwanted side effects.
- [ ] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).
- [ ] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
---------
Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2024-05-31 10:09:53 +00:00
|
|
|
import Icon from "components/Icon";
|
2024-11-20 11:41:40 +00:00
|
|
|
import { IconNames } from "components/icons";
|
2024-05-09 21:44:50 +00:00
|
|
|
import SoftwareIcon from "pages/SoftwarePage/components/icons/SoftwareIcon";
|
|
|
|
|
import LinkCell from "../LinkCell";
|
2025-08-06 19:32:52 +00:00
|
|
|
import TooltipTruncatedTextCell from "../TooltipTruncatedTextCell";
|
2024-05-09 21:44:50 +00:00
|
|
|
|
|
|
|
|
const baseClass = "software-name-cell";
|
|
|
|
|
|
2024-11-20 11:41:40 +00:00
|
|
|
type InstallType =
|
|
|
|
|
| "manual"
|
|
|
|
|
| "selfService"
|
|
|
|
|
| "automatic"
|
|
|
|
|
| "automaticSelfService";
|
|
|
|
|
|
2025-06-23 15:09:20 +00:00
|
|
|
export type PageContext = "deviceUser" | "hostDetails" | "hostDetailsLibrary";
|
|
|
|
|
|
|
|
|
|
interface InstallIconTooltip {
|
|
|
|
|
automaticInstallPoliciesCount?: number;
|
|
|
|
|
pageContext?: PageContext;
|
2025-11-14 18:24:41 +00:00
|
|
|
isIosOrIpadosApp?: boolean;
|
|
|
|
|
isAndroidPlayStoreApp?: boolean;
|
2025-06-23 15:09:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface InstallIconConfig {
|
2024-11-20 11:41:40 +00:00
|
|
|
iconName: IconNames;
|
2025-06-23 15:09:20 +00:00
|
|
|
tooltip: ({
|
|
|
|
|
automaticInstallPoliciesCount,
|
|
|
|
|
pageContext,
|
2025-11-14 18:24:41 +00:00
|
|
|
isIosOrIpadosApp,
|
|
|
|
|
isAndroidPlayStoreApp,
|
2025-06-23 15:09:20 +00:00
|
|
|
}: InstallIconTooltip) => JSX.Element;
|
2024-11-20 11:41:40 +00:00
|
|
|
}
|
|
|
|
|
|
2025-06-23 15:09:20 +00:00
|
|
|
const getPolicyTooltip = (count = 0) =>
|
|
|
|
|
count === 1
|
|
|
|
|
? "A policy triggers install."
|
|
|
|
|
: `${count} policies trigger install.`;
|
|
|
|
|
|
|
|
|
|
const installIconMap: Record<InstallType, InstallIconConfig> = {
|
2024-11-20 11:41:40 +00:00
|
|
|
manual: {
|
|
|
|
|
iconName: "install",
|
2025-06-23 15:09:20 +00:00
|
|
|
tooltip: ({ pageContext }) => (
|
|
|
|
|
<>
|
|
|
|
|
Software can be installed on the{" "}
|
|
|
|
|
{pageContext === "hostDetails" ? "Library tab" : "Host details page"}.
|
|
|
|
|
</>
|
|
|
|
|
),
|
2024-11-20 11:41:40 +00:00
|
|
|
},
|
|
|
|
|
selfService: {
|
|
|
|
|
iconName: "user",
|
2025-11-14 18:24:41 +00:00
|
|
|
tooltip: ({ isIosOrIpadosApp = false, isAndroidPlayStoreApp = false }) =>
|
|
|
|
|
getSelfServiceTooltip(isIosOrIpadosApp, isAndroidPlayStoreApp),
|
2024-11-20 11:41:40 +00:00
|
|
|
},
|
|
|
|
|
automatic: {
|
|
|
|
|
iconName: "refresh",
|
2025-06-23 15:09:20 +00:00
|
|
|
tooltip: ({ automaticInstallPoliciesCount = 0 }) => (
|
|
|
|
|
<>{getPolicyTooltip(automaticInstallPoliciesCount)}</>
|
2025-05-02 15:01:26 +00:00
|
|
|
),
|
2024-11-20 11:41:40 +00:00
|
|
|
},
|
|
|
|
|
automaticSelfService: {
|
|
|
|
|
iconName: "automatic-self-service",
|
2025-11-14 18:24:41 +00:00
|
|
|
tooltip: ({
|
|
|
|
|
automaticInstallPoliciesCount = 0,
|
|
|
|
|
isIosOrIpadosApp = false,
|
|
|
|
|
isAndroidPlayStoreApp = false,
|
|
|
|
|
}) => (
|
2024-11-20 11:41:40 +00:00
|
|
|
<>
|
2025-06-23 15:09:20 +00:00
|
|
|
{getPolicyTooltip(automaticInstallPoliciesCount)}
|
|
|
|
|
<br />
|
2025-11-14 18:24:41 +00:00
|
|
|
{getSelfServiceTooltip(isIosOrIpadosApp, isAndroidPlayStoreApp)}
|
2024-11-20 11:41:40 +00:00
|
|
|
</>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
interface IInstallIconWithTooltipProps {
|
|
|
|
|
isSelfService: boolean;
|
2025-05-02 15:01:26 +00:00
|
|
|
automaticInstallPoliciesCount?: number;
|
2025-06-23 15:09:20 +00:00
|
|
|
pageContext?: PageContext;
|
2025-11-14 18:24:41 +00:00
|
|
|
isIosOrIpadosApp: boolean;
|
|
|
|
|
isAndroidPlayStoreApp: boolean;
|
2024-11-20 11:41:40 +00:00
|
|
|
}
|
|
|
|
|
|
2025-06-23 15:09:20 +00:00
|
|
|
const getInstallIconType = (
|
|
|
|
|
isSelfService: boolean,
|
|
|
|
|
automaticInstallPoliciesCount = 0
|
|
|
|
|
): InstallType => {
|
|
|
|
|
if (automaticInstallPoliciesCount > 0) {
|
|
|
|
|
return isSelfService ? "automaticSelfService" : "automatic";
|
|
|
|
|
}
|
|
|
|
|
return isSelfService ? "selfService" : "manual";
|
|
|
|
|
};
|
|
|
|
|
|
Update UI for software self-service features (#19244)
Issues https://github.com/fleetdm/fleet/issues/17587,
https://github.com/fleetdm/fleet/issues/18836,
https://github.com/fleetdm/fleet/issues/18837,
https://github.com/fleetdm/fleet/pull/18339, and
https://github.com/fleetdm/fleet/pull/18340
# TODOS
- Integrate backend
- Unit/integration tests
- Various todos noted in comments
- Cleanup styles and organization of components (de-duplicating and
consolidating where possible)
- Activity feed updates (if any)
# Checklist for submitter
If some of the following don't apply, delete the relevant line.
<!-- Note that API documentation changes are now addressed by the
product design team. -->
- [ ] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.
- [ ] Added/updated tests
- [ ] If database migrations are included, checked table schema to
confirm autoupdate
- For database migrations:
- [ ] Checked schema for all modified table for columns that will
auto-update timestamps during migration.
- [ ] Confirmed that updating the timestamps is acceptable, and will not
cause unwanted side effects.
- [ ] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).
- [ ] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
---------
Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2024-05-31 10:09:53 +00:00
|
|
|
const InstallIconWithTooltip = ({
|
|
|
|
|
isSelfService,
|
2025-05-02 15:01:26 +00:00
|
|
|
automaticInstallPoliciesCount,
|
2025-06-23 15:09:20 +00:00
|
|
|
pageContext,
|
2025-11-14 18:24:41 +00:00
|
|
|
isIosOrIpadosApp,
|
|
|
|
|
isAndroidPlayStoreApp,
|
2024-11-20 11:41:40 +00:00
|
|
|
}: IInstallIconWithTooltipProps) => {
|
2025-06-23 15:09:20 +00:00
|
|
|
const iconType = getInstallIconType(
|
|
|
|
|
isSelfService,
|
|
|
|
|
automaticInstallPoliciesCount
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Don't show installer icon on host software library page
|
|
|
|
|
if (iconType === "manual" && pageContext === "hostDetailsLibrary") {
|
|
|
|
|
return null;
|
2024-11-20 11:41:40 +00:00
|
|
|
}
|
|
|
|
|
|
2025-06-23 15:09:20 +00:00
|
|
|
const { iconName, tooltip } = installIconMap[iconType];
|
|
|
|
|
const tipContent = tooltip({
|
|
|
|
|
automaticInstallPoliciesCount,
|
|
|
|
|
pageContext,
|
2025-11-14 18:24:41 +00:00
|
|
|
isIosOrIpadosApp,
|
|
|
|
|
isAndroidPlayStoreApp,
|
2025-06-23 15:09:20 +00:00
|
|
|
});
|
2025-05-13 17:41:44 +00:00
|
|
|
|
2024-05-15 19:32:20 +00:00
|
|
|
return (
|
|
|
|
|
<div className={`${baseClass}__install-icon-with-tooltip`}>
|
2025-06-23 15:09:20 +00:00
|
|
|
<TooltipWrapper
|
|
|
|
|
tipContent={tipContent}
|
|
|
|
|
showArrow
|
|
|
|
|
underline={false}
|
|
|
|
|
position="top"
|
|
|
|
|
tipOffset={12}
|
2024-05-15 19:32:20 +00:00
|
|
|
>
|
Update UI for software self-service features (#19244)
Issues https://github.com/fleetdm/fleet/issues/17587,
https://github.com/fleetdm/fleet/issues/18836,
https://github.com/fleetdm/fleet/issues/18837,
https://github.com/fleetdm/fleet/pull/18339, and
https://github.com/fleetdm/fleet/pull/18340
# TODOS
- Integrate backend
- Unit/integration tests
- Various todos noted in comments
- Cleanup styles and organization of components (de-duplicating and
consolidating where possible)
- Activity feed updates (if any)
# Checklist for submitter
If some of the following don't apply, delete the relevant line.
<!-- Note that API documentation changes are now addressed by the
product design team. -->
- [ ] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.
- [ ] Added/updated tests
- [ ] If database migrations are included, checked table schema to
confirm autoupdate
- For database migrations:
- [ ] Checked schema for all modified table for columns that will
auto-update timestamps during migration.
- [ ] Confirmed that updating the timestamps is acceptable, and will not
cause unwanted side effects.
- [ ] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).
- [ ] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
---------
Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2024-05-31 10:09:53 +00:00
|
|
|
<Icon
|
2025-06-23 15:09:20 +00:00
|
|
|
name={iconName}
|
Update UI for software self-service features (#19244)
Issues https://github.com/fleetdm/fleet/issues/17587,
https://github.com/fleetdm/fleet/issues/18836,
https://github.com/fleetdm/fleet/issues/18837,
https://github.com/fleetdm/fleet/pull/18339, and
https://github.com/fleetdm/fleet/pull/18340
# TODOS
- Integrate backend
- Unit/integration tests
- Various todos noted in comments
- Cleanup styles and organization of components (de-duplicating and
consolidating where possible)
- Activity feed updates (if any)
# Checklist for submitter
If some of the following don't apply, delete the relevant line.
<!-- Note that API documentation changes are now addressed by the
product design team. -->
- [ ] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.
- [ ] Added/updated tests
- [ ] If database migrations are included, checked table schema to
confirm autoupdate
- For database migrations:
- [ ] Checked schema for all modified table for columns that will
auto-update timestamps during migration.
- [ ] Confirmed that updating the timestamps is acceptable, and will not
cause unwanted side effects.
- [ ] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).
- [ ] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
---------
Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2024-05-31 10:09:53 +00:00
|
|
|
className={`${baseClass}__install-icon`}
|
2024-11-20 11:41:40 +00:00
|
|
|
color="ui-fleet-black-50"
|
Update UI for software self-service features (#19244)
Issues https://github.com/fleetdm/fleet/issues/17587,
https://github.com/fleetdm/fleet/issues/18836,
https://github.com/fleetdm/fleet/issues/18837,
https://github.com/fleetdm/fleet/pull/18339, and
https://github.com/fleetdm/fleet/pull/18340
# TODOS
- Integrate backend
- Unit/integration tests
- Various todos noted in comments
- Cleanup styles and organization of components (de-duplicating and
consolidating where possible)
- Activity feed updates (if any)
# Checklist for submitter
If some of the following don't apply, delete the relevant line.
<!-- Note that API documentation changes are now addressed by the
product design team. -->
- [ ] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.
- [ ] Added/updated tests
- [ ] If database migrations are included, checked table schema to
confirm autoupdate
- For database migrations:
- [ ] Checked schema for all modified table for columns that will
auto-update timestamps during migration.
- [ ] Confirmed that updating the timestamps is acceptable, and will not
cause unwanted side effects.
- [ ] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).
- [ ] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
---------
Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2024-05-31 10:09:53 +00:00
|
|
|
/>
|
2025-06-23 15:09:20 +00:00
|
|
|
</TooltipWrapper>
|
2024-05-15 19:32:20 +00:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2024-05-09 21:44:50 +00:00
|
|
|
interface ISoftwareNameCellProps {
|
2025-11-07 14:59:30 +00:00
|
|
|
/** Used to key default software icon and name displayed if no display_name */
|
2025-04-10 19:42:10 +00:00
|
|
|
name: string;
|
2025-11-07 14:59:30 +00:00
|
|
|
/** Overrides name for display */
|
|
|
|
|
display_name?: string;
|
2024-09-20 14:47:01 +00:00
|
|
|
source?: string;
|
|
|
|
|
/** pass in a `path` that this cell will link to */
|
2024-05-09 21:44:50 +00:00
|
|
|
path?: string;
|
|
|
|
|
router?: InjectedRouter;
|
2025-06-23 15:09:20 +00:00
|
|
|
pageContext?: PageContext;
|
|
|
|
|
hasInstaller?: boolean;
|
Update UI for software self-service features (#19244)
Issues https://github.com/fleetdm/fleet/issues/17587,
https://github.com/fleetdm/fleet/issues/18836,
https://github.com/fleetdm/fleet/issues/18837,
https://github.com/fleetdm/fleet/pull/18339, and
https://github.com/fleetdm/fleet/pull/18340
# TODOS
- Integrate backend
- Unit/integration tests
- Various todos noted in comments
- Cleanup styles and organization of components (de-duplicating and
consolidating where possible)
- Activity feed updates (if any)
# Checklist for submitter
If some of the following don't apply, delete the relevant line.
<!-- Note that API documentation changes are now addressed by the
product design team. -->
- [ ] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.
- [ ] Added/updated tests
- [ ] If database migrations are included, checked table schema to
confirm autoupdate
- For database migrations:
- [ ] Checked schema for all modified table for columns that will
auto-update timestamps during migration.
- [ ] Confirmed that updating the timestamps is acceptable, and will not
cause unwanted side effects.
- [ ] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).
- [ ] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
---------
Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2024-05-31 10:09:53 +00:00
|
|
|
isSelfService?: boolean;
|
2025-06-23 15:09:20 +00:00
|
|
|
automaticInstallPoliciesCount?: number;
|
2025-09-05 22:31:03 +00:00
|
|
|
/** e.g. custom icons & app_store_app's override default icons with URLs */
|
|
|
|
|
iconUrl?: string | null;
|
2025-11-14 18:24:41 +00:00
|
|
|
isIosOrIpadosApp?: boolean;
|
|
|
|
|
isAndroidPlayStoreApp?: boolean;
|
2026-01-13 20:53:21 +00:00
|
|
|
/** Only used on Edit icon modal to render a preview of the chosen unsaved icon */
|
|
|
|
|
previewIcon?: JSX.Element;
|
2024-05-09 21:44:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const SoftwareNameCell = ({
|
|
|
|
|
name,
|
2025-11-07 14:59:30 +00:00
|
|
|
display_name,
|
2024-05-09 21:44:50 +00:00
|
|
|
source,
|
|
|
|
|
path,
|
|
|
|
|
router,
|
2025-06-23 15:09:20 +00:00
|
|
|
pageContext,
|
|
|
|
|
hasInstaller = false,
|
Update UI for software self-service features (#19244)
Issues https://github.com/fleetdm/fleet/issues/17587,
https://github.com/fleetdm/fleet/issues/18836,
https://github.com/fleetdm/fleet/issues/18837,
https://github.com/fleetdm/fleet/pull/18339, and
https://github.com/fleetdm/fleet/pull/18340
# TODOS
- Integrate backend
- Unit/integration tests
- Various todos noted in comments
- Cleanup styles and organization of components (de-duplicating and
consolidating where possible)
- Activity feed updates (if any)
# Checklist for submitter
If some of the following don't apply, delete the relevant line.
<!-- Note that API documentation changes are now addressed by the
product design team. -->
- [ ] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.
- [ ] Added/updated tests
- [ ] If database migrations are included, checked table schema to
confirm autoupdate
- For database migrations:
- [ ] Checked schema for all modified table for columns that will
auto-update timestamps during migration.
- [ ] Confirmed that updating the timestamps is acceptable, and will not
cause unwanted side effects.
- [ ] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).
- [ ] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
---------
Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2024-05-31 10:09:53 +00:00
|
|
|
isSelfService = false,
|
2025-05-02 15:01:26 +00:00
|
|
|
automaticInstallPoliciesCount,
|
2025-06-23 15:09:20 +00:00
|
|
|
iconUrl,
|
2025-11-14 18:24:41 +00:00
|
|
|
isIosOrIpadosApp = false,
|
|
|
|
|
isAndroidPlayStoreApp = false,
|
2026-01-13 20:53:21 +00:00
|
|
|
previewIcon,
|
2024-05-09 21:44:50 +00:00
|
|
|
}: ISoftwareNameCellProps) => {
|
2026-01-30 01:59:27 +00:00
|
|
|
const softwareDisplayName = getDisplayedSoftwareName(name, display_name);
|
2026-01-13 20:53:21 +00:00
|
|
|
const icon = previewIcon || (
|
|
|
|
|
<SoftwareIcon name={name} source={source} url={iconUrl} />
|
|
|
|
|
);
|
2025-06-23 15:09:20 +00:00
|
|
|
// My device page > Software fake link as entire row opens a modal
|
|
|
|
|
if (pageContext === "deviceUser" && !isSelfService) {
|
2025-11-07 14:59:30 +00:00
|
|
|
return (
|
2026-01-30 01:59:27 +00:00
|
|
|
<LinkCell tooltipTruncate prefix={icon} value={softwareDisplayName} />
|
2025-11-07 14:59:30 +00:00
|
|
|
);
|
2025-03-05 20:54:12 +00:00
|
|
|
}
|
|
|
|
|
|
2025-06-23 15:09:20 +00:00
|
|
|
// Non-clickable cell if no router/path (e.g. My device page > SelfService)
|
2024-05-09 21:44:50 +00:00
|
|
|
if (!router || !path) {
|
|
|
|
|
return (
|
|
|
|
|
<div className={baseClass}>
|
2025-08-06 19:32:52 +00:00
|
|
|
<TooltipTruncatedTextCell
|
2025-09-04 17:11:31 +00:00
|
|
|
prefix={icon}
|
2026-01-30 01:59:27 +00:00
|
|
|
value={softwareDisplayName}
|
2025-08-06 19:32:52 +00:00
|
|
|
className="software-name"
|
|
|
|
|
/>
|
2024-05-09 21:44:50 +00:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onClickSoftware = (e: React.MouseEvent) => {
|
|
|
|
|
// Allows for button to be clickable in a clickable row
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
router.push(path);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<LinkCell
|
|
|
|
|
className={baseClass}
|
|
|
|
|
path={path}
|
2025-04-10 19:42:10 +00:00
|
|
|
tooltipTruncate
|
2024-05-09 21:44:50 +00:00
|
|
|
customOnClick={onClickSoftware}
|
2025-09-04 17:11:31 +00:00
|
|
|
prefix={icon}
|
2026-01-30 01:59:27 +00:00
|
|
|
value={softwareDisplayName}
|
2025-04-10 19:42:10 +00:00
|
|
|
suffix={
|
2025-06-23 15:09:20 +00:00
|
|
|
hasInstaller ? (
|
2025-04-10 19:42:10 +00:00
|
|
|
<InstallIconWithTooltip
|
|
|
|
|
isSelfService={isSelfService}
|
2025-05-02 15:01:26 +00:00
|
|
|
automaticInstallPoliciesCount={automaticInstallPoliciesCount}
|
2025-06-23 15:09:20 +00:00
|
|
|
pageContext={pageContext}
|
2025-11-14 18:24:41 +00:00
|
|
|
isIosOrIpadosApp={isIosOrIpadosApp}
|
|
|
|
|
isAndroidPlayStoreApp={isAndroidPlayStoreApp}
|
2025-04-10 19:42:10 +00:00
|
|
|
/>
|
|
|
|
|
) : undefined
|
2024-05-09 21:44:50 +00:00
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default SoftwareNameCell;
|