Merge pull request #21185 from eduNEXT/lmm/retirementssiteaware

Making student account deletion components a bit site aware
This commit is contained in:
Diana Huang
2019-10-30 14:46:14 -04:00
committed by GitHub
4 changed files with 99 additions and 8 deletions

View File

@@ -16,7 +16,14 @@ const wrapperRendered = setInterval(() => {
component: StudentAccountDeletion,
selector: `#${accountDeletionWrapperId}`,
componentName: 'StudentAccountDeletion',
props: { socialAccountLinks: window.auth, isActive: window.isActive },
props: {
socialAccountLinks: window.auth,
isActive: window.isActive,
additionalSiteSpecificDeletionText: window.additionalSiteSpecificDeletionText,
mktgRootLink: window.mktgRootLink,
platformName: window.platformName,
siteName: window.siteName
},
});
}

View File

@@ -73,18 +73,45 @@ 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: '<strong>',
strongEnd: '</strong>',
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,
},
);
const bodyDeletion2 = StringUtils.interpolate(
gettext('This includes access to {siteName} from your employers or universitys system{additionalSiteSpecificDeletionText}.'),
{
siteName: this.props.siteName,
additionalSiteSpecificDeletionText: this.props.additionalSiteSpecificDeletionText,
},
);
return (
<div className="account-deletion-details">
<p className="account-settings-header-subtitle">{ gettext('Were sorry to see you go!') }</p>
<p className="account-settings-header-subtitle">{ 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.') }</p>
<p className="account-settings-header-subtitle">{ 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 employers or universitys system and access to private sites offered by MIT Open Learning, Wharton Executive Education, and Harvard Medical School.') }</p>
<p className="account-settings-header-subtitle">{noteDeletion}</p>
<p className="account-settings-header-subtitle">
<span>{bodyDeletion} </span>
<span>{bodyDeletion2}</span>
</p>
<p
className="account-settings-header-subtitle"
dangerouslySetInnerHTML={{ __html: loseAccessText }}
@@ -125,7 +152,13 @@ export class StudentAccountDeletion extends React.Component {
open
/>
}
{deletionModalOpen && <StudentAccountDeletionModal onClose={this.closeDeletionModal} />}
{deletionModalOpen && <StudentAccountDeletionModal
onClose={this.closeDeletionModal}
additionalSiteSpecificDeletionText={this.props.additionalSiteSpecificDeletionText}
mktgRootLink={this.props.mktgRootLink}
platformName={this.props.platformName}
siteName={this.props.siteName}
/>}
</div>
);
}
@@ -136,4 +169,15 @@ StudentAccountDeletion.propTypes = {
socialAccountLinks: PropTypes.shape({
providers: PropTypes.arrayOf(PropTypes.object),
}).isRequired,
additionalSiteSpecificDeletionText: PropTypes.string,
mktgRootLink: PropTypes.string,
platformName: PropTypes.string,
siteName: PropTypes.string,
};
StudentAccountDeletion.defaultProps = {
additionalSiteSpecificDeletionText: '',
mktgRootLink: '',
platformName: '',
siteName: '',
};

View File

@@ -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.mktgRootLink;
}
deleteAccount() {
@@ -101,6 +101,30 @@ 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,
},
);
const bodyDeletion2 = StringUtils.interpolate(
gettext('This includes access to {siteName} from your employers or universitys system{additionalSiteSpecificDeletionText}.'),
{
siteName: this.props.siteName,
additionalSiteSpecificDeletionText: this.props.additionalSiteSpecificDeletionText,
},
);
return (
<div className="delete-confirmation-wrapper">
<Modal
@@ -137,8 +161,11 @@ class StudentAccountDeletionConfirmationModal extends React.Component {
<Icon id="delete-confirmation-body-warning-icon" className={['fa', 'fa-exclamation-triangle']} />
</div>
<div className="alert-content">
<h3 className="alert-title">{ 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.') }</h3>
<p>{ 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 employers or universitys system and access to private sites offered by MIT Open Learning, Wharton Executive Education, and Harvard Medical School.') }</p>
<h3 className="alert-title">{noteDeletion}</h3>
<p>
<span>{bodyDeletion} </span>
<span>{bodyDeletion2}</span>
</p>
<p dangerouslySetInnerHTML={{ __html: loseAccessText }} />
</div>
</div>
@@ -198,10 +225,18 @@ class StudentAccountDeletionConfirmationModal extends React.Component {
StudentAccountDeletionConfirmationModal.propTypes = {
onClose: PropTypes.func,
additionalSiteSpecificDeletionText: PropTypes.string,
mktgRootLink: PropTypes.string,
platformName: PropTypes.string,
siteName: PropTypes.string,
};
StudentAccountDeletionConfirmationModal.defaultProps = {
onClose: () => {},
additionalSiteSpecificDeletionText: "",
mktgRootLink: "",
platformName: "",
siteName: "",
};
export default StudentAccountDeletionConfirmationModal;

View File

@@ -77,6 +77,11 @@ from openedx.core.djangoapps.user_api.accounts.utils import is_secondary_email_f
<script type="text/javascript">
window.auth = ${ auth | n, dump_js_escaped_json };
window.isActive = ${ user.is_active | n, dump_js_escaped_json };
window.additionalSiteSpecificDeletionText = "${ static.get_value('SITE_SPECIFIC_DELETION_TEXT', _(' and access to private sites offered by MIT Open Learning, Wharton Executive Education, and Harvard Medical School')) | n, js_escaped_string }";
window.mktgRootLink = "${ static.marketing_link('ROOT') | n, js_escaped_string }";
window.platformName = "${ platform_name | n, js_escaped_string }";
window.siteName = "${ static.get_value('SITE_NAME', settings.SITE_NAME) | n, js_escaped_string }";
</script>
<%static:webpack entry="StudentAccountDeletionInitializer">
</%static:webpack>