diff --git a/client/coral-admin/src/routes/Configure/components/OrganizationSettings.js b/client/coral-admin/src/routes/Configure/components/OrganizationSettings.js index f3daeffc2..3505ef7b5 100644 --- a/client/coral-admin/src/routes/Configure/components/OrganizationSettings.js +++ b/client/coral-admin/src/routes/Configure/components/OrganizationSettings.js @@ -57,7 +57,7 @@ class OrganizationSettings extends React.Component { } const updater = { organizationContactEmail: { $set: email } }; - const errorUpdater = { organizationEmail: { $set: error } }; + const errorUpdater = { organizationContactEmail: { $set: error } }; this.props.updatePending({ updater, errorUpdater }); }; diff --git a/plugins/talk-plugin-profile-data/client/components/AccountDeletionRequestedSign.js b/plugins/talk-plugin-profile-data/client/components/AccountDeletionRequestedSign.js index dd14bb4f4..60e4d4bc6 100644 --- a/plugins/talk-plugin-profile-data/client/components/AccountDeletionRequestedSign.js +++ b/plugins/talk-plugin-profile-data/client/components/AccountDeletionRequestedSign.js @@ -12,10 +12,7 @@ class AccountDeletionRequestedSign extends React.Component { const { cancelAccountDeletion, notify } = this.props; try { await cancelAccountDeletion(); - notify( - 'success', - t('talk-plugin-profile-data.delete_request.account_deletion_cancelled') - ); + notify('success', t('delete_request.account_deletion_cancelled')); } catch (err) { notify('error', getErrorMessages(err)); } @@ -25,32 +22,27 @@ class AccountDeletionRequestedSign extends React.Component { const { me: { scheduledDeletionDate } } = this.props.root; const deletionScheduledFor = moment(scheduledDeletionDate).format( - 'MMM Do YYYY, h:mm:ss a' + 'MMM Do YYYY, h:mm a' ); const deletionScheduledOn = moment(scheduledDeletionDate) - .subtract(12, 'hours') - .format('MMM Do YYYY, h:mm:ss a'); + .subtract(24, 'hours') + .format('MMM Do YYYY, h:mm a'); return (

{' '} - {t( - 'talk-plugin-profile-data.delete_request.account_deletion_requested' - )} + {t('delete_request.account_deletion_requested')}

- {t('talk-plugin-profile-data.delete_request.received_on')} + {t('delete_request.received_on')} {deletionScheduledFor}.

- {t( - 'talk-plugin-profile-data.delete_request.cancel_request_description' - )} + {t('delete_request.cancel_request_description')} {' '} - {t('talk-plugin-profile-data.delete_request.before')}{' '} - {deletionScheduledOn} + {t('delete_request.before')} {deletionScheduledOn} .

@@ -58,9 +50,7 @@ class AccountDeletionRequestedSign extends React.Component { className={cn(styles.button, styles.secondary)} onClick={this.cancelAccountDeletion} > - {t( - 'talk-plugin-profile-data.delete_request.cancel_account_deletion_request' - )} + {t('delete_request.cancel_account_deletion_request')}
diff --git a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js index 28ead86de..bbaca5b96 100644 --- a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js +++ b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js @@ -29,10 +29,7 @@ class DeleteMyAccount extends React.Component { const { cancelAccountDeletion, notify } = this.props; try { await cancelAccountDeletion(); - notify( - 'success', - t('talk-plugin-profile-data.delete_request.account_deletion_requested') - ); + notify('success', t('delete_request.account_deletion_requested')); } catch (err) { notify('error', getErrorMessages(err)); } @@ -42,23 +39,25 @@ class DeleteMyAccount extends React.Component { const { requestAccountDeletion, notify } = this.props; try { await requestAccountDeletion(); - notify( - 'success', - t('talk-plugin-profile-data.delete_request.account_deletion_requested') - ); + notify('success', t('delete_request.account_deletion_requested')); } catch (err) { notify('error', getErrorMessages(err)); } }; render() { - const { me: { scheduledDeletionDate } } = this.props.root; + const { + me: { scheduledDeletionDate }, + settings: { organizationContactEmail }, + } = this.props.root; return (

- {t('talk-plugin-profile-data.delete_request.delete_my_account')} + {t('delete_request.delete_my_account')}

- {t( - 'talk-plugin-profile-data.delete_request.delete_my_account_description' - )} + {t('delete_request.delete_my_account_description')}

{scheduledDeletionDate && t( - 'talk-plugin-profile-data.delete_request.already_submitted_request_description', + 'delete_request.already_submitted_request_description', moment(scheduledDeletionDate).format('MMM Do YYYY, h:mm:ss a') )}

@@ -95,9 +92,7 @@ class DeleteMyAccount extends React.Component { className={cn(styles.button, styles.secondary)} onClick={this.cancelAccountDeletion} > - {t( - 'talk-plugin-profile-data.delete_request.cancel_account_deletion_request' - )} + {t('delete_request.cancel_account_deletion_request')} ) : ( )}
diff --git a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountDialog.js b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountDialog.js index f6ab9c2ce..9264bb75c 100644 --- a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountDialog.js +++ b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountDialog.js @@ -43,13 +43,15 @@ class DeleteMyAccountDialog extends React.Component { render() { const { step } = this.state; + const { scheduledDeletionDate, organizationContactEmail } = this.props; + return ( ×

- {t('talk-plugin-profile-data.delete_request.delete_my_account')} + {t('delete_request.delete_my_account')}

{step === 0 && ( @@ -79,7 +81,13 @@ class DeleteMyAccountDialog extends React.Component { onChange={this.onChange} /> )} - {step === 4 && } + {step === 4 && ( + + )}
); } @@ -89,6 +97,8 @@ DeleteMyAccountDialog.propTypes = { showDialog: PropTypes.bool.isRequired, closeDialog: PropTypes.func.isRequired, requestAccountDeletion: PropTypes.func.isRequired, + scheduledDeletionDate: PropTypes.any.isRequired, + organizationContactEmail: PropTypes.string.isRequired, }; export default DeleteMyAccountDialog; diff --git a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountFinalStep.js b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountFinalStep.js index 22d20167d..6e0941d13 100644 --- a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountFinalStep.js +++ b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountFinalStep.js @@ -4,44 +4,39 @@ import PropTypes from 'prop-types'; import { Button, Icon } from 'plugin-api/beta/client/components/ui'; import styles from './DeleteMyAccountStep.css'; import { t } from 'plugin-api/beta/client/services'; +import moment from 'moment'; const DeleteMyAccountFinalStep = props => (

- {t( - 'talk-plugin-profile-data.delete_request.your_request_submitted_description' - )} + {t('delete_request.your_request_submitted_description')}

- {t( - 'talk-plugin-profile-data.delete_request.your_account_deletion_scheduled' - )} + {t('delete_request.your_account_deletion_scheduled')} - {0} + + {moment(props.scheduledDeletionDate).format('MMM Do YYYY, h:mm a')} +

- - {' '} - {t('talk-plugin-profile-data.delete_request.changed_your_mind')} - {' '} - {t('talk-plugin-profile-data.delete_request.simply_go_to')} “ - {t( - 'talk-plugin-profile-data.delete_request.cancel_account_deletion_request' - )}. + {t('delete_request.changed_your_mind')}{' '} + {t('delete_request.simply_go_to')} “ + {t('delete_request.cancel_account_deletion_request')}.

- - {t('talk-plugin-profile-data.delete_request.tell_us_why')}. - {' '} - {t('talk-plugin-profile-data.delete_request.feedback_copy')} + {t('delete_request.tell_us_why')}.{' '} + {t('delete_request.feedback_copy')} + + {props.organizationContactEmail} + .

@@ -50,7 +45,7 @@ const DeleteMyAccountFinalStep = props => ( onClick={props.finish} full > - {t('talk-plugin-profile-data.delete_request.done')} + {t('delete_request.done')}
@@ -58,6 +53,8 @@ const DeleteMyAccountFinalStep = props => ( DeleteMyAccountFinalStep.propTypes = { finish: PropTypes.func.isRequired, + scheduledDeletionDate: PropTypes.any.isRequired, + organizationContactEmail: PropTypes.string.isRequired, }; export default DeleteMyAccountFinalStep; diff --git a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep0.js b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep0.js index 468c96e94..42cb3d5a3 100644 --- a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep0.js +++ b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep0.js @@ -8,26 +8,20 @@ import { t } from 'plugin-api/beta/client/services'; const DeleteMyAccountStep0 = props => (

- {t('talk-plugin-profile-data.delete_request.you_are_attempting')} + {t('delete_request.step_0.you_are_attempting')}

@@ -35,13 +29,13 @@ const DeleteMyAccountStep0 = props => ( className={cn(styles.button, styles.cancel)} onClick={props.cancel} > - {t('talk-plugin-profile-data.delete_request.cancel')} + {t('delete_request.cancel')}
diff --git a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep1.js b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep1.js index 7408df688..dc137e41e 100644 --- a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep1.js +++ b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep1.js @@ -7,30 +7,26 @@ import { t } from 'plugin-api/beta/client/services'; const DeleteMyAccountStep1 = props => (
-

- {t('talk-plugin-profile-data.delete_request.step1.subtitle')} -

+

{t('delete_request.step_1.subtitle')}

- {t('talk-plugin-profile-data.delete_request.step1.description')} + {t('delete_request.step_1.description')}

-

- {t('talk-plugin-profile-data.delete_request.step1.subtitle_2')} -

+

{t('delete_request.step_1.subtitle_2')}

- {t('talk-plugin-profile-data.delete_request.step1.description_2')} + {t('delete_request.step_1.description_2')}

diff --git a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep2.js b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep2.js index 8976c7dcd..c96405f52 100644 --- a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep2.js +++ b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep2.js @@ -8,12 +8,12 @@ import { t } from 'plugin-api/beta/client/services'; const DeleteMyAccountStep2 = props => (

- {t('talk-plugin-profile-data.delete_request.step2.description')} + {t('delete_request.step_2.description')}

- {t('talk-plugin-profile-data.delete_request.step2.to_download')} + {t('delete_request.step_2.to_download')} - {t('talk-plugin-profile-data.delete_request.step2.path')} + {t('delete_request.step_2.path')}

@@ -21,13 +21,13 @@ const DeleteMyAccountStep2 = props => ( className={cn(styles.button, styles.cancel)} onClick={props.cancel} > - {t('talk-plugin-profile-data.delete_request.step2.cancel')} + {t('delete_request.cancel')}
diff --git a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep3.js b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep3.js index dfbe9bf1f..31ed5c1b1 100644 --- a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep3.js +++ b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountStep3.js @@ -43,10 +43,10 @@ class DeleteMyAccountStep3 extends React.Component { return (

- {t('talk-plugin-profile-data.delete_request.step3.subtitle')} + {t('delete_request.step_3.subtitle')}

- {t('talk-plugin-profile-data.delete_request.step3.description')} + {t('delete_request.step_3.description')}

@@ -75,13 +71,13 @@ class DeleteMyAccountStep3 extends React.Component { className={cn(styles.button, styles.cancel)} onClick={this.props.cancel} > - {t('talk-plugin-profile-data.delete_request.cancel')} + {t('delete_request.cancel')}
diff --git a/plugins/talk-plugin-profile-data/client/containers/DeleteMyAccount.js b/plugins/talk-plugin-profile-data/client/containers/DeleteMyAccount.js index 84d0b9a5c..0a81107f5 100644 --- a/plugins/talk-plugin-profile-data/client/containers/DeleteMyAccount.js +++ b/plugins/talk-plugin-profile-data/client/containers/DeleteMyAccount.js @@ -16,6 +16,9 @@ const withData = withFragments({ me { scheduledDeletionDate } + settings { + organizationContactEmail + } } `, }); diff --git a/plugins/talk-plugin-profile-data/client/mutations.js b/plugins/talk-plugin-profile-data/client/mutations.js index 3ae0d88f7..c7ca68950 100644 --- a/plugins/talk-plugin-profile-data/client/mutations.js +++ b/plugins/talk-plugin-profile-data/client/mutations.js @@ -46,7 +46,7 @@ export const withRequestAccountDeletion = withMutation( }); const scheduledDeletionDate = moment() - .add(12, 'hours') + .add(24, 'hours') .toDate(); const data = update(prev, { diff --git a/plugins/talk-plugin-profile-data/client/translations.yml b/plugins/talk-plugin-profile-data/client/translations.yml index 839154446..2a0c9e334 100644 --- a/plugins/talk-plugin-profile-data/client/translations.yml +++ b/plugins/talk-plugin-profile-data/client/translations.yml @@ -26,25 +26,26 @@ en: changed_your_mind: "Changed your mind?" simply_go_to: "Simply go to your account again before this time and click" tell_us_why: "Tell us why" - feedback_copy: "We'd like to know why you chose to delete your account. Send us feedback on our comment system by emailing." + feedback_copy: "We would like to know why you chose to delete your account. Send us feedback on our comment system by emailing" done: "Done" cancel: "Cancel" proceed: "Proceed" input_is_not_correct: "The input is not correct" - you_are_attempting: "You are attempting to delete your account. This means:" - item_1: "All of your comments are removed from this site" - item_2: "All of your comments are deleted from our database" - item_3: "Your username and email address are removed from our system" - step1: + step_0: + you_are_attempting: "You are attempting to delete your account. This means:" + item_1: "All of your comments are removed from this site" + item_2: "All of your comments are deleted from our database" + item_3: "Your username and email address are removed from our system" + step_1: subtitle: "When will my account be deleted?" description: "Your account will be deleted 24 hours after your request has been submitted." subtitle_2: "Can I still write comments until my account is deleted?" description_2: "No. Once you have requested account deletion, you can no longer write comments, reply to comments, or select reactions." - step2: + step_2: description: "Before your account is deleted, we recommend you download your comment history for your records. After your account is deleted, you will be unable to request your comment history." to_download: "To download your comment history go to:" path: "My Profile > Download My Comment History" - step3: + step_3: subtitle: "Are you sure you want to delete your account?" description: "To confirm you would like to delete your account please type in the following phrase into the text box below:" type_to_confirm: "Type phrase below to confirm" diff --git a/plugins/talk-plugin-profile-data/server/mutators.js b/plugins/talk-plugin-profile-data/server/mutators.js index d3785c951..c895e51d8 100644 --- a/plugins/talk-plugin-profile-data/server/mutators.js +++ b/plugins/talk-plugin-profile-data/server/mutators.js @@ -93,16 +93,16 @@ async function sendDownloadLink(ctx) { } // requestDeletion will schedule the current user to have their account deleted -// by setting the `scheduledDeletionDate` on the user 12 hours from now. +// by setting the `scheduledDeletionDate` on the user 24 hours from now. async function requestDeletion({ user, connectors: { models: { User } } }) { // Ensure the user doesn't already have a deletion scheduled. if (get(user, 'metadata.scheduledDeletionDate')) { throw new ErrDeletionAlreadyScheduled(); } - // Get the date in the future 12 hours from now. + // Get the date in the future 24 hours from now. const scheduledDeletionDate = moment() - .add(12, 'hours') + .add(24, 'hours') .toDate(); // Amend the scheduledDeletionDate on the user.