diff --git a/src/app/js/characteristic/DatasetCharacteristicItem.js b/src/app/js/characteristic/DatasetCharacteristicItem.js index e0a6a0d8c2..a817b54638 100644 --- a/src/app/js/characteristic/DatasetCharacteristicItem.js +++ b/src/app/js/characteristic/DatasetCharacteristicItem.js @@ -1,15 +1,15 @@ -import React, { PropTypes } from 'react'; +import React from 'react'; import { connect } from 'react-redux'; import Property from '../lib/Property'; import { getFieldByName } from '../publication'; -import { field as fieldPropTypes } from '../propTypes'; +import { field as fieldPropTypes, resource as resourcePropTypes } from '../propTypes'; const DatasetCharacteristicItemComponent = ({ resource, field }) => ( ); DatasetCharacteristicItemComponent.propTypes = { - resource: PropTypes.object.isRequired, // eslint-disable-line + resource: resourcePropTypes.isRequired, field: fieldPropTypes.isRequired, }; diff --git a/src/app/js/lib/Property.js b/src/app/js/lib/Property.js index 75045a44dd..8e6cb544ee 100644 --- a/src/app/js/lib/Property.js +++ b/src/app/js/lib/Property.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { PropTypes } from 'react'; import { connect } from 'react-redux'; import compose from 'recompose/compose'; import translate from 'redux-polyglot/translate'; @@ -7,7 +7,12 @@ import { getResourceUnvalidatedFields, getResourceContributorsByField, } from '../resource'; -import { property as propertyPropTypes } from '../propTypes'; +import { + contributor as contributorPropTypes, + field as fieldPropTypes, + polyglot as polyglotPropTypes, + resource as resourcePropTypes, +} from '../propTypes'; import { getCollectionFields } from '../publication'; import Format from '../formats/Format'; @@ -50,7 +55,14 @@ const PropertyComponent = ({ field, fields, resource, contributors, unValidatedF ); -PropertyComponent.propTypes = propertyPropTypes; +PropertyComponent.propTypes = { + contributors: PropTypes.arrayOf(contributorPropTypes).isRequired, + field: fieldPropTypes.isRequired, + fields: PropTypes.arrayOf(fieldPropTypes).isRequired, + p: polyglotPropTypes.isRequired, + resource: resourcePropTypes.isRequired, + unValidatedFields: PropTypes.arrayOf(PropTypes.string).isRequired, +}; const mapStateToProps = state => ({ unValidatedFields: getResourceUnvalidatedFields(state), diff --git a/src/app/js/propTypes.js b/src/app/js/propTypes.js index 24f13fdfa8..26f89e3fc9 100644 --- a/src/app/js/propTypes.js +++ b/src/app/js/propTypes.js @@ -14,6 +14,12 @@ export const field = PropTypes.shape({ scheme: PropTypes.string, }); +export const resource = PropTypes.shape({ + uri: PropTypes.string.isRequired, +}); + +export const contributor = PropTypes.object; + export const property = PropTypes.shape({ name: PropTypes.string.isRequired, value: PropTypes.any.isRequired,