From 5c806174bb06c7878b6208ccfd4678a3f3144328 Mon Sep 17 00:00:00 2001 From: okbel Date: Tue, 1 May 2018 15:51:56 -0300 Subject: [PATCH] Adding withRequestAccountDeletion, withRequestDownloadLink, withCancelAccountDeletion --- plugin-api/beta/client/hocs/index.js | 3 ++ plugins/talk-plugin-auth/client/index.js | 2 +- .../components/DeleteMyAccount.js | 13 ++++++++- .../containers/DeleteMyAccount.js | 28 +++++++++++++++++++ 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 plugins/talk-plugin-auth/client/profile-settings/containers/DeleteMyAccount.js diff --git a/plugin-api/beta/client/hocs/index.js b/plugin-api/beta/client/hocs/index.js index 215641f32..da667bced 100644 --- a/plugin-api/beta/client/hocs/index.js +++ b/plugin-api/beta/client/hocs/index.js @@ -25,5 +25,8 @@ export { withUnbanUser, withStopIgnoringUser, withSetCommentStatus, + withRequestAccountDeletion, + withRequestDownloadLink, + withCancelAccountDeletion, } from 'coral-framework/graphql/mutations'; export { compose } from 'recompose'; diff --git a/plugins/talk-plugin-auth/client/index.js b/plugins/talk-plugin-auth/client/index.js index fd6843958..b432b05b2 100644 --- a/plugins/talk-plugin-auth/client/index.js +++ b/plugins/talk-plugin-auth/client/index.js @@ -4,7 +4,7 @@ import SetUsernameDialog from './stream/containers/SetUsernameDialog'; import translations from './translations.yml'; import Login from './login/containers/Main'; import reducer from './login/reducer'; -import DeleteMyAccount from './profile-settings/components/DeleteMyAccount'; +import DeleteMyAccount from './profile-settings/containers/DeleteMyAccount'; export default { reducer, 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 95b11ab49..5643ed0e8 100644 --- a/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccount.js +++ b/plugins/talk-plugin-auth/client/profile-settings/components/DeleteMyAccount.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import cn from 'classnames'; import styles from './DeleteMyAccount.css'; import { Button } from 'plugin-api/beta/client/components/ui'; @@ -24,7 +25,11 @@ class DeleteMyAccount extends React.Component { render() { return (
- +

bindActionCreators({ notify }, dispatch); + +const withData = withFragments({ + root: gql` + fragment TalkIgnoreUser_IgnoredUserSection_root on RootQuery { + me { + scheduledDeletionDate + } + } + `, +}); + +export default compose( + connect(null, mapDispatchToProps), + withRequestAccountDeletion, + withCancelAccountDeletion, + withData +)(DeleteMyAccount);