From bab9347d0647ae51ad492eda502afb98ac7ba124 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 3 May 2018 09:53:13 -0600 Subject: [PATCH 1/4] adjusted copy --- .../client/components/AccountDeletionRequestedSign.js | 2 +- .../client/components/DeleteMyAccount.js | 1 + .../client/components/DeleteMyAccountDialog.js | 10 +++++++++- .../client/components/DeleteMyAccountFinalStep.js | 6 +++++- plugins/talk-plugin-profile-data/client/mutations.js | 3 ++- plugins/talk-plugin-profile-data/server/mutators.js | 6 +++--- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/plugins/talk-plugin-profile-data/client/components/AccountDeletionRequestedSign.js b/plugins/talk-plugin-profile-data/client/components/AccountDeletionRequestedSign.js index 7da172a31..31f65ffa7 100644 --- a/plugins/talk-plugin-profile-data/client/components/AccountDeletionRequestedSign.js +++ b/plugins/talk-plugin-profile-data/client/components/AccountDeletionRequestedSign.js @@ -27,7 +27,7 @@ class AccountDeletionRequestedSign extends React.Component { 'MMM Do YYYY, h:mm:ss a' ); const deletionScheduledOn = moment(scheduledDeletionDate) - .subtract(12, 'hours') + .subtract(24, 'hours') .format('MMM Do YYYY, h:mm:ss a'); return ( diff --git a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js index 9bc5573a1..982437de0 100644 --- a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js +++ b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js @@ -55,6 +55,7 @@ class DeleteMyAccount extends React.Component { requestAccountDeletion={this.requestAccountDeletion} showDialog={this.state.showDialog} closeDialog={this.closeDialog} + scheduledDeletionDate={scheduledDeletionDate} />

@@ -76,7 +78,12 @@ class DeleteMyAccountDialog extends React.Component { onChange={this.onChange} /> )} - {step === 4 && } + {step === 4 && ( + + )} ); } @@ -86,6 +93,7 @@ DeleteMyAccountDialog.propTypes = { showDialog: PropTypes.bool.isRequired, closeDialog: PropTypes.func.isRequired, requestAccountDeletion: PropTypes.func.isRequired, + scheduledDeletionDate: PropTypes.string, }; 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 4cda90347..d3604d1ae 100644 --- a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountFinalStep.js +++ b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountFinalStep.js @@ -3,6 +3,7 @@ import cn from 'classnames'; import PropTypes from 'prop-types'; import { Button, Icon } from 'plugin-api/beta/client/components/ui'; import styles from './DeleteMyAccountStep.css'; +import moment from 'moment'; const DeleteMyAccountFinalStep = props => (
@@ -17,7 +18,9 @@ const DeleteMyAccountFinalStep = props => ( - Account Deletion Date and Time + + {moment(props.scheduledDeletionDate).format('MMM Do YYYY, h:mm:ss a')} +
@@ -45,6 +48,7 @@ const DeleteMyAccountFinalStep = props => ( DeleteMyAccountFinalStep.propTypes = { finish: PropTypes.func.isRequired, + scheduledDeletionDate: PropTypes.string.isRequired, }; export default DeleteMyAccountFinalStep; diff --git a/plugins/talk-plugin-profile-data/client/mutations.js b/plugins/talk-plugin-profile-data/client/mutations.js index 3ae0d88f7..d2a8881b8 100644 --- a/plugins/talk-plugin-profile-data/client/mutations.js +++ b/plugins/talk-plugin-profile-data/client/mutations.js @@ -32,6 +32,7 @@ export const withRequestAccountDeletion = withMutation( return mutate({ variables: {}, update: proxy => { + debugger; const RequestAccountDeletionQuery = gql` query Talk_CancelAccountDeletion { me { @@ -46,7 +47,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/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. From 0caa82c1c4ba14783808fc8a5741803f0da3048b Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Thu, 3 May 2018 11:59:27 -0400 Subject: [PATCH 2/4] Typo --- .../client/components/DeleteMyAccountFinalStep.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountFinalStep.js b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountFinalStep.js index d3604d1ae..ebf7200b6 100644 --- a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountFinalStep.js +++ b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountFinalStep.js @@ -30,8 +30,8 @@ const DeleteMyAccountFinalStep = props => (

- Tell us why. Wed like to know why you chose to delete - your account. Send us feedback on our comment system by emailing. + Tell us why. We would like to know why you chose to + delete your account. Send us feedback on our comment system by emailing.

From 6485b1f080e4c0b81d05ddf5c9ed1e9df000c262 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 3 May 2018 10:02:33 -0600 Subject: [PATCH 3/4] added email to final step --- .../src/routes/Configure/components/OrganizationSettings.js | 2 +- .../client/components/DeleteMyAccount.js | 6 +++++- .../client/components/DeleteMyAccountDialog.js | 4 +++- .../client/components/DeleteMyAccountFinalStep.js | 6 +++++- .../client/containers/DeleteMyAccount.js | 3 +++ plugins/talk-plugin-profile-data/client/mutations.js | 1 - 6 files changed, 17 insertions(+), 5 deletions(-) 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/DeleteMyAccount.js b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js index 982437de0..dc95c4b9e 100644 --- a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js +++ b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js @@ -48,7 +48,10 @@ class DeleteMyAccount extends React.Component { }; render() { - const { me: { scheduledDeletionDate } } = this.props.root; + const { + me: { scheduledDeletionDate }, + settings: { organizationContactEmail }, + } = this.props.root; return (

@@ -81,6 +81,7 @@ class DeleteMyAccountDialog extends React.Component { {step === 4 && ( )} @@ -94,6 +95,7 @@ DeleteMyAccountDialog.propTypes = { closeDialog: PropTypes.func.isRequired, requestAccountDeletion: PropTypes.func.isRequired, scheduledDeletionDate: PropTypes.string, + 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 ebf7200b6..75a0b3aeb 100644 --- a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountFinalStep.js +++ b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccountFinalStep.js @@ -31,7 +31,10 @@ const DeleteMyAccountFinalStep = props => (

Tell us why. We would like to know why you chose to - delete your account. Send us feedback on our comment system by emailing. + delete your account. Send us feedback on our comment system by emailing{' '} + + {props.organizationContactEmail} + .

@@ -49,6 +52,7 @@ const DeleteMyAccountFinalStep = props => ( DeleteMyAccountFinalStep.propTypes = { finish: PropTypes.func.isRequired, scheduledDeletionDate: PropTypes.string.isRequired, + organizationContactEmail: PropTypes.string.isRequired, }; export default DeleteMyAccountFinalStep; 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 d2a8881b8..c7ca68950 100644 --- a/plugins/talk-plugin-profile-data/client/mutations.js +++ b/plugins/talk-plugin-profile-data/client/mutations.js @@ -32,7 +32,6 @@ export const withRequestAccountDeletion = withMutation( return mutate({ variables: {}, update: proxy => { - debugger; const RequestAccountDeletionQuery = gql` query Talk_CancelAccountDeletion { me { From 375f1bb6b1ab2413977ee7bcd711705db39e509c Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 3 May 2018 10:07:27 -0600 Subject: [PATCH 4/4] copy fixes --- .../AccountDeletionRequestedSign.js | 4 +-- .../client/components/DeleteMyAccount.js | 26 +++++++++---------- .../components/DeleteMyAccountFinalStep.js | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/plugins/talk-plugin-profile-data/client/components/AccountDeletionRequestedSign.js b/plugins/talk-plugin-profile-data/client/components/AccountDeletionRequestedSign.js index 31f65ffa7..f1d85e4e6 100644 --- a/plugins/talk-plugin-profile-data/client/components/AccountDeletionRequestedSign.js +++ b/plugins/talk-plugin-profile-data/client/components/AccountDeletionRequestedSign.js @@ -24,11 +24,11 @@ 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(24, 'hours') - .format('MMM Do YYYY, h:mm:ss a'); + .format('MMM Do YYYY, h:mm a'); return (
diff --git a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js index dc95c4b9e..1c7c12d16 100644 --- a/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js +++ b/plugins/talk-plugin-profile-data/client/components/DeleteMyAccount.js @@ -78,19 +78,19 @@ class DeleteMyAccount extends React.Component { Deleting your account will permanently erase your profile and remove all your comments from this site.

-

- {scheduledDeletionDate && - `You have already submitted a request to delete your account. - Your account will be deleted on ${moment( - scheduledDeletionDate - ).format('MMM Do YYYY, h:mm:ss a')}. You may - cancel the request until that time`} -

+ {scheduledDeletionDate && ( +

+ You have already submitted a request to delete your account. Your + account will be deleted on{' '} + {moment(scheduledDeletionDate).format('MMM Do YYYY, h:mm a')}. You + may cancel the request until that time. +

+ )} {scheduledDeletionDate ? (