* Fixes #831 - fixed linting errors

* forgot to remove a few lines
This commit is contained in:
Mavis Ou 2017-11-07 01:11:40 +00:00 коммит произвёл GitHub
Родитель 3c337c663d
Коммит 45b62a9870
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 14 добавлений и 22 удалений

Просмотреть файл

@ -1,6 +1,5 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import ReactTags from 'react-tag-autocomplete'; import ReactTags from 'react-tag-autocomplete';
import Service from '../../../js/service';
import { DELIMITERS } from './tag-delimiters'; import { DELIMITERS } from './tag-delimiters';
/** /**
@ -66,13 +65,13 @@ export default class AutoCompleteInput extends Component {
handleAddition(field) { handleAddition(field) {
if (field.name) { if (field.name) {
field.name = field.name.trim() field.name = field.name.trim();
} }
const data = [].concat(this.state.data, this.fixLettercase(field)); const data = [].concat(this.state.data, this.fixLettercase(field));
this.update(data); this.update(data);
} }
handleInputChange(input) { handleInputChange() {
// does nothing in the superclass // does nothing in the superclass
} }
@ -105,15 +104,15 @@ export default class AutoCompleteInput extends Component {
}).filter(suggestion => !!suggestion); }).filter(suggestion => !!suggestion);
} }
handleBlur(e) { handleBlur() {
let input = this.reactTags.state.query.trim(); let input = this.reactTags.state.query.trim();
if (input) { if (input) {
this.handlePendingInput(input); this.handlePendingInput(input);
this.reactTags.setState({ query: '' }); this.reactTags.setState({ query: `` });
} }
} }
handlePendingInput(input) { handlePendingInput() {
// does nothing in the superclass // does nothing in the superclass
} }
@ -125,7 +124,7 @@ export default class AutoCompleteInput extends Component {
* @param input string or term object * @param input string or term object
*/ */
save(input) { save(input) {
if (typeof input === 'string') { if (typeof input === `string`) {
input = { name: input }; input = { name: input };
} }
this.handleAddition(input); this.handleAddition(input);
@ -143,9 +142,9 @@ export default class AutoCompleteInput extends Component {
*/ */
render(props={}) { render(props={}) {
let placeholder = props.placeholder || `Add new tag`; let placeholder = props.placeholder || `Add new tag`;
return <div onBlur={e => this.handleBlur(e)} ref={e => this.div=e} tabIndex={0}> return <div onBlur={e => this.handleBlur(e)} ref={e => { this.div = e; }} tabIndex={0}>
<ReactTags <ReactTags
ref={e => this.reactTags=e} ref={e => { this.reactTags = e; }}
tags={this.state.data} tags={this.state.data}
suggestions={this.getFilteredSuggestions()} suggestions={this.getFilteredSuggestions()}
allowNew={true} allowNew={true}

Просмотреть файл

@ -1,9 +1,7 @@
import React, { Component } from 'react';
import ReactTags from 'react-tag-autocomplete';
import Service from '../../../js/service'; import Service from '../../../js/service';
import AutoCompleteInput from './auto-complete-input'; import AutoCompleteInput from './auto-complete-input';
const PROFILE_PREFIX = '👤 '; const PROFILE_PREFIX = `👤 `;
export default class Creators extends AutoCompleteInput { export default class Creators extends AutoCompleteInput {
/** /**
@ -63,7 +61,7 @@ export default class Creators extends AutoCompleteInput {
* clicked away as a creator-by-name for this entry. * clicked away as a creator-by-name for this entry.
*/ */
handlePendingInput(input) { handlePendingInput(input) {
this.save(input) this.save(input);
} }
render() { render() {

Просмотреть файл

@ -1,9 +1,7 @@
import React, { Component } from 'react'; import React from 'react';
import ReactTags from 'react-tag-autocomplete';
import { Link } from 'react-router'; import { Link } from 'react-router';
import IssuesField from '../../../components/form-fields/issues.jsx'; import IssuesField from '../../../components/form-fields/issues.jsx';
import validator from './validator'; import validator from './validator';
import Service from '../../../js/service';
import Creators from './creators'; import Creators from './creators';
import Tags from './tags'; import Tags from './tags';
@ -16,8 +14,8 @@ const IssuesLabel = function() {
module.exports = { module.exports = {
published_by_creator: { published_by_creator: {
type: 'checkbox', type: `checkbox`,
label: 'Yes', label: `Yes`,
fieldClassname: `published-by-creator`, fieldClassname: `published-by-creator`,
guideText: `Are you one of the creators?` guideText: `Are you one of the creators?`
}, },

Просмотреть файл

@ -1,4 +1,3 @@
import React from 'react';
import validator from './validator'; import validator from './validator';
import HelpTypesField from '../../../components/form-fields/help-types.jsx'; import HelpTypesField from '../../../components/form-fields/help-types.jsx';

Просмотреть файл

@ -1,5 +1,3 @@
import React, { Component } from 'react';
import ReactTags from 'react-tag-autocomplete';
import Service from '../../../js/service'; import Service from '../../../js/service';
import AutoCompleteInput from './auto-complete-input'; import AutoCompleteInput from './auto-complete-input';