diff --git a/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccount.js b/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccount.js
index 5643ed0e8..0fc06f326 100644
--- a/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccount.js
+++ b/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccount.js
@@ -4,6 +4,7 @@ import cn from 'classnames';
import styles from './DeleteMyAccount.css';
import { Button } from 'plugin-api/beta/client/components/ui';
import DeleteMyAccountDialog from './DeleteMyAccountDialog';
+import { getErrorMessages } from 'coral-framework/utils';
const initialState = { showDialog: false };
@@ -22,12 +23,35 @@ class DeleteMyAccount extends React.Component {
});
};
+ cancelAccountDeletion = async () => {
+ const { cancelAccountDeletion, notify } = this.props;
+ try {
+ await cancelAccountDeletion();
+ notify(
+ 'success',
+ 'Account Deletion Request Cancelled - Your request to delete your account has been cancelled. You may now write comments, reply to comments, and select reactions.'
+ );
+ } catch (err) {
+ notify('error', getErrorMessages(err));
+ }
+ };
+
+ requestAccountDeletion = async () => {
+ const { requestAccountDeletion, notify } = this.props;
+ try {
+ await requestAccountDeletion();
+ notify('success', 'Account Deletion Requested');
+ } catch (err) {
+ notify('error', getErrorMessages(err));
+ }
+ };
+
render() {
+ const { me: { scheduledDeletionDate } } = this.props.root;
return (
Your request has been submitted and confirmation has been sent to the
@@ -35,7 +36,7 @@ const DeleteMyAccountFinalStep = () => (
Done
@@ -47,4 +48,8 @@ const DeleteMyAccountFinalStep = () => (
);
+DeleteMyAccountFinalStep.propTypes = {
+ finish: PropTypes.func.isRequired,
+};
+
export default DeleteMyAccountFinalStep;
diff --git a/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep0.js b/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep0.js
index f81d912ea..901466d3b 100644
--- a/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep0.js
+++ b/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep0.js
@@ -1,4 +1,5 @@
import React from 'react';
+import PropTypes from 'prop-types';
import cn from 'classnames';
import { Button, Icon } from 'plugin-api/beta/client/components/ui';
import styles from './DeleteMyAccountStep.css';
@@ -29,7 +30,12 @@ const DeleteMyAccountStep0 = props => (
- Cancel
+
+ Cancel
+
(
);
+DeleteMyAccountStep0.propTypes = {
+ goToNextStep: PropTypes.func.isRequired,
+ cancel: PropTypes.func.isRequired,
+};
+
export default DeleteMyAccountStep0;
diff --git a/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep1.js b/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep1.js
index 1d26190bc..e74611b05 100644
--- a/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep1.js
+++ b/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep1.js
@@ -1,4 +1,5 @@
import React from 'react';
+import PropTypes from 'prop-types';
import cn from 'classnames';
import { Button } from 'plugin-api/beta/client/components/ui';
import styles from './DeleteMyAccountStep.css';
@@ -18,7 +19,12 @@ const DeleteMyAccountStep1 = props => (
comments, reply to comments, or select reactions.
- Cancel
+
+ Cancel
+
(
);
+DeleteMyAccountStep1.propTypes = {
+ goToNextStep: PropTypes.func.isRequired,
+ cancel: PropTypes.func.isRequired,
+};
+
export default DeleteMyAccountStep1;
diff --git a/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep2.js b/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep2.js
index 3337c0b94..8ef14445e 100644
--- a/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep2.js
+++ b/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep2.js
@@ -1,9 +1,10 @@
import React from 'react';
+import PropTypes from 'prop-types';
import cn from 'classnames';
import { Button } from 'plugin-api/beta/client/components/ui';
import styles from './DeleteMyAccountStep.css';
-const DeleteMyAccountStep1 = props => (
+const DeleteMyAccountStep2 = props => (
Before your account is deleted, we recommend you download your comment
@@ -17,7 +18,12 @@ const DeleteMyAccountStep1 = props => (
- Cancel
+
+ Cancel
+
(
);
-export default DeleteMyAccountStep1;
+DeleteMyAccountStep2.propTypes = {
+ goToNextStep: PropTypes.func.isRequired,
+ cancel: PropTypes.func.isRequired,
+};
+
+export default DeleteMyAccountStep2;
diff --git a/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep3.js b/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep3.js
index 8cff542c1..f91ca42c7 100644
--- a/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep3.js
+++ b/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccountStep3.js
@@ -1,9 +1,10 @@
import React from 'react';
+import PropTypes from 'prop-types';
import cn from 'classnames';
import { Button } from 'plugin-api/beta/client/components/ui';
import styles from './DeleteMyAccountStep.css';
-const DeleteMyAccountStep1 = props => (
+const DeleteMyAccountStep3 = props => (
Are you sure you want to delete your account?
@@ -19,7 +20,12 @@ const DeleteMyAccountStep1 = props => (
value="delete"
/>
- Cancel
+
+ Cancel
+
(
);
-export default DeleteMyAccountStep1;
+DeleteMyAccountStep3.propTypes = {
+ goToNextStep: PropTypes.func.isRequired,
+ cancel: PropTypes.func.isRequired,
+};
+
+export default DeleteMyAccountStep3;
diff --git a/plugins/talk-plugin-auth/client/profile-settings/containers/DeleteMyAccount.js b/plugins/talk-plugin-auth/client/profile-settings/containers/DeleteMyAccount.js
index b88780f1f..a9c033853 100644
--- a/plugins/talk-plugin-auth/client/profile-settings/containers/DeleteMyAccount.js
+++ b/plugins/talk-plugin-auth/client/profile-settings/containers/DeleteMyAccount.js
@@ -12,7 +12,7 @@ const mapDispatchToProps = dispatch => bindActionCreators({ notify }, dispatch);
const withData = withFragments({
root: gql`
- fragment TalkIgnoreUser_IgnoredUserSection_root on RootQuery {
+ fragment Talk_DeleteMyAccount_root on RootQuery {
me {
scheduledDeletionDate
}