Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #214 from TailorDev/deps
Browse files Browse the repository at this point in the history
Update some dependencies
  • Loading branch information
willdurand authored Jan 15, 2017
2 parents ceb6ce5 + c1c87d5 commit 75330ce
Show file tree
Hide file tree
Showing 39 changed files with 175 additions and 98 deletions.
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion app/components/Annotation/Line.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const tickPosition = {
y: 4,
};

const Line = (props) => (
const Line = props => (
<g>
<line
x1={props.x1}
Expand Down
6 changes: 3 additions & 3 deletions app/components/Annotation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Annotation extends Component {
this.props.onClick(
this.props.labelId,
this.props.annotation,
this.props.positionFrom
this.props.positionFrom,
);
}

Expand All @@ -37,7 +37,7 @@ class Annotation extends Component {
segments: props.getAnnotationSegments(
props.labelId,
props.annotation.positionFrom - 1,
props.annotation.positionTo - 1
props.annotation.positionTo - 1,
),
});
}
Expand Down Expand Up @@ -67,7 +67,7 @@ class Annotation extends Component {
color={this.props.label.color}
hasTick={displayTick && !isUnit && indexForTick === index}
isReverse={isReverse}
/>
/>,
)}
</g>
);
Expand Down
14 changes: 9 additions & 5 deletions app/components/AnnotationForm/presenter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class AnnotationForm extends Component {
comment: this.state.comment,
displayTick: this.state.displayTick,
},
this.state.annotationId
this.state.annotationId,
);
});

Expand Down Expand Up @@ -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,
);
}

Expand Down Expand Up @@ -188,11 +188,11 @@ class AnnotationForm extends Component {
{
this.props.labels.map((label, index) =>
<option
key={index}
key={label.name}
value={index}
>
{label.name}
</option>
</option>,
)
}
</select>
Expand Down Expand Up @@ -259,4 +259,8 @@ AnnotationForm.propTypes = {
positionFrom: number.isRequired,
};

AnnotationForm.defaultProps = {
current: null,
};

export default AnnotationForm;
10 changes: 7 additions & 3 deletions app/components/Annotations/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Annotations extends Component {
this.props.nucleotideWidth,
this.props.rowHeight,
this.props.nucleotidesRowHeight,
this.props.trackHeight
this.props.trackHeight,
);
}

Expand All @@ -46,8 +46,8 @@ class Annotations extends Component {
getAnnotationSegments={this.getAnnotationSegments}
positionFrom={this.props.positionFrom}
onClick={this.props.onAnnotationClick}
/>
)
/>,
),
)
}
</g>
Expand All @@ -68,4 +68,8 @@ Annotations.propTypes = {
selectedAnnotation: object,
};

Annotations.defaultProps = {
selectedAnnotation: null,
};

export default Annotations;
2 changes: 1 addition & 1 deletion app/components/Disclaimer/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import Modal from 'react-modal';

