Skip to content

Commit

Permalink
Use id as uniqueness criterion when searching for host targets
Browse files Browse the repository at this point in the history
- Addresses an issue where unique hosts with the same name as another host that is
    already selected were not listed in search results
  • Loading branch information
Jacob Shandling committed Jan 22, 2025
1 parent b01fdac commit 1b15a99
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions frontend/components/LiveQuery/TargetsInput/TargetsInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import TableContainer from "components/TableContainer";
import { ITargestInputHostTableConfig } from "./TargetsInputHostsTableConfig";

interface ITargetsInputProps {
tabIndex?: number;
searchText: string;
searchResults: IHost[];
isTargetsLoading: boolean;
Expand All @@ -35,7 +34,6 @@ const baseClass = "targets-input";
const DEFAULT_LABEL = "Target specific hosts";

const TargetsInput = ({
tabIndex,
searchText,
searchResults,
isTargetsLoading,
Expand All @@ -52,7 +50,7 @@ const TargetsInput = ({
}: ITargetsInputProps): JSX.Element => {
const dropdownRef = useRef<HTMLDivElement | null>(null);
const dropdownHosts =
searchResults && pullAllBy(searchResults, targetedHosts, "display_name");
searchResults && pullAllBy(searchResults, targetedHosts, "id");

const [isActiveSearch, setIsActiveSearch] = useState(false);

Expand Down

0 comments on commit 1b15a99

Please sign in to comment.