diff --git a/frontend/src/components/TopicCard/Links.js b/frontend/src/components/TopicCard/Links.js index 34b4f5e9..f797e25f 100644 --- a/frontend/src/components/TopicCard/Links.js +++ b/frontend/src/components/TopicCard/Links.js @@ -5,6 +5,9 @@ import React, { PropTypes, Component } from 'react' import Metacode from './Metacode' import Permission from './Permission' +// TODO use a callback instead of an import +import Visualize from '../../Metamaps/Visualize' + const inmaps = (topic) => { const inmapsArray = topic.get('inmaps') || [] const inmapsLinks = topic.get('inmapsLinks') || [] @@ -60,18 +63,22 @@ class Links extends Component { bindShowCardListeners(this.props.topic, this.props.ActiveMapper) } + handleMetacodeClick = metacodeId => { + this.props.updateTopic({ + metacode_id: metacodeId + }) + Visualize.mGraph.plot() + } + render = () => { const { topic, ActiveMapper } = this.props - const topicId = topic.isNew() ? topic.cid : topic.id // TODO should we really be using cid here?!? const metacode = topic.getMetacode() return (