From 506b2db6cebf12345f929b15401d1e9619c0121f Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Tue, 22 Aug 2017 21:57:35 +0300 Subject: [PATCH] #305: fix the rest of linting warnings --- src/components/auth/finish/Finish.js | 15 ++++++++------- src/components/auth/login/LoginBody.js | 1 + src/components/contact/ContactForm.js | 10 +++++----- src/components/contact/ContactForm.test.js | 1 + .../profile/changePassword/ChangePassword.js | 6 +++++- .../profile/changePassword/ChangePassword.test.js | 1 + .../profile/changeUsername/ChangeUsername.js | 6 +++++- src/components/ui/form/Checkbox.js | 6 +++++- src/components/ui/popup/PopupStack.test.js | 1 + 9 files changed, 32 insertions(+), 15 deletions(-) diff --git a/src/components/auth/finish/Finish.js b/src/components/auth/finish/Finish.js index ab79273..11d920e 100644 --- a/src/components/auth/finish/Finish.js +++ b/src/components/auth/finish/Finish.js @@ -16,6 +16,7 @@ class Finish extends Component { static propTypes = { appName: PropTypes.string.isRequired, code: PropTypes.string.isRequired, + state: PropTypes.string.isRequired, displayCode: PropTypes.bool, success: PropTypes.bool }; @@ -28,8 +29,8 @@ class Finish extends Component { const {appName, code, state, displayCode, success} = this.props; const {isCopySupported} = this.state; const authData = JSON.stringify({ - auth_code: code, - state: state + auth_code: code, // eslint-disable-line + state }); history.pushState(null, null, `#${authData}`); @@ -40,7 +41,7 @@ class Finish extends Component { {success ? (
-
+
{appName}) @@ -59,7 +60,7 @@ class Finish extends Component { color="green" small label={messages.copy} - onClick={this.handleCopyClick} + onClick={this.onCopyClick} /> ) : ( '' @@ -73,7 +74,7 @@ class Finish extends Component {
) : (
-
+
{appName}) @@ -88,7 +89,7 @@ class Finish extends Component { ); } - handleCopyClick = (event) => { + onCopyClick = (event) => { event.preventDefault(); // http://stackoverflow.com/a/987376/5184751 @@ -104,7 +105,7 @@ class Finish extends Component { // TODO: было бы ещё неплохо сделать какую-то анимацию, вроде "Скопировано", // ибо сейчас после клика как-то неубедительно, скопировалось оно или нет - console.log('Copying text command was ' + (successful ? 'successful' : 'unsuccessful')); + console.log('Copying text command was %s', successful ? 'successful' : 'unsuccessful'); } catch (err) { // not critical } diff --git a/src/components/auth/login/LoginBody.js b/src/components/auth/login/LoginBody.js index c6b1171..2a679d8 100644 --- a/src/components/auth/login/LoginBody.js +++ b/src/components/auth/login/LoginBody.js @@ -1,3 +1,4 @@ +import React from 'react'; import { Input } from 'components/ui/form'; import BaseAuthBody from 'components/auth/BaseAuthBody'; diff --git a/src/components/contact/ContactForm.js b/src/components/contact/ContactForm.js index cb49e43..4135f57 100644 --- a/src/components/contact/ContactForm.js +++ b/src/components/contact/ContactForm.js @@ -15,11 +15,11 @@ import messages from './contactForm.intl.json'; const CONTACT_CATEGORIES = [ // TODO: сюда позже проставить реальные id категорий с backend - , - , - , - , - + , + , + , + , + ]; export class ContactForm extends Component { diff --git a/src/components/contact/ContactForm.test.js b/src/components/contact/ContactForm.test.js index 92874f2..9178e58 100644 --- a/src/components/contact/ContactForm.test.js +++ b/src/components/contact/ContactForm.test.js @@ -1,3 +1,4 @@ +import React from 'react'; import expect from 'unexpected'; import sinon from 'sinon'; import { shallow, mount } from 'enzyme'; diff --git a/src/components/profile/changePassword/ChangePassword.js b/src/components/profile/changePassword/ChangePassword.js index 7192355..22f7a97 100644 --- a/src/components/profile/changePassword/ChangePassword.js +++ b/src/components/profile/changePassword/ChangePassword.js @@ -88,7 +88,11 @@ export default class ChangePassword extends Component {
-
diff --git a/src/components/profile/changePassword/ChangePassword.test.js b/src/components/profile/changePassword/ChangePassword.test.js index 2c68985..bca4198 100644 --- a/src/components/profile/changePassword/ChangePassword.test.js +++ b/src/components/profile/changePassword/ChangePassword.test.js @@ -1,3 +1,4 @@ +import React from 'react'; import expect from 'unexpected'; import sinon from 'sinon'; diff --git a/src/components/profile/changeUsername/ChangeUsername.js b/src/components/profile/changeUsername/ChangeUsername.js index ba2d368..7ce2a56 100644 --- a/src/components/profile/changeUsername/ChangeUsername.js +++ b/src/components/profile/changeUsername/ChangeUsername.js @@ -69,7 +69,11 @@ export default class ChangeUsername extends Component {
-