From b7428a2fa6ff5799e6e55f6568fd743c82f5930c Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Thu, 7 Nov 2019 15:08:01 +0300 Subject: [PATCH] web: People: Fixed delete profile and self delete profile actions at profile view page --- .../pages/Profile/Section/Header/index.js | 79 ++++++++++++++++--- 1 file changed, 68 insertions(+), 11 deletions(-) diff --git a/products/ASC.People/Client/src/components/pages/Profile/Section/Header/index.js b/products/ASC.People/Client/src/components/pages/Profile/Section/Header/index.js index 1b8ab36e3a..e2656dae8b 100644 --- a/products/ASC.People/Client/src/components/pages/Profile/Section/Header/index.js +++ b/products/ASC.People/Client/src/components/pages/Profile/Section/Header/index.js @@ -18,7 +18,7 @@ import { getUserStatus, toEmployeeWrapper } from "../../../../../store/people/se import { withTranslation } from 'react-i18next'; import { resendUserInvites } from "../../../../../store/services/api"; import { EmployeeStatus } from "../../../../../helpers/constants"; -import { updateUserStatus } from "../../../../../store/people/actions"; +import { updateUserStatus, fetchPeople } from "../../../../../store/people/actions"; import { fetchProfile } from '../../../../../store/profile/actions'; import { sendInstructionsToDelete, @@ -26,7 +26,8 @@ import { sendInstructionsToChangeEmail, createThumbnailsAvatar, loadAvatar, - deleteAvatar + deleteAvatar, + deleteUser } from "../../../../../store/services/api"; import styled from 'styled-components'; @@ -269,8 +270,66 @@ class SectionHeaderContent extends React.PureComponent { toastr.success("Context action: Delete personal data"); } - onDeleteProfileClick = () => { - toastr.success("Context action: Delete profile"); + onDeleteProfileClick = user => { + this.setState({ + dialog: { + visible: true, + header: "Confirmation", + body: ( + <> + + User {user.displayName} will be deleted. + + Note: this action cannot be undone. + + Warning! + + + User personal documents which are available to others will be + deleted. To avoid this, you must start the data reassign process + before deleting. + + + ), + buttons: [ +