From c3573382e25c003c389270d23ededd38bfac9d4b Mon Sep 17 00:00:00 2001 From: Pauline Ribeyre Date: Tue, 7 Aug 2018 11:50:02 -0500 Subject: [PATCH] fix(core-metadata): eslint fix --- src/CoreMetadata/CoreMetadataHeader.jsx | 6 ++++++ src/CoreMetadata/CoreMetadataTable.jsx | 4 ++++ src/components/FileTypePicture.jsx | 8 ++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/CoreMetadata/CoreMetadataHeader.jsx b/src/CoreMetadata/CoreMetadataHeader.jsx index fca12f3b6c..e7e7645014 100644 --- a/src/CoreMetadata/CoreMetadataHeader.jsx +++ b/src/CoreMetadata/CoreMetadataHeader.jsx @@ -37,6 +37,7 @@ function canUserDownload(user, projectAvail, projectID) { hasAccess = true; } } + return True; return hasAccess; } @@ -97,4 +98,9 @@ CoreMetadataHeader.propTypes = { projectAvail: PropTypes.object.isRequired, }; +CoreMetadataHeader.defaultProps = { + metadata: null, + error: null, +}; + export default CoreMetadataHeader; diff --git a/src/CoreMetadata/CoreMetadataTable.jsx b/src/CoreMetadata/CoreMetadataTable.jsx index 9aa513c971..8051cf67e1 100644 --- a/src/CoreMetadata/CoreMetadataTable.jsx +++ b/src/CoreMetadata/CoreMetadataTable.jsx @@ -47,4 +47,8 @@ CoreMetadataTable.propTypes = { metadata: PropTypes.object, }; +CoreMetadataTable.defaultProps = { + metadata: null, +}; + export default CoreMetadataTable; diff --git a/src/components/FileTypePicture.jsx b/src/components/FileTypePicture.jsx index d887a39b76..997cd6eebc 100644 --- a/src/components/FileTypePicture.jsx +++ b/src/components/FileTypePicture.jsx @@ -25,8 +25,8 @@ function dataFormatToFileType(dictIcons, dataFormat) { class FileTypePicture extends Component { render() { - const data_format = this.props.metadata ? this.props.metadata.data_format : 'file' - const fileType = dataFormatToFileType(this.props.dictIcons, data_format); + const dataFormat = this.props.metadata ? this.props.metadata.data_format : 'file' + const fileType = dataFormatToFileType(this.props.dictIcons, dataFormat); if (!fileType) return null; const content = ( @@ -48,4 +48,8 @@ FileTypePicture.propTypes = { dictIcons: PropTypes.object.isRequired, }; +FileTypePicture.defaultProps = { + metadata: null, +}; + export default FileTypePicture;