From 1b5c27eea3dd5c94a67e30c26da19aecc94ece42 Mon Sep 17 00:00:00 2001 From: jfavellar90 Date: Thu, 13 Dec 2018 15:34:08 -0500 Subject: [PATCH 1/5] Making student account deletion components a bit site aware --- .../StudentAccountDeletionInitializer.js | 8 +++- .../components/StudentAccountDeletion.jsx | 38 +++++++++++++++++-- .../StudentAccountDeletionModal.jsx | 27 +++++++++++-- .../student_account/account_settings.html | 3 ++ 4 files changed, 68 insertions(+), 8 deletions(-) diff --git a/lms/static/js/student_account/StudentAccountDeletionInitializer.js b/lms/static/js/student_account/StudentAccountDeletionInitializer.js index 5637e9e2d5..9be01bbbc9 100644 --- a/lms/static/js/student_account/StudentAccountDeletionInitializer.js +++ b/lms/static/js/student_account/StudentAccountDeletionInitializer.js @@ -16,7 +16,13 @@ const wrapperRendered = setInterval(() => { component: StudentAccountDeletion, selector: `#${accountDeletionWrapperId}`, componentName: 'StudentAccountDeletion', - props: { socialAccountLinks: window.auth, isActive: window.isActive }, + props: { + socialAccountLinks: window.auth, + isActive: window.isActive, + platformName: window.platformName, + siteName: window.siteName, + lmsUrlRoot: window.lmsUrlRoot + }, }); } diff --git a/lms/static/js/student_account/components/StudentAccountDeletion.jsx b/lms/static/js/student_account/components/StudentAccountDeletion.jsx index e925d5455f..3c4aea3621 100644 --- a/lms/static/js/student_account/components/StudentAccountDeletion.jsx +++ b/lms/static/js/student_account/components/StudentAccountDeletion.jsx @@ -73,18 +73,34 @@ export class StudentAccountDeletion extends React.Component { ); const acctDeletionWarningText = StringUtils.interpolate( - gettext('{strongStart}Warning: Account deletion is permanent.{strongEnd} Please read the above carefully before proceeding. This is an irreversible action, and {strongStart}you will no longer be able to use the same email on edX.{strongEnd}'), + gettext('{strongStart}Warning: Account deletion is permanent.{strongEnd} Please read the above carefully before proceeding. This is an irreversible action, and {strongStart}you will no longer be able to use the same email on {platformName}.{strongEnd}'), { strongStart: '', strongEnd: '', + platformName: this.props.platformName, + }, + ); + + const noteDeletion = StringUtils.interpolate( + gettext('Please note: Deletion of your account and personal data is permanent and cannot be undone. {platformName} will not be able to recover your account or the data that is deleted.'), + { + platformName: this.props.platformName, + }, + ); + + const bodyDeletion = StringUtils.interpolate( + gettext('Once your account is deleted, you cannot use it to take courses on the {platformName} app, {siteName}, or any other site hosted by {platformName}.'), + { + platformName: this.props.platformName, + siteName: this.props.siteName, }, ); return (

{ gettext('We’re sorry to see you go!') }

-

{ gettext('Please note: Deletion of your account and personal data is permanent and cannot be undone. EdX will not be able to recover your account or the data that is deleted.') }

-

{ gettext('Once your account is deleted, you cannot use it to take courses on the edX app, edx.org, or any other site hosted by edX. This includes access to edx.org from your employer’s or university’s system and access to private sites offered by MIT Open Learning, Wharton Executive Education, and Harvard Medical School.') }

+

{noteDeletion}

+

{bodyDeletion}

} - {deletionModalOpen && } + {deletionModalOpen && }

); } @@ -136,4 +157,13 @@ StudentAccountDeletion.propTypes = { socialAccountLinks: PropTypes.shape({ providers: PropTypes.arrayOf(PropTypes.object), }).isRequired, + platformName: PropTypes.string, + siteName: PropTypes.string, + lmsUrlRoot: PropTypes.string, +}; + +StudentAccountDeletion.defaultProps = { + platformName: '', + siteName: '', + lmsUrlRoot: '', }; diff --git a/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx b/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx index fef4a3b2f9..0eff6d14b7 100644 --- a/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx +++ b/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx @@ -31,7 +31,7 @@ class StudentAccountDeletionConfirmationModal extends React.Component { this.props.onClose(); removeLoggedInCookies(); - window.location.href = 'https://www.edx.org'; + window.location.href = this.props.lmsUrlRoot; } deleteAccount() { @@ -101,6 +101,21 @@ class StudentAccountDeletionConfirmationModal extends React.Component { }, ); + const noteDeletion = StringUtils.interpolate( + gettext('You have selected “Delete my account.” Deletion of your account and personal data is permanent and cannot be undone. {platformName} will not be able to recover your account or the data that is deleted.'), + { + platformName: this.props.platformName, + }, + ); + + const bodyDeletion = StringUtils.interpolate( + gettext('If you proceed, you will be unable to use this account to take courses on the {platformName} app, {siteName}, or any other site hosted by {platformName}.'), + { + platformName: this.props.platformName, + siteName: this.props.siteName, + }, + ); + return (
-

{ gettext('You have selected “Delete my account.” Deletion of your account and personal data is permanent and cannot be undone. EdX will not be able to recover your account or the data that is deleted.') }

-

{ gettext('If you proceed, you will be unable to use this account to take courses on the edX app, edx.org, or any other site hosted by edX. This includes access to edx.org from your employer’s or university’s system and access to private sites offered by MIT Open Learning, Wharton Executive Education, and Harvard Medical School.') }

+

{noteDeletion}

+

{bodyDeletion}

@@ -198,10 +213,16 @@ class StudentAccountDeletionConfirmationModal extends React.Component { StudentAccountDeletionConfirmationModal.propTypes = { onClose: PropTypes.func, + platformName: PropTypes.string, + siteName: PropTypes.string, + lmsUrlRoot: PropTypes.string, }; StudentAccountDeletionConfirmationModal.defaultProps = { onClose: () => {}, + platformName: "", + siteName: "", + lmsUrlRoot: "", }; export default StudentAccountDeletionConfirmationModal; diff --git a/lms/templates/student_account/account_settings.html b/lms/templates/student_account/account_settings.html index 4de6bcf944..57d5edc48f 100644 --- a/lms/templates/student_account/account_settings.html +++ b/lms/templates/student_account/account_settings.html @@ -77,6 +77,9 @@ from openedx.core.djangoapps.user_api.accounts.utils import is_secondary_email_f <%static:webpack entry="StudentAccountDeletionInitializer"> From 35bd58a7e4b76bed58bc6a0fc6bee26b5fe66f54 Mon Sep 17 00:00:00 2001 From: Luis Moreno Date: Wed, 28 Aug 2019 14:20:05 -0400 Subject: [PATCH 2/5] Use MKTG ROOT LINK instead of LMS_ROOT_URL --- .../js/student_account/StudentAccountDeletionInitializer.js | 2 +- .../student_account/components/StudentAccountDeletion.jsx | 6 +++--- .../components/StudentAccountDeletionModal.jsx | 6 +++--- lms/templates/student_account/account_settings.html | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lms/static/js/student_account/StudentAccountDeletionInitializer.js b/lms/static/js/student_account/StudentAccountDeletionInitializer.js index 9be01bbbc9..90c3868b7a 100644 --- a/lms/static/js/student_account/StudentAccountDeletionInitializer.js +++ b/lms/static/js/student_account/StudentAccountDeletionInitializer.js @@ -21,7 +21,7 @@ const wrapperRendered = setInterval(() => { isActive: window.isActive, platformName: window.platformName, siteName: window.siteName, - lmsUrlRoot: window.lmsUrlRoot + mktgRootLink: window.mktgRootLink }, }); } diff --git a/lms/static/js/student_account/components/StudentAccountDeletion.jsx b/lms/static/js/student_account/components/StudentAccountDeletion.jsx index 3c4aea3621..b407e1a6f9 100644 --- a/lms/static/js/student_account/components/StudentAccountDeletion.jsx +++ b/lms/static/js/student_account/components/StudentAccountDeletion.jsx @@ -145,7 +145,7 @@ export class StudentAccountDeletion extends React.Component { onClose={this.closeDeletionModal} platformName={this.props.platformName} siteName={this.props.siteName} - lmsUrlRoot={this.props.lmsUrlRoot} + mktgRootLink={this.props.mktgRootLink} />} ); @@ -159,11 +159,11 @@ StudentAccountDeletion.propTypes = { }).isRequired, platformName: PropTypes.string, siteName: PropTypes.string, - lmsUrlRoot: PropTypes.string, + mktgRootLink: PropTypes.string, }; StudentAccountDeletion.defaultProps = { platformName: '', siteName: '', - lmsUrlRoot: '', + mktgRootLink: '', }; diff --git a/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx b/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx index 0eff6d14b7..f17811f93a 100644 --- a/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx +++ b/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx @@ -31,7 +31,7 @@ class StudentAccountDeletionConfirmationModal extends React.Component { this.props.onClose(); removeLoggedInCookies(); - window.location.href = this.props.lmsUrlRoot; + window.location.href = this.props.mktgRootLink; } deleteAccount() { @@ -215,14 +215,14 @@ StudentAccountDeletionConfirmationModal.propTypes = { onClose: PropTypes.func, platformName: PropTypes.string, siteName: PropTypes.string, - lmsUrlRoot: PropTypes.string, + mktgRootLink: PropTypes.string, }; StudentAccountDeletionConfirmationModal.defaultProps = { onClose: () => {}, platformName: "", siteName: "", - lmsUrlRoot: "", + mktgRootLink: "", }; export default StudentAccountDeletionConfirmationModal; diff --git a/lms/templates/student_account/account_settings.html b/lms/templates/student_account/account_settings.html index 57d5edc48f..326fca4eef 100644 --- a/lms/templates/student_account/account_settings.html +++ b/lms/templates/student_account/account_settings.html @@ -79,7 +79,7 @@ from openedx.core.djangoapps.user_api.accounts.utils import is_secondary_email_f window.isActive = ${ user.is_active | n, dump_js_escaped_json }; window.platformName = "${ platform_name | n, js_escaped_string }"; window.siteName = "${ static.get_value('SITE_NAME', settings.SITE_NAME) | n, js_escaped_string }"; - window.lmsUrlRoot = "${ static.get_value('LMS_ROOT_URL', settings.LMS_ROOT_URL) | n, js_escaped_string }"; + window.mktgRootLink = "${ static.marketing_link('ROOT') | n, js_escaped_string }"; <%static:webpack entry="StudentAccountDeletionInitializer"> From d1f96748c50524e0d3575f02312b4809e942eea2 Mon Sep 17 00:00:00 2001 From: Luis Moreno Date: Wed, 28 Aug 2019 20:41:20 -0400 Subject: [PATCH 3/5] Do not remove last sentence in StudentAccountDeletion message --- .../js/student_account/components/StudentAccountDeletion.jsx | 5 ++++- .../components/StudentAccountDeletionModal.jsx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lms/static/js/student_account/components/StudentAccountDeletion.jsx b/lms/static/js/student_account/components/StudentAccountDeletion.jsx index b407e1a6f9..131b7689ef 100644 --- a/lms/static/js/student_account/components/StudentAccountDeletion.jsx +++ b/lms/static/js/student_account/components/StudentAccountDeletion.jsx @@ -100,7 +100,10 @@ export class StudentAccountDeletion extends React.Component {

{ gettext('We’re sorry to see you go!') }

{noteDeletion}

-

{bodyDeletion}

+

+ {bodyDeletion} + { gettext('This includes access to edx.org from your employer’s or university’s system and access to private sites offered by MIT Open Learning, Wharton Executive Education, and Harvard Medical School.') } +

{noteDeletion}

-

{bodyDeletion}

+

+ {bodyDeletion} + { gettext('This includes access to edx.org from your employer’s or university’s system and access to private sites offered by MIT Open Learning, Wharton Executive Education, and Harvard Medical School.') } +

From f4ca8bdf484ab2b57a9b6ad8c8f71426ffe89ccc Mon Sep 17 00:00:00 2001 From: Luis Moreno Date: Mon, 21 Oct 2019 19:01:23 -0400 Subject: [PATCH 4/5] Addressing feedback --- .../StudentAccountDeletionInitializer.js | 5 +++-- .../components/StudentAccountDeletion.jsx | 20 +++++++++++++++---- .../StudentAccountDeletionModal.jsx | 17 +++++++++++++--- .../student_account/account_settings.html | 4 +++- 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/lms/static/js/student_account/StudentAccountDeletionInitializer.js b/lms/static/js/student_account/StudentAccountDeletionInitializer.js index 90c3868b7a..f062264d16 100644 --- a/lms/static/js/student_account/StudentAccountDeletionInitializer.js +++ b/lms/static/js/student_account/StudentAccountDeletionInitializer.js @@ -19,9 +19,10 @@ const wrapperRendered = setInterval(() => { props: { socialAccountLinks: window.auth, isActive: window.isActive, + additionalSiteSpecificDeletionText: window.additionalSiteSpecificDeletionText, + mktgRootLink: window.mktgRootLink, platformName: window.platformName, - siteName: window.siteName, - mktgRootLink: window.mktgRootLink + siteName: window.siteName }, }); } diff --git a/lms/static/js/student_account/components/StudentAccountDeletion.jsx b/lms/static/js/student_account/components/StudentAccountDeletion.jsx index 131b7689ef..a1de201549 100644 --- a/lms/static/js/student_account/components/StudentAccountDeletion.jsx +++ b/lms/static/js/student_account/components/StudentAccountDeletion.jsx @@ -96,13 +96,22 @@ export class StudentAccountDeletion extends React.Component { }, ); + const bodyDeletion2 = StringUtils.interpolate( + gettext('This includes access to {siteName} from your employer’s or university’s system and access to private sites offered by {additionalSiteSpecificDeletionText}.'), + { + siteName: this.props.siteName, + additionalSiteSpecificDeletionText: this.props.additionalSiteSpecificDeletionText, + }, + ); + + return (

{ gettext('We’re sorry to see you go!') }

{noteDeletion}

{bodyDeletion} - { gettext('This includes access to edx.org from your employer’s or university’s system and access to private sites offered by MIT Open Learning, Wharton Executive Education, and Harvard Medical School.') } + {bodyDeletion2}

}

); @@ -160,13 +170,15 @@ StudentAccountDeletion.propTypes = { socialAccountLinks: PropTypes.shape({ providers: PropTypes.arrayOf(PropTypes.object), }).isRequired, + additionalSiteSpecificDeletionText: PropTypes.string, + mktgRootLink: PropTypes.string, platformName: PropTypes.string, siteName: PropTypes.string, - mktgRootLink: PropTypes.string, }; StudentAccountDeletion.defaultProps = { + additionalSiteSpecificDeletionText: '', + mktgRootLink: '', platformName: '', siteName: '', - mktgRootLink: '', }; diff --git a/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx b/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx index 5238d53e76..b1dec8404b 100644 --- a/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx +++ b/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx @@ -116,6 +116,15 @@ class StudentAccountDeletionConfirmationModal extends React.Component { }, ); + const bodyDeletion2 = StringUtils.interpolate( + gettext('This includes access to {siteName} from your employer’s or university’s system and access to private sites offered by {additionalSiteSpecificDeletionText}.'), + { + siteName: this.props.siteName, + additionalSiteSpecificDeletionText: this.props.additionalSiteSpecificDeletionText, + }, + ); + + return (
{noteDeletion}

{bodyDeletion} - { gettext('This includes access to edx.org from your employer’s or university’s system and access to private sites offered by MIT Open Learning, Wharton Executive Education, and Harvard Medical School.') } + {bodyDeletion2}

@@ -216,16 +225,18 @@ class StudentAccountDeletionConfirmationModal extends React.Component { StudentAccountDeletionConfirmationModal.propTypes = { onClose: PropTypes.func, + additionalSiteSpecificDeletionText: PropTypes.string, + mktgRootLink: PropTypes.string, platformName: PropTypes.string, siteName: PropTypes.string, - mktgRootLink: PropTypes.string, }; StudentAccountDeletionConfirmationModal.defaultProps = { onClose: () => {}, + additionalSiteSpecificDeletionText: "", + mktgRootLink: "", platformName: "", siteName: "", - mktgRootLink: "", }; export default StudentAccountDeletionConfirmationModal; diff --git a/lms/templates/student_account/account_settings.html b/lms/templates/student_account/account_settings.html index 326fca4eef..bdf360704f 100644 --- a/lms/templates/student_account/account_settings.html +++ b/lms/templates/student_account/account_settings.html @@ -77,9 +77,11 @@ from openedx.core.djangoapps.user_api.accounts.utils import is_secondary_email_f <%static:webpack entry="StudentAccountDeletionInitializer"> From 2f22e0189df7262fba886e6bc647b8f9f05282f2 Mon Sep 17 00:00:00 2001 From: Luis Moreno Date: Fri, 25 Oct 2019 19:21:37 -0400 Subject: [PATCH 5/5] Mark string as translatable --- .../js/student_account/components/StudentAccountDeletion.jsx | 3 +-- .../student_account/components/StudentAccountDeletionModal.jsx | 2 +- lms/templates/student_account/account_settings.html | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lms/static/js/student_account/components/StudentAccountDeletion.jsx b/lms/static/js/student_account/components/StudentAccountDeletion.jsx index a1de201549..30713689bb 100644 --- a/lms/static/js/student_account/components/StudentAccountDeletion.jsx +++ b/lms/static/js/student_account/components/StudentAccountDeletion.jsx @@ -97,14 +97,13 @@ export class StudentAccountDeletion extends React.Component { ); const bodyDeletion2 = StringUtils.interpolate( - gettext('This includes access to {siteName} from your employer’s or university’s system and access to private sites offered by {additionalSiteSpecificDeletionText}.'), + gettext('This includes access to {siteName} from your employer’s or university’s system{additionalSiteSpecificDeletionText}.'), { siteName: this.props.siteName, additionalSiteSpecificDeletionText: this.props.additionalSiteSpecificDeletionText, }, ); - return (

{ gettext('We’re sorry to see you go!') }

diff --git a/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx b/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx index b1dec8404b..0267831a42 100644 --- a/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx +++ b/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx @@ -117,7 +117,7 @@ class StudentAccountDeletionConfirmationModal extends React.Component { ); const bodyDeletion2 = StringUtils.interpolate( - gettext('This includes access to {siteName} from your employer’s or university’s system and access to private sites offered by {additionalSiteSpecificDeletionText}.'), + gettext('This includes access to {siteName} from your employer’s or university’s system{additionalSiteSpecificDeletionText}.'), { siteName: this.props.siteName, additionalSiteSpecificDeletionText: this.props.additionalSiteSpecificDeletionText, diff --git a/lms/templates/student_account/account_settings.html b/lms/templates/student_account/account_settings.html index bdf360704f..184c58411f 100644 --- a/lms/templates/student_account/account_settings.html +++ b/lms/templates/student_account/account_settings.html @@ -77,7 +77,7 @@ from openedx.core.djangoapps.user_api.accounts.utils import is_secondary_email_f