diff --git a/src/main/webapp/components/query-manager/query-manager.stories.tsx b/src/main/webapp/components/query-manager/query-manager.stories.tsx index 66382688..5e73c820 100644 --- a/src/main/webapp/components/query-manager/query-manager.stories.tsx +++ b/src/main/webapp/components/query-manager/query-manager.stories.tsx @@ -47,6 +47,9 @@ stories.add('Basic', () => { onCreate={() => { action('onCreate') }} + onDelete={id => { + action('onDelete')(id) + }} /> ) diff --git a/src/main/webapp/components/query-manager/query-manager.tsx b/src/main/webapp/components/query-manager/query-manager.tsx index e4e2198e..6cc43975 100644 --- a/src/main/webapp/components/query-manager/query-manager.tsx +++ b/src/main/webapp/components/query-manager/query-manager.tsx @@ -24,7 +24,7 @@ const { } = require('../result-export/result-export-action') const QueryCard = (props: QueryCardProps) => { - const { onSearch, query = {}, queryInteractions } = props + const { onSearch, onDelete, query = {}, queryInteractions } = props const [anchorEl, handleOpen, handleClose] = useAnchorEl() const [{ active: isDrawing }] = useDrawInterface() const [wasDrawing, setWasDrawing] = useState(false) @@ -56,7 +56,7 @@ const QueryCard = (props: QueryCardProps) => { > - + {queryInteractions.map((interaction, i) => { return ( @@ -79,7 +79,7 @@ const QueryCard = (props: QueryCardProps) => { } const QuerySelector = (props: QuerySelectorProps) => { - const { queries, currentQuery, onSearch, queryInteractions } = props + const { queries, currentQuery, onSearch, onDelete, queryInteractions } = props const hasQueries = queries && queries.length > 0 const [anchorEl, handleOpen, handleClose, open] = useAnchorEl() @@ -89,6 +89,7 @@ const QuerySelector = (props: QuerySelectorProps) => { query={query} key={query.id} onSearch={() => onSearch(query.id!)} + onDelete={() => onDelete(query.id!)} /> )) @@ -112,6 +113,7 @@ const QuerySelector = (props: QuerySelectorProps) => { ]} query={queries.find(query => query.id === currentQuery)} onSearch={() => onSearch(currentQuery)} + onDelete={() => onDelete(currentQuery)} />