mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
commit
a5a560eb21
1 changed files with 4 additions and 3 deletions
|
@ -119,10 +119,10 @@ const CardEditForm = ({ collection, document, closeModal }) =>
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
const Card = ({className, collection, document, currentUser, fields}, {intl}) => {
|
const Card = ({className, collection, document, currentUser, fields, showEdit = true}, {intl}) => {
|
||||||
|
|
||||||
const fieldNames = fields ? fields : _.without(_.keys(document), '__typename');
|
const fieldNames = fields ? fields : _.without(_.keys(document), '__typename');
|
||||||
const canEdit = currentUser && collection.options.mutations.edit.check(currentUser, document);
|
const canEdit = showEdit && currentUser && collection.options.mutations.edit.check(currentUser, document);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(className, 'datacard', `datacard-${collection._name}`)}>
|
<div className={classNames(className, 'datacard', `datacard-${collection._name}`)}>
|
||||||
|
@ -146,10 +146,11 @@ Card.propTypes = {
|
||||||
document: PropTypes.object,
|
document: PropTypes.object,
|
||||||
currentUser: PropTypes.object,
|
currentUser: PropTypes.object,
|
||||||
fields: PropTypes.array,
|
fields: PropTypes.array,
|
||||||
|
showEdit: PropTypes.bool
|
||||||
}
|
}
|
||||||
|
|
||||||
Card.contextTypes = {
|
Card.contextTypes = {
|
||||||
intl: intlShape
|
intl: intlShape
|
||||||
}
|
}
|
||||||
|
|
||||||
registerComponent('Card', Card);
|
registerComponent('Card', Card);
|
||||||
|
|
Loading…
Add table
Reference in a new issue