UI – Only render SW version tooltip for > 1 version (#19003)
## Addresses #18852  - [x] Changes file added for user-visible changes in `changes/` - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
co-authored by
Jacob Shandling
parent
f87906b1d1
commit
7cc39cdc3e
@@ -0,0 +1 @@
|
||||
- Fix a bug where a singular software version in the Software table generated a tooltip unnecessarily.
|
||||
@@ -4,8 +4,6 @@ import { IconNames } from "components/icons";
|
||||
// @ts-ignore
|
||||
import InputFieldWithIcon from "../InputFieldWithIcon";
|
||||
|
||||
const baseClass = "search-field";
|
||||
|
||||
export interface ISearchFieldProps {
|
||||
placeholder: string;
|
||||
defaultValue?: string;
|
||||
@@ -37,7 +35,6 @@ const SearchField = ({
|
||||
name={icon}
|
||||
placeholder={placeholder}
|
||||
value={searchQueryInput}
|
||||
// inputWrapperClass={`${baseClass}__input-wrapper`}
|
||||
onChange={onInputChange}
|
||||
onClick={onClick}
|
||||
iconPosition="start"
|
||||
|
||||
@@ -44,14 +44,14 @@ interface IVersionCellProps {
|
||||
}
|
||||
|
||||
const VersionCell = ({ versions }: IVersionCellProps) => {
|
||||
const tooltipId = uniqueId();
|
||||
|
||||
// only one version, no need for tooltip
|
||||
const cellText = generateText(versions);
|
||||
if (!versions) {
|
||||
if (!versions || versions.length <= 1) {
|
||||
return <>{cellText}</>;
|
||||
}
|
||||
|
||||
const tooltipId = uniqueId();
|
||||
|
||||
const versionTooltip = generateTooltip(versions, tooltipId);
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user