diff --git a/.eslintrc b/.eslintrc index 15fbdd5..d54d531 100644 --- a/.eslintrc +++ b/.eslintrc @@ -147,7 +147,11 @@ "semi-spacing": "error", "keyword-spacing": "warn", "space-before-blocks": "error", - "space-before-function-paren": ["error", "never"], + "space-before-function-paren": ["error", { + "anonymous": "never", + "named": "never", + "asyncArrow": "always" + }], "space-in-parens": "warn", "space-infix-ops": "warn", "space-unary-ops": "error", diff --git a/package.json b/package.json index e0e2fd5..8bb1ab6 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "dependencies": { "babel-polyfill": "^6.3.14", "classnames": "^2.1.3", + "copy-to-clipboard": "~3.0.8", "debounce": "^1.0.0", "flag-icon-css": "^2.8.0", "intl": "^1.2.2", @@ -43,6 +44,7 @@ "react-motion": "^0.5.0", "react-redux": "^5.0.6", "react-router-dom": "^4.1.1", + "react-textarea-autosize": "^6.0.0", "react-transition-group": "^1.1.3", "redux": "^3.0.4", "redux-localstorage": "^0.4.1", diff --git a/src/components/auth/actions.js b/src/components/auth/actions.js index 6e1947d..b26c497 100644 --- a/src/components/auth/actions.js +++ b/src/components/auth/actions.js @@ -370,7 +370,7 @@ export function oAuthValidate(oauthData: { export function oAuthComplete(params: {accept?: bool} = {}) { return wrapInLoader((dispatch, getState) => oauth.complete(getState().auth.oauth, params) - .then((resp) => { + .then((resp: Object) => { localStorage.removeItem('oauthData'); if (resp.redirectUri.startsWith('static_page')) { diff --git a/src/components/auth/auth.scss b/src/components/auth/auth.scss new file mode 100644 index 0000000..877a295 --- /dev/null +++ b/src/components/auth/auth.scss @@ -0,0 +1,3 @@ +.checkboxInput { + margin-top: 15px; +} diff --git a/src/components/auth/finish/Finish.js b/src/components/auth/finish/Finish.js index 11d920e..70ba20b 100644 --- a/src/components/auth/finish/Finish.js +++ b/src/components/auth/finish/Finish.js @@ -6,6 +6,7 @@ import { FormattedMessage as Message } from 'react-intl'; import Helmet from 'react-helmet'; import { Button } from 'components/ui/form'; +import copy from 'services/copy'; import messages from './Finish.intl.json'; import styles from './finish.scss'; @@ -21,13 +22,8 @@ class Finish extends Component { success: PropTypes.bool }; - state = { - isCopySupported: document.queryCommandSupported && document.queryCommandSupported('copy') - }; - render() { const {appName, code, state, displayCode, success} = this.props; - const {isCopySupported} = this.state; const authData = JSON.stringify({ auth_code: code, // eslint-disable-line state @@ -53,18 +49,16 @@ class Finish extends Component {
-
{code}
+
+ {code} +
- {isCopySupported ? ( -