From 384e83fe3954c33fb7a8e54cfaae6ce2a96596d0 Mon Sep 17 00:00:00 2001
From: Hannu Lyytikainen
Date: Thu, 7 Sep 2017 10:07:35 +0300
Subject: [PATCH 01/22] Rename files
PasswordForgottenPage to PasswordRecoveryPage
PasswordForgottenForm to PasswordRecoveryForm
---
.../PasswordRecoveryForm.example.js} | 0
.../PasswordRecoveryForm.js} | 0
.../PasswordRecoveryForm.test.js} | 0
.../__snapshots__/PasswordRecoveryForm.test.js.snap} | 0
.../PasswordRecoveryPage.js} | 0
.../PasswordRecoveryPage.test.js} | 0
.../__snapshots__/PasswordRecoveryPage.test.js.snap} | 0
7 files changed, 0 insertions(+), 0 deletions(-)
rename src/containers/{PasswordForgottenForm/PasswordForgottenForm.example.js => PasswordRecoveryForm/PasswordRecoveryForm.example.js} (100%)
rename src/containers/{PasswordForgottenForm/PasswordForgottenForm.js => PasswordRecoveryForm/PasswordRecoveryForm.js} (100%)
rename src/containers/{PasswordForgottenForm/PasswordForgottenForm.test.js => PasswordRecoveryForm/PasswordRecoveryForm.test.js} (100%)
rename src/containers/{PasswordForgottenForm/__snapshots__/PasswordForgottenForm.test.js.snap => PasswordRecoveryForm/__snapshots__/PasswordRecoveryForm.test.js.snap} (100%)
rename src/containers/{PasswordForgottenPage/PasswordForgottenPage.js => PasswordRecoveryPage/PasswordRecoveryPage.js} (100%)
rename src/containers/{PasswordForgottenPage/PasswordForgottenPage.test.js => PasswordRecoveryPage/PasswordRecoveryPage.test.js} (100%)
rename src/containers/{PasswordForgottenPage/__snapshots__/PasswordForgottenPage.test.js.snap => PasswordRecoveryPage/__snapshots__/PasswordRecoveryPage.test.js.snap} (100%)
diff --git a/src/containers/PasswordForgottenForm/PasswordForgottenForm.example.js b/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.example.js
similarity index 100%
rename from src/containers/PasswordForgottenForm/PasswordForgottenForm.example.js
rename to src/containers/PasswordRecoveryForm/PasswordRecoveryForm.example.js
diff --git a/src/containers/PasswordForgottenForm/PasswordForgottenForm.js b/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.js
similarity index 100%
rename from src/containers/PasswordForgottenForm/PasswordForgottenForm.js
rename to src/containers/PasswordRecoveryForm/PasswordRecoveryForm.js
diff --git a/src/containers/PasswordForgottenForm/PasswordForgottenForm.test.js b/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.test.js
similarity index 100%
rename from src/containers/PasswordForgottenForm/PasswordForgottenForm.test.js
rename to src/containers/PasswordRecoveryForm/PasswordRecoveryForm.test.js
diff --git a/src/containers/PasswordForgottenForm/__snapshots__/PasswordForgottenForm.test.js.snap b/src/containers/PasswordRecoveryForm/__snapshots__/PasswordRecoveryForm.test.js.snap
similarity index 100%
rename from src/containers/PasswordForgottenForm/__snapshots__/PasswordForgottenForm.test.js.snap
rename to src/containers/PasswordRecoveryForm/__snapshots__/PasswordRecoveryForm.test.js.snap
diff --git a/src/containers/PasswordForgottenPage/PasswordForgottenPage.js b/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js
similarity index 100%
rename from src/containers/PasswordForgottenPage/PasswordForgottenPage.js
rename to src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js
diff --git a/src/containers/PasswordForgottenPage/PasswordForgottenPage.test.js b/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.test.js
similarity index 100%
rename from src/containers/PasswordForgottenPage/PasswordForgottenPage.test.js
rename to src/containers/PasswordRecoveryPage/PasswordRecoveryPage.test.js
diff --git a/src/containers/PasswordForgottenPage/__snapshots__/PasswordForgottenPage.test.js.snap b/src/containers/PasswordRecoveryPage/__snapshots__/PasswordRecoveryPage.test.js.snap
similarity index 100%
rename from src/containers/PasswordForgottenPage/__snapshots__/PasswordForgottenPage.test.js.snap
rename to src/containers/PasswordRecoveryPage/__snapshots__/PasswordRecoveryPage.test.js.snap
From 0d6cd6a05e2fda2d69b36c51dfed29c28d460ede Mon Sep 17 00:00:00 2001
From: Hannu Lyytikainen
Date: Thu, 7 Sep 2017 10:17:35 +0300
Subject: [PATCH 02/22] Update file references
---
.../PasswordRecoveryForm.example.js | 4 ++--
.../PasswordRecoveryForm/PasswordRecoveryForm.js | 8 ++++----
.../PasswordRecoveryForm.test.js | 6 +++---
.../PasswordRecoveryForm.test.js.snap | 2 +-
.../PasswordRecoveryPage/PasswordRecoveryPage.js | 16 ++++++++--------
.../PasswordRecoveryPage.test.js | 4 ++--
src/containers/index.js | 8 ++++----
src/examples.js | 6 +++---
src/routesConfiguration.js | 8 ++++----
9 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.example.js b/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.example.js
index 6b864451..9d4bb450 100644
--- a/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.example.js
+++ b/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.example.js
@@ -1,8 +1,8 @@
/* eslint-disable no-console */
-import PasswordForgottenForm from './PasswordForgottenForm';
+import PasswordRecoveryForm from './PasswordRecoveryForm';
export const Empty = {
- component: PasswordForgottenForm,
+ component: PasswordRecoveryForm,
props: {
onSubmit(values) {
console.log('submit forgotten password email:', values);
diff --git a/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.js b/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.js
index ce137a6f..3641ed5d 100644
--- a/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.js
+++ b/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.js
@@ -2,7 +2,7 @@ import React from 'react';
import { Field, reduxForm, propTypes as formPropTypes } from 'redux-form';
import { Button } from '../../components';
-const PasswordForgottenForm = props => {
+const PasswordRecoveryForm = props => {
const { handleSubmit, pristine, submitting } = props;
return (
-
+
diff --git a/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js b/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js
index b613a3c1..0e1f0f7b 100644
--- a/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js
+++ b/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js
@@ -73,10 +73,7 @@ export const PasswordRecoveryPageComponent = props => {
-
+
From 00803945a536c051c24cf77ce6508e8241e6b508 Mon Sep 17 00:00:00 2001
From: Hannu Lyytikainen
Date: Wed, 13 Sep 2017 09:11:49 +0300
Subject: [PATCH 12/22] Add recovery email resend
---
.../PasswordRecoveryPage/PasswordRecoveryPage.js | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js b/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js
index 0e1f0f7b..ca13d9a4 100644
--- a/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js
+++ b/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js
@@ -67,16 +67,17 @@ export const PasswordRecoveryPageComponent = props => {
const emailSubmittedLinks = (
-
+ onSubmitEmail(submittedEmail)}
+ >
-
+
-
-
);
From 237e1d208af3d2f66946f84053352d79a6e1f01d Mon Sep 17 00:00:00 2001
From: Hannu Lyytikainen
Date: Wed, 13 Sep 2017 09:30:30 +0300
Subject: [PATCH 13/22] Change password recovery url to recover-password
---
src/app.test.js | 2 +-
src/containers/LoginForm/__snapshots__/LoginForm.test.js.snap | 2 +-
src/routesConfiguration.js | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/app.test.js b/src/app.test.js
index b02db9ff..e27cac46 100644
--- a/src/app.test.js
+++ b/src/app.test.js
@@ -43,7 +43,7 @@ describe('Application', () => {
'/u/1234': 'Profile page with display name: 1234',
'/login': 'Login',
'/signup': 'Sign up',
- '/recover_password': 'Request new password',
+ '/recover-password': 'Request new password',
'/this-url-should-not-be-found': 'Page not found',
'/reset-password?t=token&e=email': 'Reset password',
};
diff --git a/src/containers/LoginForm/__snapshots__/LoginForm.test.js.snap b/src/containers/LoginForm/__snapshots__/LoginForm.test.js.snap
index 8cc13dd7..9bba618b 100644
--- a/src/containers/LoginForm/__snapshots__/LoginForm.test.js.snap
+++ b/src/containers/LoginForm/__snapshots__/LoginForm.test.js.snap
@@ -46,7 +46,7 @@ exports[`LoginForm matches snapshot 1`] = `
className={undefined}>
diff --git a/src/routesConfiguration.js b/src/routesConfiguration.js
index 052b28f5..d1056a52 100644
--- a/src/routesConfiguration.js
+++ b/src/routesConfiguration.js
@@ -145,7 +145,7 @@ const routesConfiguration = [
component: props => ,
},
{
- path: '/recover_password',
+ path: '/recover-password',
exact: true,
name: 'PasswordRecoveryPage',
component: props => ,
From 95ba740e08ca2670a19b3559dc6305c8bd1e366e Mon Sep 17 00:00:00 2001
From: Hannu Lyytikainen
Date: Wed, 13 Sep 2017 09:39:28 +0300
Subject: [PATCH 14/22] Remove unused imports and props
---
.../PasswordRecoveryForm/PasswordRecoveryForm.js | 2 +-
.../PasswordRecoveryPage/PasswordRecoveryPage.js | 7 +------
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.js b/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.js
index a421e768..a4de3775 100644
--- a/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.js
+++ b/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.js
@@ -1,7 +1,7 @@
import React from 'react';
import { compose } from 'redux';
import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
-import { Field, reduxForm, propTypes as formPropTypes } from 'redux-form';
+import { reduxForm, propTypes as formPropTypes } from 'redux-form';
import { PrimaryButton, TextInputField, NamedLink } from '../../components';
import * as validators from '../../util/validators';
diff --git a/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js b/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js
index ca13d9a4..93d3bb9b 100644
--- a/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js
+++ b/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js
@@ -8,7 +8,7 @@ import { sendVerificationEmail } from '../../ducks/user.duck';
import { logout, authenticationInProgress } from '../../ducks/Auth.duck';
import { manageDisableScrolling, isScrollingDisabled } from '../../ducks/UI.duck';
import { recoverPassword, retypeEmail } from './PasswordRecoveryPage.duck';
-import { PageLayout, Topbar, NamedLink, InlineTextButton, KeysIcon } from '../../components';
+import { PageLayout, Topbar, InlineTextButton, KeysIcon } from '../../components';
import { PasswordRecoveryForm } from '../../containers';
import css from './PasswordRecoveryPage.css';
@@ -41,8 +41,6 @@ export const PasswordRecoveryPageComponent = props => {
onResendVerificationEmail,
initialEmail,
submittedEmail,
- recoveryInProgress,
- recoveryError,
onSubmitEmail,
onRetypeEmail,
} = props;
@@ -128,7 +126,6 @@ PasswordRecoveryPageComponent.defaultProps = {
sendVerificationEmailError: null,
initialEmail: null,
submittedEmail: null,
- recoveryError: null,
};
const { bool, func, instanceOf, number, object, shape, string } = PropTypes;
@@ -149,8 +146,6 @@ PasswordRecoveryPageComponent.propTypes = {
onResendVerificationEmail: func.isRequired,
initialEmail: string,
submittedEmail: string,
- recoveryInProgress: bool.isRequired,
- recoveryError: instanceOf(Error),
onSubmitEmail: func.isRequired,
onRetypeEmail: func.isRequired,
From 82fe1ce4900c97235d3478ff2bff3268be929fa7 Mon Sep 17 00:00:00 2001
From: Hannu Lyytikainen
Date: Wed, 13 Sep 2017 11:15:31 +0300
Subject: [PATCH 15/22] Apply styles
---
.../PasswordRecoveryForm.css | 3 +-
.../PasswordRecoveryForm.js | 39 ++++++++++++---
.../PasswordRecoveryPage.css | 50 +++++++++++++++++--
.../PasswordRecoveryPage.js | 24 +++++----
src/translations/en.json | 2 +-
5 files changed, 94 insertions(+), 24 deletions(-)
diff --git a/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.css b/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.css
index 2a2f8cbd..cc4d642e 100644
--- a/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.css
+++ b/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.css
@@ -13,7 +13,8 @@
margin-bottom: 24px;
@media (--viewportMedium) {
- margin-top: 30px;
+ margin-top: 22px;
+ margin-bottom: 88px;
}
}
diff --git a/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.js b/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.js
index a4de3775..6b3c20e2 100644
--- a/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.js
+++ b/src/containers/PasswordRecoveryForm/PasswordRecoveryForm.js
@@ -1,14 +1,24 @@
-import React from 'react';
+import React, { PropTypes } from 'react';
import { compose } from 'redux';
import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
import { reduxForm, propTypes as formPropTypes } from 'redux-form';
+import classNames from 'classnames';
import { PrimaryButton, TextInputField, NamedLink } from '../../components';
import * as validators from '../../util/validators';
import css from './PasswordRecoveryForm.css';
const PasswordRecoveryFormComponent = props => {
- const { handleSubmit, pristine, submitting, form, initialValues, intl } = props;
+ const {
+ rootClassName,
+ className,
+ handleSubmit,
+ pristine,
+ submitting,
+ form,
+ initialValues,
+ intl,
+ } = props;
// email
const emailLabel = intl.formatMessage({
@@ -21,10 +31,18 @@ const PasswordRecoveryFormComponent = props => {
id: 'PasswordRecoveryForm.emailRequired',
});
const emailRequired = validators.required(emailRequiredMessage);
+
const initialEmail = initialValues ? initialValues.email : null;
const buttonDisabled = (pristine && !initialEmail) || submitting;
+ const classes = classNames(rootClassName || css.root, className);
+
+ const goToLoginHelp = (
+
+
+
+ );
return (
-