const Disclaimer = (props) => (
const Disclaimer = props => (
<Modal
overlayClassName="modal-overlay"
className="modal-content"
Expand Down
2 changes: 1 addition & 1 deletion app/components/Exons/ExonEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { PropTypes } from 'react';
import ExonForm from './ExonForm';


const ExonEdit = (props) => (
const ExonEdit = props => (
<div className="action-edit">
<ExonForm
exon={props.exon}
Expand Down
7 changes: 7 additions & 0 deletions app/components/Exons/ExonForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,11 @@ ExonForm.propTypes = {
exon: object,
};

ExonForm.defaultProps = {
onRemoveExon: null,
onCreateNewExon: null,
onEditExon: null,
exon: null,
};

export default ExonForm;
10 changes: 5 additions & 5 deletions app/components/Exons/presenter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Exons extends Component {
exon={exon}
onEditExon={this.props.onEditExon}
onRemoveExon={this.props.onRemoveExon}
/>
/>,
)}
{/* New exon */}
<div className="new">
Expand All @@ -56,10 +56,10 @@ class Exons extends Component {
onCreateNewExon={this.props.onCreateNewExon}
/>
:
<button
className="button new-exon"
onClick={this.toggleNewExonForm}
>
<button
className="button new-exon"
onClick={this.toggleNewExonForm}
>
New Exon
</button>
}
Expand Down
2 changes: 1 addition & 1 deletion app/components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { PropTypes } from 'react';
const { string } = PropTypes;


const Footer = (props) =>
const Footer = props =>
<footer className="main">
<div className="version">
<span className="git-ref">
Expand Down
16 changes: 14 additions & 2 deletions app/components/InputNumber/InlineButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ const InlineButton = (props) => {
<button
onClick={props.onClick}
className="button"
title={props.titleText || null}
title={props.titleText}
disabled={props.hasButtonDisabled || false}
>
{props.children}
</button>
</div>
</div>
<small className={`form-error${isInvalid ? ' is-visible' : ''}`}>
{props.errorText || 'Invalid value'}
{props.errorText}
</small>
</div>
);
Expand All @@ -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;
11 changes: 10 additions & 1 deletion app/components/InputNumber/RawInputNumber.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';


const RawInputNumber = (props) =>
const RawInputNumber = props =>
<input
type="number"
name={`input-number-${props.className}`}
Expand Down Expand Up @@ -31,4 +31,13 @@ RawInputNumber.propTypes = {
className: React.PropTypes.string,
};

RawInputNumber.defaultProps = {
isDisabled: false,
isInvalid: false,
placeholder: null,
min: null,
value: '',
className: null,
};

export default RawInputNumber;
14 changes: 12 additions & 2 deletions app/components/InputNumber/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ const InputNumber = (props) => {
htmlFor={`input-number-${props.className}`}
className={isInvalid ? 'is-invalid-label' : ''}
>
{props.labelText || null}
{props.labelText}
<RawInputNumber
{...props}
isInvalid={isInvalid}
/>
<small className={`form-error${isInvalid ? ' is-visible' : ''}`}>
{props.errorText || 'Invalid value'}
{props.errorText}
</small>
</label>
);
Expand All @@ -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;
2 changes: 1 addition & 1 deletion app/components/Labels/LabelEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { PropTypes } from 'react';
import LabelForm from './LabelForm';


const LabelEdit = (props) => (
const LabelEdit = props => (
<div className="action-edit">
<LabelForm
label={props.label}
Expand Down
10 changes: 8 additions & 2 deletions app/components/Labels/LabelForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class LabelForm extends Component {
}

handleColorChange(color) {
this.setState((previousState) => ({
this.setState(previousState => ({
label: {
name: previousState.label.name,
color: color.hex,
Expand All @@ -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,
Expand Down Expand Up @@ -158,4 +158,10 @@ LabelForm.propTypes = {
label: object,
};

LabelForm.defaultProps = {
onCreateNewLabel: null,
onEditLabel: null,
label: null,
};

export default LabelForm;
2 changes: 1 addition & 1 deletion app/components/Labels/LabelTools.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { PropTypes } from 'react';


const LabelTools = (props) => (
const LabelTools = props => (
<span className="label-tools">
<i
className="fa fa-adjust toggle"
Expand Down
10 changes: 5 additions & 5 deletions app/components/Labels/presenter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class Labels extends Component {
onToggleLabel={() => { this.props.onToggleLabel(index); }}
onEditLabel={(editedLabel) => { this.props.onEditLabel(index, editedLabel); }}
onRemoveLabel={() => { this.props.onRemoveLabel(index); }}
/>
/>,
)}

<li className="new">
Expand All @@ -48,10 +48,10 @@ export default class Labels extends Component {
onCancel={this.toggleNewLabelForm}
/>
:
<button
className="button new-label"
onClick={this.toggleNewLabelForm}
>
<button
className="button new-label"
onClick={this.toggleNewLabelForm}
>
New label
</button>
}
Expand Down
2 changes: 1 addition & 1 deletion app/components/Loader/presenter.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

const Loader = (props) => (
const Loader = props => (
<div className="loader" style={{ display: props.display ? 'block' : 'none' }}>
<p className="message">
Rendering your sequence...<br /><br />
Expand Down
2 changes: 1 addition & 1 deletion app/components/Notifications/presenter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Notifications = props => (
key={index}
message={message}
onClose={props.onMessageBoxClose}
/>
/>,
)}
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions app/components/Nucleotide/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion app/components/Nucleotide/presenter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class Nucleotide extends Component {
props.visualizerMargin,
props.nucleotidesPerRow,
props.nucleotideWidth,
props.rowHeight
props.rowHeight,
));
}

Expand Down
2 changes: 1 addition & 1 deletion app/components/Remove/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { PropTypes } from 'react';


const Remove = (props) => (
const Remove = props => (
<div className="action-remove">
<p>
{props.children}
Expand Down
Loading

0 comments on commit 75330ce

Please sign in to comment.