X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/4ad549e2cebe285c9a854e466f3e0ddac10b808d..8623f430ea556381f8681c2aea00e43e64d3f6d1:/src/views-components/search-bar/search-bar-autocomplete-view.tsx?ds=sidebyside

diff --git a/src/views-components/search-bar/search-bar-autocomplete-view.tsx b/src/views-components/search-bar/search-bar-autocomplete-view.tsx
index 02ff4c74..e45197dd 100644
--- a/src/views-components/search-bar/search-bar-autocomplete-view.tsx
+++ b/src/views-components/search-bar/search-bar-autocomplete-view.tsx
@@ -6,6 +6,7 @@ import * as React from 'react';
 import { Paper, StyleRulesCallback, withStyles, WithStyles, List, ListItem, ListItemText } from '@material-ui/core';
 import { GroupContentsResource } from '~/services/groups-service/groups-service';
 import Highlighter from "react-highlight-words";
+import { SearchBarSelectedItem } from "~/store/search-bar/search-bar-reducer";
 
 type CssRules = 'searchView' | 'list' | 'listItem';
 
@@ -20,15 +21,14 @@ const styles: StyleRulesCallback<CssRules> = theme => {
         listItem: {
             paddingLeft: theme.spacing.unit,
             paddingRight: theme.spacing.unit * 2,
-        },
-
+        }
     };
 };
 
 export interface SearchBarAutocompleteViewDataProps {
     searchResults: GroupContentsResource[];
     searchValue?: string;
-    selectedItem: string;
+    selectedItem: SearchBarSelectedItem;
 }
 
 export interface SearchBarAutocompleteViewActionProps {
@@ -39,14 +39,13 @@ type SearchBarAutocompleteViewProps = SearchBarAutocompleteViewDataProps & Searc
 
 export const SearchBarAutocompleteView = withStyles(styles)(
     ({ classes, searchResults, searchValue, navigateTo, selectedItem }: SearchBarAutocompleteViewProps) => {
-        console.log(searchValue, selectedItem);
         return <Paper className={classes.searchView}>
             <List component="nav" className={classes.list}>
-                <ListItem button className={classes.listItem} selected={!selectedItem || searchValue === selectedItem}>
+                <ListItem button className={classes.listItem} selected={!selectedItem || searchValue === selectedItem.id}>
                     <ListItemText secondary={searchValue}/>
                 </ListItem>
                 {searchResults.map((item: GroupContentsResource) =>
-                    <ListItem button key={item.uuid} className={classes.listItem} selected={item.uuid === selectedItem}>
+                    <ListItem button key={item.uuid} className={classes.listItem} selected={item.uuid === selectedItem.id}>
                         <ListItemText secondary={getFormattedText(item.name, searchValue)}
                                       onClick={() => navigateTo(item.uuid)}/>
                     </ListItem>
