X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/a960b30fd5da0619e5029e67712b2a2778e4b591..ef8180fa2f0b90b1656b1d8c7ef12bc6ea028a0a:/src/views-components/search-bar/search-bar-save-queries.tsx

diff --git a/src/views-components/search-bar/search-bar-save-queries.tsx b/src/views-components/search-bar/search-bar-save-queries.tsx
index aa62c58f..1b765b94 100644
--- a/src/views-components/search-bar/search-bar-save-queries.tsx
+++ b/src/views-components/search-bar/search-bar-save-queries.tsx
@@ -2,12 +2,13 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from 'react';
+import React from 'react';
 import { withStyles, WithStyles, StyleRulesCallback, List, ListItem, ListItemText, ListItemSecondaryAction, Tooltip, IconButton } from '@material-ui/core';
-import { ArvadosTheme } from '~/common/custom-theme';
-import { RemoveIcon, EditSavedQueryIcon } from '~/components/icon/icon';
-import { SearchBarAdvanceFormData } from '~/models/search-bar';
-import { SearchBarSelectedItem } from "~/store/search-bar/search-bar-reducer";
+import { ArvadosTheme } from 'common/custom-theme';
+import { RemoveIcon, EditSavedQueryIcon } from 'components/icon/icon';
+import { SearchBarAdvancedFormData } from 'models/search-bar';
+import { SearchBarSelectedItem } from "store/search-bar/search-bar-reducer";
+import { getQueryFromAdvancedData } from "store/search-bar/search-bar-actions";
 
 type CssRules = 'root' | 'listItem' | 'listItemText' | 'button';
 
@@ -30,14 +31,14 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 });
 
 export interface SearchBarSavedQueriesDataProps {
-    savedQueries: SearchBarAdvanceFormData[];
+    savedQueries: SearchBarAdvancedFormData[];
     selectedItem: SearchBarSelectedItem;
 }
 
 export interface SearchBarSavedQueriesActionProps {
     onSearch: (searchValue: string) => void;
     deleteSavedQuery: (id: number) => void;
-    editSavedQuery: (data: SearchBarAdvanceFormData, id: number) => void;
+    editSavedQuery: (data: SearchBarAdvancedFormData, id: number) => void;
 }
 
 type SearchBarSavedQueriesProps = SearchBarSavedQueriesDataProps
@@ -48,10 +49,10 @@ export const SearchBarSavedQueries = withStyles(styles)(
     ({ classes, savedQueries, onSearch, editSavedQuery, deleteSavedQuery, selectedItem }: SearchBarSavedQueriesProps) =>
         <List component="nav" className={classes.root}>
             {savedQueries.map((query, index) =>
-                <ListItem button key={index} className={classes.listItem} selected={`SQ-${index}-${query.searchQuery}` === selectedItem.id}>
+                <ListItem button key={index} className={classes.listItem} selected={`SQ-${index}-${query.queryName}` === selectedItem.id}>
                     <ListItemText disableTypography
-                        secondary={query.searchQuery}
-                        onClick={() => onSearch(query.searchQuery)}
+                        secondary={query.queryName}
+                        onClick={() => onSearch(getQueryFromAdvancedData(query))}
                         className={classes.listItemText} />
                     <ListItemSecondaryAction>
                         <Tooltip title="Edit">
