diff --git a/src/card/Card.tsx b/src/card/Card.tsx index 317260a44..1552bec3a 100644 --- a/src/card/Card.tsx +++ b/src/card/Card.tsx @@ -30,6 +30,7 @@ import { setReportHelpModalOpen } from '../application/ApplicationActions'; import { loadDatabaseListFromNeo4jThunk } from '../dashboard/DashboardThunks'; import { Neo4jContext, Neo4jContextState } from 'use-neo4j/dist/neo4j.context'; import { getDashboardExtensions } from '../dashboard/DashboardSelectors'; +import { downloadComponentAsImage } from '../chart/ChartUtils'; const NeoCard = ({ index, // index of the card. @@ -61,6 +62,8 @@ const NeoCard = ({ const [databaseList, setDatabaseList] = React.useState([database]); const [databaseListLoaded, setDatabaseListLoaded] = React.useState(false); + const ref = React.useRef(); + // fetching the list of databases from neo4j, filtering out the 'system' db useEffect(() => { if (!databaseListLoaded) { @@ -120,7 +123,7 @@ const NeoCard = ({
{/* The front of the card, referred to as the 'view' */} - + downloadComponentAsImage(ref)} query={report.query} globalParameters={globalParameters} fields={report.fields ? report.fields : []} @@ -199,7 +203,7 @@ const NeoCard = ({ // Look into React Portals: https://stackoverflow.com/questions/61432878/how-to-render-child-component-outside-of-its-parent-component-dom-hierarchy if (expanded) { return ( - + downloadComponentAsImage(ref)} + onDownloadImage={onDownloadImage} onToggleCardExpand={onToggleCardExpand} expanded={expanded} >