From c1c87d5a588124e80f22d6b248fbe55ed9234e7b Mon Sep 17 00:00:00 2001 From: William Durand Date: Sun, 15 Jan 2017 10:54:57 +0100 Subject: [PATCH] Update some dependencies --- .eslintrc | 4 +++ app/components/Annotation/Line.jsx | 2 +- app/components/Annotation/index.jsx | 6 ++-- app/components/AnnotationForm/presenter.jsx | 14 ++++++---- app/components/Annotations/index.jsx | 10 +++++-- app/components/Disclaimer/index.jsx | 2 +- app/components/Exons/ExonEdit.jsx | 2 +- app/components/Exons/ExonForm.jsx | 7 +++++ app/components/Exons/presenter.jsx | 10 +++---- app/components/Footer.jsx | 2 +- app/components/InputNumber/InlineButton.jsx | 16 +++++++++-- app/components/InputNumber/RawInputNumber.jsx | 11 +++++++- app/components/InputNumber/index.jsx | 14 ++++++++-- app/components/Labels/LabelEdit.jsx | 2 +- app/components/Labels/LabelForm.jsx | 10 +++++-- app/components/Labels/LabelTools.jsx | 2 +- app/components/Labels/presenter.jsx | 10 +++---- app/components/Loader/presenter.jsx | 2 +- app/components/Notifications/presenter.jsx | 2 +- app/components/Nucleotide/index.js | 6 ++-- app/components/Nucleotide/presenter.jsx | 2 +- app/components/Remove/index.jsx | 2 +- app/components/Search/index.js | 4 +-- app/components/Search/presenter.jsx | 6 +++- app/components/Sequence/index.jsx | 2 +- .../Toolbar/__tests__/Toolbar-test.js | 10 +++++-- app/components/Toolbar/index.js | 2 +- app/components/Toolbar/presenter.jsx | 6 +++- app/components/Visualizer/Help.jsx | 2 +- app/components/Visualizer/index.js | 6 ++-- app/components/Visualizer/presenter.jsx | 12 ++++++-- app/defaults.js | 4 +-- app/modules/franklin.js | 2 +- app/modules/label.js | 10 +++---- app/modules/notification.js | 4 +-- app/modules/sequence.js | 4 +-- app/store/configureStore.js | 16 +++++------ app/utils/positionning.js | 17 +++++------ package.json | 28 +++++++++---------- 39 files changed, 175 insertions(+), 98 deletions(-) diff --git a/.eslintrc b/.eslintrc index 2a28c5c..09957a8 100644 --- a/.eslintrc +++ b/.eslintrc @@ -9,6 +9,10 @@ "import/no-extraneous-dependencies": [2, { 'optionalDependencies': false, }], + "react/no-unused-prop-types": 0, + "react/forbid-prop-types": 1, + "jsx-a11y/no-static-element-interactions": 1, + "react/no-array-index-key": 1, }, "parserOptions":{ "ecmaFeatures": { diff --git a/app/components/Annotation/Line.jsx b/app/components/Annotation/Line.jsx index 20532af..bf72b72 100644 --- a/app/components/Annotation/Line.jsx +++ b/app/components/Annotation/Line.jsx @@ -6,7 +6,7 @@ const tickPosition = { y: 4, }; -const Line = (props) => ( +const Line = props => ( + />, )} ); diff --git a/app/components/AnnotationForm/presenter.jsx b/app/components/AnnotationForm/presenter.jsx index 49da0fc..e263c7f 100644 --- a/app/components/AnnotationForm/presenter.jsx +++ b/app/components/AnnotationForm/presenter.jsx @@ -89,7 +89,7 @@ class AnnotationForm extends Component { comment: this.state.comment, displayTick: this.state.displayTick, }, - this.state.annotationId + this.state.annotationId, ); }); @@ -121,10 +121,10 @@ class AnnotationForm extends Component { event.preventDefault(); this.props.updateSelectionFrom( - this.state.positionTo - this.props.positionFrom + this.state.positionTo - this.props.positionFrom, ); this.props.updateSelectionTo( - this.state.positionFrom - this.props.positionFrom + this.state.positionFrom - this.props.positionFrom, ); } @@ -188,11 +188,11 @@ class AnnotationForm extends Component { { this.props.labels.map((label, index) => + , ) } @@ -259,4 +259,8 @@ AnnotationForm.propTypes = { positionFrom: number.isRequired, }; +AnnotationForm.defaultProps = { + current: null, +}; + export default AnnotationForm; diff --git a/app/components/Annotations/index.jsx b/app/components/Annotations/index.jsx index b08c32d..cfaceb8 100644 --- a/app/components/Annotations/index.jsx +++ b/app/components/Annotations/index.jsx @@ -24,7 +24,7 @@ class Annotations extends Component { this.props.nucleotideWidth, this.props.rowHeight, this.props.nucleotidesRowHeight, - this.props.trackHeight + this.props.trackHeight, ); } @@ -46,8 +46,8 @@ class Annotations extends Component { getAnnotationSegments={this.getAnnotationSegments} positionFrom={this.props.positionFrom} onClick={this.props.onAnnotationClick} - /> - ) + />, + ), ) } @@ -68,4 +68,8 @@ Annotations.propTypes = { selectedAnnotation: object, }; +Annotations.defaultProps = { + selectedAnnotation: null, +}; + export default Annotations; diff --git a/app/components/Disclaimer/index.jsx b/app/components/Disclaimer/index.jsx index 541c55e..fd09175 100644 --- a/app/components/Disclaimer/index.jsx +++ b/app/components/Disclaimer/index.jsx @@ -1,7 +1,7 @@ import React from 'react'; import Modal from 'react-modal'; -const Disclaimer = (props) => ( +const Disclaimer = props => ( ( +const ExonEdit = props => (
+ />, )} {/* New exon */}
@@ -56,10 +56,10 @@ class Exons extends Component { onCreateNewExon={this.props.onCreateNewExon} /> : - } diff --git a/app/components/Footer.jsx b/app/components/Footer.jsx index 22a4dd4..3be245f 100644 --- a/app/components/Footer.jsx +++ b/app/components/Footer.jsx @@ -3,7 +3,7 @@ import React, { PropTypes } from 'react'; const { string } = PropTypes; -const Footer = (props) => +const Footer = props =>
diff --git a/app/components/InputNumber/InlineButton.jsx b/app/components/InputNumber/InlineButton.jsx index fba9b10..4ee5b49 100644 --- a/app/components/InputNumber/InlineButton.jsx +++ b/app/components/InputNumber/InlineButton.jsx @@ -20,7 +20,7 @@ const InlineButton = (props) => {
- {props.errorText || 'Invalid value'} + {props.errorText}
); @@ -55,4 +55,16 @@ InlineButton.propTypes = { hasButtonDisabled: React.PropTypes.bool, }; +InlineButton.defaultProps = { + children: null, + errorText: 'Invalid value', + isDisabled: false, + placeholder: null, + min: null, + value: '', + className: null, + titleText: null, + hasButtonDisabled: false, +}; + export default InlineButton; diff --git a/app/components/InputNumber/RawInputNumber.jsx b/app/components/InputNumber/RawInputNumber.jsx index 72ffa92..8bf3d72 100644 --- a/app/components/InputNumber/RawInputNumber.jsx +++ b/app/components/InputNumber/RawInputNumber.jsx @@ -1,7 +1,7 @@ import React from 'react'; -const RawInputNumber = (props) => +const RawInputNumber = props => { htmlFor={`input-number-${props.className}`} className={isInvalid ? 'is-invalid-label' : ''} > - {props.labelText || null} + {props.labelText} - {props.errorText || 'Invalid value'} + {props.errorText} ); @@ -41,4 +41,14 @@ InputNumber.propTypes = { className: React.PropTypes.string, }; +InputNumber.defaultProps = { + isDisabled: false, + value: '', + min: null, + labelText: null, + errorText: 'Invalid value', + className: null, + placeholder: '', +}; + export default InputNumber; diff --git a/app/components/Labels/LabelEdit.jsx b/app/components/Labels/LabelEdit.jsx index 0092145..1bca255 100644 --- a/app/components/Labels/LabelEdit.jsx +++ b/app/components/Labels/LabelEdit.jsx @@ -2,7 +2,7 @@ import React, { PropTypes } from 'react'; import LabelForm from './LabelForm'; -const LabelEdit = (props) => ( +const LabelEdit = props => (
({ + this.setState(previousState => ({ label: { name: previousState.label.name, color: color.hex, @@ -62,7 +62,7 @@ class LabelForm extends Component { handleNameChange(event) { event.persist(); - this.setState((previousState) => ({ + this.setState(previousState => ({ label: { name: event.target.value, color: previousState.label.color, @@ -158,4 +158,10 @@ LabelForm.propTypes = { label: object, }; +LabelForm.defaultProps = { + onCreateNewLabel: null, + onEditLabel: null, + label: null, +}; + export default LabelForm; diff --git a/app/components/Labels/LabelTools.jsx b/app/components/Labels/LabelTools.jsx index a9737fe..1b261ff 100644 --- a/app/components/Labels/LabelTools.jsx +++ b/app/components/Labels/LabelTools.jsx @@ -1,7 +1,7 @@ import React, { PropTypes } from 'react'; -const LabelTools = (props) => ( +const LabelTools = props => ( { this.props.onToggleLabel(index); }} onEditLabel={(editedLabel) => { this.props.onEditLabel(index, editedLabel); }} onRemoveLabel={() => { this.props.onRemoveLabel(index); }} - /> + />, )}
  • @@ -48,10 +48,10 @@ export default class Labels extends Component { onCancel={this.toggleNewLabelForm} /> : - } diff --git a/app/components/Loader/presenter.jsx b/app/components/Loader/presenter.jsx index ba0c637..f5a27de 100644 --- a/app/components/Loader/presenter.jsx +++ b/app/components/Loader/presenter.jsx @@ -1,6 +1,6 @@ import React from 'react'; -const Loader = (props) => ( +const Loader = props => (

    Rendering your sequence...

    diff --git a/app/components/Notifications/presenter.jsx b/app/components/Notifications/presenter.jsx index 54065e4..eee2de8 100644 --- a/app/components/Notifications/presenter.jsx +++ b/app/components/Notifications/presenter.jsx @@ -11,7 +11,7 @@ const Notifications = props => ( key={index} message={message} onClose={props.onMessageBoxClose} - /> + />, )}

    ); diff --git a/app/components/Nucleotide/index.js b/app/components/Nucleotide/index.js index 4cd525f..cf6b515 100644 --- a/app/components/Nucleotide/index.js +++ b/app/components/Nucleotide/index.js @@ -6,16 +6,16 @@ export const mapStateToProps = (state, ownProps) => { const exon = state.exon; const isSelected = (0 < selection.selections.filter( - s => (s.from === ownProps.index || s.to === ownProps.index) + s => (s.from === ownProps.index || s.to === ownProps.index), ).length); const isInSelectionRange = (0 < selection.selections.filter(s => (s.from <= ownProps.index && s.to >= ownProps.index) || - (s.from >= ownProps.index && s.to <= ownProps.index) + (s.from >= ownProps.index && s.to <= ownProps.index), ).length); const nbExons = exon.exons.filter( - e => e.positionFrom <= ownProps.position && e.positionTo >= ownProps.position + e => e.positionFrom <= ownProps.position && e.positionTo >= ownProps.position, ).size; return { diff --git a/app/components/Nucleotide/presenter.jsx b/app/components/Nucleotide/presenter.jsx index a90fc52..5c98939 100644 --- a/app/components/Nucleotide/presenter.jsx +++ b/app/components/Nucleotide/presenter.jsx @@ -55,7 +55,7 @@ export default class Nucleotide extends Component { props.visualizerMargin, props.nucleotidesPerRow, props.nucleotideWidth, - props.rowHeight + props.rowHeight, )); } diff --git a/app/components/Remove/index.jsx b/app/components/Remove/index.jsx index f731a90..8512c0d 100644 --- a/app/components/Remove/index.jsx +++ b/app/components/Remove/index.jsx @@ -1,7 +1,7 @@ import React, { PropTypes } from 'react'; -const Remove = (props) => ( +const Remove = props => (

    {props.children} diff --git a/app/components/Search/index.js b/app/components/Search/index.js index 88d185a..7c36dac 100644 --- a/app/components/Search/index.js +++ b/app/components/Search/index.js @@ -20,11 +20,11 @@ const mapDispatchToProps = (dispatch, ownProps) => ({ const len = event.target.value.length; const matches = ownProps.ntSequence.mapSequence(q).results().filter( - result => 0 < result.matches && len <= result.matches + result => 0 < result.matches && len <= result.matches, ); dispatch(actions.search(event.target.value, matches.length)); - dispatch(multiSelect(matches.map((m) => ({ + dispatch(multiSelect(matches.map(m => ({ from: m.pos, to: (m.pos + len) - 1, })))); diff --git a/app/components/Search/presenter.jsx b/app/components/Search/presenter.jsx index 3d36487..b626c48 100644 --- a/app/components/Search/presenter.jsx +++ b/app/components/Search/presenter.jsx @@ -1,6 +1,6 @@ import React, { PropTypes } from 'react'; -const Search = (props) => ( +const Search = props => (