reuse authorizedToEdit
This commit is contained in:
parent
cf2784fcdb
commit
77ceac1ee1
1 changed files with 3 additions and 3 deletions
|
@ -8,7 +8,7 @@ import Attachments from './Attachments'
|
||||||
class ReactTopicCard extends Component {
|
class ReactTopicCard extends Component {
|
||||||
render = () => {
|
render = () => {
|
||||||
const { topic, ActiveMapper } = this.props
|
const { topic, ActiveMapper } = this.props
|
||||||
var authorizedToEdit = topic.authorizeToEdit(ActiveMapper)
|
const authorizedToEdit = topic.authorizeToEdit(ActiveMapper)
|
||||||
const hasAttachment = topic.get('link') && topic.get('link') !== ''
|
const hasAttachment = topic.get('link') && topic.get('link') !== ''
|
||||||
const topicId = topic.isNew() ? topic.cid : topic.id // TODO should we be using cid here???
|
const topicId = topic.isNew() ? topic.cid : topic.id // TODO should we be using cid here???
|
||||||
|
|
||||||
|
@ -24,15 +24,15 @@ class ReactTopicCard extends Component {
|
||||||
<div className={classname}>
|
<div className={classname}>
|
||||||
<div className={`CardOnGraph ${hasAttachment ? 'hasAttachment' : ''}`} id={`topic_${topicId}`}>
|
<div className={`CardOnGraph ${hasAttachment ? 'hasAttachment' : ''}`} id={`topic_${topicId}`}>
|
||||||
<Title name={topic.get('name')}
|
<Title name={topic.get('name')}
|
||||||
|
authorizedToEdit={authorizedToEdit}
|
||||||
onChange={this.props.updateTopic}
|
onChange={this.props.updateTopic}
|
||||||
authorizedToEdit={topic.authorizeToEdit(ActiveMapper)}
|
|
||||||
/>
|
/>
|
||||||
<Links topic={topic}
|
<Links topic={topic}
|
||||||
ActiveMapper={this.props.ActiveMapper}
|
ActiveMapper={this.props.ActiveMapper}
|
||||||
updateTopic={this.props.updateTopic}
|
updateTopic={this.props.updateTopic}
|
||||||
/>
|
/>
|
||||||
<Desc desc={topic.get('desc')}
|
<Desc desc={topic.get('desc')}
|
||||||
authorizedToEdit={topic.authorizeToEdit(ActiveMapper)}
|
authorizedToEdit={authorizedToEdit}
|
||||||
onChange={this.props.updateTopic}
|
onChange={this.props.updateTopic}
|
||||||
/>
|
/>
|
||||||
<Attachments topic={this.props.topic}
|
<Attachments topic={this.props.topic}
|
||||||
|
|
Loading…
Add table
Reference in a new issue