From a2e8fbab953ea789907c7bb83bed94faf538f834 Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Sun, 24 Jul 2016 11:32:54 +0300 Subject: [PATCH] #156: add already have code for register panel --- src/components/auth/RejectionLink.jsx | 4 +++- .../auth/activation/Activation.intl.json | 3 ++- src/components/auth/activation/ActivationBody.jsx | 14 +++++++++++--- src/components/auth/register/Register.jsx | 9 ++++++++- .../auth/resendActivation/ResendActivation.jsx | 4 +++- src/i18n/be.json | 1 + src/i18n/en.json | 3 ++- src/i18n/ru.json | 3 ++- src/i18n/uk.json | 3 ++- src/services/authFlow/RegisterState.js | 9 +++++++-- src/services/authFlow/ResendActivationState.js | 4 ++++ .../services/authFlow/AuthFlow.functional.test.js | 2 +- tests/services/authFlow/RegisterState.test.js | 9 ++++++++- .../authFlow/ResendActivationState.test.js | 8 ++++++++ 14 files changed, 62 insertions(+), 14 deletions(-) diff --git a/src/components/auth/RejectionLink.jsx b/src/components/auth/RejectionLink.jsx index 6af51f8..d0630a7 100644 --- a/src/components/auth/RejectionLink.jsx +++ b/src/components/auth/RejectionLink.jsx @@ -7,7 +7,7 @@ export default function RejectionLink(props, context) { { event.preventDefault(); - context.reject(); + context.reject(props.payload); }}> @@ -16,6 +16,8 @@ export default function RejectionLink(props, context) { RejectionLink.displayName = 'RejectionLink'; RejectionLink.propTypes = { + // eslint-disable-next-line react/forbid-prop-types + payload: PropTypes.object, // Custom payload for active state label: PropTypes.shape({ id: PropTypes.string }).isRequired diff --git a/src/components/auth/activation/Activation.intl.json b/src/components/auth/activation/Activation.intl.json index 9d409a8..67ee899 100644 --- a/src/components/auth/activation/Activation.intl.json +++ b/src/components/auth/activation/Activation.intl.json @@ -1,6 +1,7 @@ { "accountActivationTitle": "Account activation", - "activationMailWasSent": "Please check {email} for the message with the last registration step", + "activationMailWasSent": "Please check {email} for the message with further instructions", + "activationMailWasSentNoEmail": "Please check your E-mail for the message with further instructions", "confirmEmail": "Confirm E‑mail", "didNotReceivedEmail": "Did not received E‑mail?", "enterTheCode": "Enter the code from E‑mail here" diff --git a/src/components/auth/activation/ActivationBody.jsx b/src/components/auth/activation/ActivationBody.jsx index 846e13d..2b257b7 100644 --- a/src/components/auth/activation/ActivationBody.jsx +++ b/src/components/auth/activation/ActivationBody.jsx @@ -22,6 +22,7 @@ export default class ActivationBody extends BaseAuthBody { render() { const {key} = this.props.params; + const email = this.context.user.email; return (
@@ -31,9 +32,16 @@ export default class ActivationBody extends BaseAuthBody {
- {this.context.user.email}) - }} /> + {email + ? ( + {email}) + }} /> + ) + : ( + + ) + }
diff --git a/src/components/auth/register/Register.jsx b/src/components/auth/register/Register.jsx index ceb2f4e..3b60352 100644 --- a/src/components/auth/register/Register.jsx +++ b/src/components/auth/register/Register.jsx @@ -4,6 +4,7 @@ import { Button } from 'components/ui/form'; import RejectionLink from 'components/auth/RejectionLink'; import AuthTitle from 'components/auth/AuthTitle'; import activationMessages from 'components/auth/activation/Activation.intl.json'; +import forgotPasswordMessages from 'components/auth/forgotPassword/ForgotPassword.intl.json'; import messages from './Register.intl.json'; import Body from './RegisterBody'; @@ -13,6 +14,12 @@ export default function Register() { Title: () => , Body, Footer: () =>