-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow user account deletion (from OddBird). (#2031)
- Loading branch information
1 parent
d9612be
commit 6ca1de3
Showing
22 changed files
with
426 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 4.0.4 on 2022-06-07 13:40 | ||
|
||
import django.db.models.deletion | ||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("api", "0109_support_project_creation"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="scratchorg", | ||
name="owner", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import Button from '@salesforce/design-system-react/components/button'; | ||
import React, { useState } from 'react'; | ||
import { Trans, useTranslation } from 'react-i18next'; | ||
import { useSelector } from 'react-redux'; | ||
|
||
import { DeleteModal } from '@/js/components/utils'; | ||
import { User } from '@/js/store/user/reducer'; | ||
import { selectUserState } from '@/js/store/user/selectors'; | ||
import { OBJECT_TYPES } from '@/js/utils/constants'; | ||
import routes from '@/js/utils/routes'; | ||
|
||
const DeleteAccount = () => { | ||
const [deleteModalOpen, setDeleteModalOpen] = useState(false); | ||
const user = useSelector(selectUserState); | ||
const closeDeleteModal = () => { | ||
setDeleteModalOpen(false); | ||
}; | ||
const openDeleteModal = () => { | ||
setDeleteModalOpen(true); | ||
}; | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<div> | ||
<div className="slds-text-heading_large slds-m-bottom_small"> | ||
{t('Delete Account')} | ||
</div> | ||
<div className="slds-m-bottom_medium slds-text-body_regular"> | ||
<Trans i18nKey="deleteAccountChanges"> | ||
Your Dev Orgs will be deleted, and any unretrieved changes will be | ||
lost. This action cannot be undone. Deleting this account will not | ||
remove you as a Project collaborator on GitHub. | ||
</Trans> | ||
</div> | ||
<Button | ||
label={t('Delete Account')} | ||
variant="brand" | ||
onClick={openDeleteModal} | ||
/> | ||
<DeleteModal | ||
model={user as User} | ||
modelType={OBJECT_TYPES.USER} | ||
isOpen={deleteModalOpen} | ||
redirect={routes.login()} | ||
handleClose={closeDeleteModal} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DeleteAccount; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.