From 3bd8a3b39c671646d8785474f91766a1eab22304 Mon Sep 17 00:00:00 2001 From: "Shaun A. Noordin" Date: Wed, 24 Apr 2024 00:43:49 +0100 Subject: [PATCH 1/8] Add isEmailValid and isEmailVerified variables --- app/pages/settings/email.jsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/pages/settings/email.jsx b/app/pages/settings/email.jsx index 4ef325995b..09adbd2841 100644 --- a/app/pages/settings/email.jsx +++ b/app/pages/settings/email.jsx @@ -235,6 +235,9 @@ class EmailSettingsPage extends React.Component { } render() { + const isEmailValid = !!this.props.user?.valid_email; + const isEmailVerfied = !!this.props.user?.confirmed_at; + return (

@@ -251,6 +254,16 @@ class EmailSettingsPage extends React.Component { onChange={handleInputChange.bind(this.props.user)} /> +

+ {(isEmailValid) + ?
Yeah looking good
+ :
Oh no
+ } + {(isEmailVerfied) + ?
Yeah looking good
+ :
Oh no
+ } +

From 2493aa7a207a4db9390da99fb0d61516b1675290 Mon Sep 17 00:00:00 2001 From: "Shaun A. Noordin" Date: Wed, 24 Apr 2024 00:51:14 +0100 Subject: [PATCH 2/8] Email Settings: add messages for valid/invalid/verified/unverified email --- app/locales/en.js | 8 +++++++- app/pages/settings/email.jsx | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/locales/en.js b/app/locales/en.js index 0e223f0051..d88ea2a46f 100644 --- a/app/locales/en.js +++ b/app/locales/en.js @@ -287,7 +287,13 @@ export default { manual: 'Manage projects individually', beta: 'Get beta project email updates and become a beta tester', partnerPreferences: 'Zooniverse partner email preferences', - nasa: 'Get periodic email updates from NASA regarding broader NASA citizen science projects and efforts' + nasa: 'Get periodic email updates from NASA regarding broader NASA citizen science projects and efforts', + emailValid: 'Valid email', + emailInvalid: 'Verified email', + emailInvalidPrompt: 'Please re-enter your email above', + emailVerified: 'Verified email', + emailUnverified: 'Unverified email', + emailUnverifiedPrompt: 'Resend confirmation email' }, talk: { section: 'Talk email preferences', diff --git a/app/pages/settings/email.jsx b/app/pages/settings/email.jsx index 09adbd2841..261634a700 100644 --- a/app/pages/settings/email.jsx +++ b/app/pages/settings/email.jsx @@ -256,12 +256,12 @@ class EmailSettingsPage extends React.Component {

{(isEmailValid) - ?
Yeah looking good
- :
Oh no
+ ?
+ :
|
} {(isEmailVerfied) - ?
Yeah looking good
- :
Oh no
+ ?
+ :
|
}

From b6d9d5ebef454e9e14e0c71f2672d858f3bd9e89 Mon Sep 17 00:00:00 2001 From: "Shaun A. Noordin" Date: Wed, 24 Apr 2024 02:13:37 +0100 Subject: [PATCH 3/8] Webpack Dev Server: disable error overlays --- webpack.dev.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.dev.js b/webpack.dev.js index e9e9bf7931..8d8abc6f3b 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -14,7 +14,7 @@ var config = { ], historyApiFallback: true, client: { - overlay: true, + overlay: false, progress: true }, server: 'https', From 360aa9a9c318a23c5bfe1a7287a2f38e60c938e8 Mon Sep 17 00:00:00 2001 From: "Shaun A. Noordin" Date: Wed, 24 Apr 2024 02:19:55 +0100 Subject: [PATCH 4/8] Email Settings: add requestConfirmationEmail link. Refactor for readability. --- app/pages/settings/email.jsx | 38 ++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/app/pages/settings/email.jsx b/app/pages/settings/email.jsx index 261634a700..8576d32630 100644 --- a/app/pages/settings/email.jsx +++ b/app/pages/settings/email.jsx @@ -151,6 +151,7 @@ class EmailSettingsPage extends React.Component { }; this.handleProjectPreferenceChange = this.handleProjectPreferenceChange.bind(this); this.handleTalkPreferenceChange = this.handleTalkPreferenceChange.bind(this); + this.requestConfirmationEmail = this.requestConfirmationEmail.bind(this); this.getProjectForPreferences(props.user); this.getTalkPreferences(); } @@ -197,6 +198,10 @@ class EmailSettingsPage extends React.Component { }); } + requestConfirmationEmail() { + console.log('+++ Send confirmation email!') + } + handleProjectPreferenceChange(index, event) { const { projectPreferences } = this.state; projectPreferences[index].update({ @@ -235,8 +240,8 @@ class EmailSettingsPage extends React.Component { } render() { - const isEmailValid = !!this.props.user?.valid_email; - const isEmailVerfied = !!this.props.user?.confirmed_at; + const isEmailValid = false && !!this.props.user?.valid_email; + const isEmailVerfied = true || !!this.props.user?.confirmed_at; return (
@@ -256,12 +261,33 @@ class EmailSettingsPage extends React.Component {
{(isEmailValid) - ?
- :
|
+ ?
+ + {' '} + +
+ :
+ + {' '} + + {' | '} + +
} {(isEmailVerfied) - ?
- :
|
+ ?
+ + {' '} +
+ :
+ + {' '} + + {' | '} + + + +
}

From bc7baae5ab1bfe704491a2b56f38ecc2ea968695 Mon Sep 17 00:00:00 2001 From: "Shaun A. Noordin" Date: Wed, 24 Apr 2024 02:28:28 +0100 Subject: [PATCH 5/8] Email Settings: remove test code, fix 'send email' link --- app/pages/settings/email.jsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/pages/settings/email.jsx b/app/pages/settings/email.jsx index 8576d32630..f38a4617ab 100644 --- a/app/pages/settings/email.jsx +++ b/app/pages/settings/email.jsx @@ -240,8 +240,8 @@ class EmailSettingsPage extends React.Component { } render() { - const isEmailValid = false && !!this.props.user?.valid_email; - const isEmailVerfied = true || !!this.props.user?.confirmed_at; + const isEmailValid = !!this.props.user?.valid_email; + const isEmailVerfied = !!this.props.user?.confirmed_at; return (
@@ -278,13 +278,14 @@ class EmailSettingsPage extends React.Component { ?
{' '} -
+ +
:
{' '} {' | '} - +
From 62e9206f61158f1ee02df50e0e026781260471d5 Mon Sep 17 00:00:00 2001 From: "Shaun A. Noordin" Date: Wed, 24 Apr 2024 02:56:39 +0100 Subject: [PATCH 6/8] Email Settings: remove link to resend confirmation email --- app/pages/settings/email.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/pages/settings/email.jsx b/app/pages/settings/email.jsx index f38a4617ab..465c1248a1 100644 --- a/app/pages/settings/email.jsx +++ b/app/pages/settings/email.jsx @@ -284,10 +284,12 @@ class EmailSettingsPage extends React.Component { {' '} + {/* {' | '} + */}
}
From 583c957523d95b57815cba46254ede75630df0b7 Mon Sep 17 00:00:00 2001 From: "Shaun A. Noordin" Date: Wed, 24 Apr 2024 03:02:06 +0100 Subject: [PATCH 7/8] Webpack Dev Server: reinstate overlay --- webpack.dev.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.dev.js b/webpack.dev.js index 8d8abc6f3b..e9e9bf7931 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -14,7 +14,7 @@ var config = { ], historyApiFallback: true, client: { - overlay: false, + overlay: true, progress: true }, server: 'https', From 6125950ee6aebbed35bf0c4975e74ca5c22d338b Mon Sep 17 00:00:00 2001 From: "Shaun A. Noordin" Date: Sat, 1 Jun 2024 00:05:10 +0100 Subject: [PATCH 8/8] Accessibility update --- app/pages/settings/email.jsx | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/app/pages/settings/email.jsx b/app/pages/settings/email.jsx index 465c1248a1..159414818e 100644 --- a/app/pages/settings/email.jsx +++ b/app/pages/settings/email.jsx @@ -140,6 +140,8 @@ Pagination.defaultProps = { page: 1 }; +const FAUX_PARAGRAPH_STYLE = { margin: '1em 0' }; + class EmailSettingsPage extends React.Component { constructor(props) { super(props); @@ -245,15 +247,21 @@ class EmailSettingsPage extends React.Component { return (
-

+

- + +
{(isEmailValid) - ?
+ ?
{' '}
- :
+ :
{' '} @@ -275,12 +283,12 @@ class EmailSettingsPage extends React.Component {
} {(isEmailVerfied) - ?
+ ?
{' '}
- :
+ :
{' '} @@ -293,7 +301,7 @@ class EmailSettingsPage extends React.Component {
}
-

+