Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33228080
D14577.1768562243.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
12 KB
Referenced Files
None
Subscribers
None
D14577.1768562243.diff
View Options
diff --git a/lib/types/nav-types.js b/lib/types/nav-types.js
--- a/lib/types/nav-types.js
+++ b/lib/types/nav-types.js
@@ -27,15 +27,13 @@
| 'friend-list'
| 'block-list'
| 'keyservers'
- | 'build-info'
- | 'danger-zone';
+ | 'build-info';
export const webNavigationSettingsSectionValidator: TEnums = t.enums.of([
'account',
'friend-list',
'block-list',
'keyservers',
'build-info',
- 'danger-zone',
]);
export type WebNavigationChatMode = 'view' | 'create';
export const webNavigationChatModeValidator: TEnums = t.enums.of([
diff --git a/lib/utils/url-utils.js b/lib/utils/url-utils.js
--- a/lib/utils/url-utils.js
+++ b/lib/utils/url-utils.js
@@ -23,8 +23,7 @@
| 'friend-list'
| 'block-list'
| 'keyservers'
- | 'build-info'
- | 'danger-zone',
+ | 'build-info',
threadCreation?: boolean,
selectedUserList?: $ReadOnlyArray<string>,
inviteSecret?: string,
@@ -48,7 +47,6 @@
'block-list',
'keyservers',
'build-info',
- 'danger-zone',
]),
),
threadCreation: t.maybe(t.Boolean),
@@ -70,7 +68,6 @@
const blockListRegex = new RegExp('(/|^)settings/block-list(/|$)', 'i');
const keyserversRegex = new RegExp('(/|^)settings/keyservers(/|$)', 'i');
const buildInfoRegex = new RegExp('(/|^)settings/build-info(/|$)', 'i');
-const dangerZoneRegex = new RegExp('(/|^)settings/danger-zone(/|$)', 'i');
const threadPendingRegex = new RegExp(
`(/|^)thread/(${pendingThreadIDRegex})(/|$)`,
'i',
@@ -97,7 +94,6 @@
const blockListTest = blockListRegex.test(url);
const keyserversSettingsTest = keyserversRegex.test(url);
const buildInfoTest = buildInfoRegex.test(url);
- const dangerZoneTest = dangerZoneRegex.test(url);
const threadPendingMatches = threadPendingRegex.exec(url);
const threadCreateMatches = threadCreationRegex.exec(url);
const inviteLinkMatches = inviteLinkRegex.exec(url);
@@ -144,8 +140,6 @@
returnObj.settings = 'keyservers';
} else if (buildInfoTest) {
returnObj.settings = 'build-info';
- } else if (dangerZoneTest) {
- returnObj.settings = 'danger-zone';
} else if (qrCodeLoginMatches) {
returnObj.qrCode = true;
}
diff --git a/web/app.react.js b/web/app.react.js
--- a/web/app.react.js
+++ b/web/app.react.js
@@ -89,7 +89,6 @@
import history from './router-history.js';
import { MessageSearchStateProvider } from './search/message-search-state-provider.react.js';
import AccountSettings from './settings/account-settings.react.js';
-import DangerZone from './settings/danger-zone.react.js';
import KeyserverSelectionList from './settings/keyserver-selection-list.react.js';
import { getCommSharedWorker } from './shared-worker/shared-worker-provider.js';
import CommunityPicker from './sidebar/community-picker.react.js';
@@ -366,8 +365,6 @@
mainContent = <KeyserverSelectionList />;
} else if (settingsSection === 'build-info') {
mainContent = null;
- } else if (settingsSection === 'danger-zone') {
- mainContent = <DangerZone />;
}
return (
<div className={css['main-content-container']}>
diff --git a/web/navigation-panels/settings-switcher.react.js b/web/navigation-panels/settings-switcher.react.js
--- a/web/navigation-panels/settings-switcher.react.js
+++ b/web/navigation-panels/settings-switcher.react.js
@@ -3,7 +3,6 @@
import * as React from 'react';
import { useDispatch } from 'lib/utils/redux-utils.js';
-import { usingCommServicesAccessToken } from 'lib/utils/services-utils.js';
import NavigationPanel from './navigation-panel.react.js';
import css from './settings-switcher.css';
@@ -57,31 +56,6 @@
);
}, [onClickKeyservers, staffCanSee]);
- const onClickDangerZone = React.useCallback(
- (event: SyntheticEvent<HTMLAnchorElement>) => {
- event.preventDefault();
- dispatch({
- type: updateNavInfoActionType,
- payload: { tab: 'settings', settingsSection: 'danger-zone' },
- });
- },
- [dispatch],
- );
- const dangerZoneNavigationItem = React.useMemo(() => {
- // Once we're using the identity service for auth, a user may only delete
- // their Comm account using their primary device. Their primary device
- // cannot be a web device at this time, so we hide the Danger Zone from web
- // users.
- if (usingCommServicesAccessToken) {
- return null;
- }
- return (
- <a className={css.navigationPanelTab} onClick={onClickDangerZone}>
- <p>Danger Zone</p>
- </a>
- );
- }, [onClickDangerZone]);
-
return (
<NavigationPanel.Container tabSelector={navSettingsSectionSelector}>
<NavigationPanel.Item tab="account">
@@ -90,9 +64,6 @@
<NavigationPanel.Item tab="keyservers">
{keyserversNavigationItem}
</NavigationPanel.Item>
- <NavigationPanel.Item tab="danger-zone">
- {dangerZoneNavigationItem}
- </NavigationPanel.Item>
</NavigationPanel.Container>
);
}
diff --git a/web/settings/account-delete-modal.css b/web/settings/account-delete-modal.css
deleted file mode 100644
--- a/web/settings/account-delete-modal.css
+++ /dev/null
@@ -1,29 +0,0 @@
-.modalBody {
- color: var(--fg);
-}
-.modalBody p {
- font-size: var(--s-font-14);
-}
-
-.deletionWarning {
- font-weight: var(--bold);
-}
-
-.formError {
- font-size: var(--xs-font-12);
- color: var(--error);
- font-style: italic;
- height: 24px;
- display: flex;
- justify-content: center;
- align-items: flex-end;
-}
-
-.errorPlaceholder {
- height: 24px;
-}
-
-.infoContainer {
- display: flex;
- column-gap: 8px;
-}
diff --git a/web/settings/account-delete-modal.react.js b/web/settings/account-delete-modal.react.js
deleted file mode 100644
--- a/web/settings/account-delete-modal.react.js
+++ /dev/null
@@ -1,105 +0,0 @@
-// @flow
-
-import * as React from 'react';
-
-import {
- useDeleteAccount,
- deleteAccountActionTypes,
-} from 'lib/actions/user-actions.js';
-import { useModalContext } from 'lib/components/modal-provider.react.js';
-import SWMansionIcon from 'lib/components/swmansion-icon.react.js';
-import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js';
-import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js';
-
-import css from './account-delete-modal.css';
-import Button, { buttonThemes } from '../components/button.react.js';
-import Modal from '../modals/modal.react.js';
-import { useSelector } from '../redux/redux-utils.js';
-
-const deleteAccountLoadingStatusSelector = createLoadingStatusSelector(
- deleteAccountActionTypes,
-);
-
-const AccountDeleteModal: React.ComponentType<{}> = React.memo<{}>(
- function AccountDeleteModal(): React.Node {
- const inputDisabled = useSelector(
- state => deleteAccountLoadingStatusSelector(state) === 'loading',
- );
-
- const callDeleteAccount = useDeleteAccount();
- const dispatchActionPromise = useDispatchActionPromise();
- const { popModal } = useModalContext();
-
- const [errorMessage, setErrorMessage] = React.useState('');
- let error;
- if (errorMessage) {
- error = (
- <div className={css.formError}>
- <p>{errorMessage}</p>
- </div>
- );
- }
-
- const deleteAccountAction = React.useCallback(async () => {
- try {
- setErrorMessage('');
- const response = await callDeleteAccount();
- popModal();
- return response;
- } catch (e) {
- setErrorMessage('unknown error deleting account');
- throw e;
- }
- }, [callDeleteAccount, popModal]);
-
- const onDelete = React.useCallback(
- (event: SyntheticEvent<HTMLButtonElement>) => {
- event.preventDefault();
- void dispatchActionPromise(
- deleteAccountActionTypes,
- deleteAccountAction(),
- );
- },
- [deleteAccountAction, dispatchActionPromise],
- );
-
- const primaryButton = React.useMemo(
- () => (
- <Button
- variant="filled"
- buttonColor={buttonThemes.danger}
- type="submit"
- onClick={onDelete}
- disabled={inputDisabled}
- >
- Delete Account
- </Button>
- ),
- [inputDisabled, onDelete],
- );
-
- return (
- <Modal
- name="Delete Account"
- onClose={popModal}
- size="large"
- primaryButton={primaryButton}
- >
- <div className={css.modalBody}>
- <form method="POST">
- <div className={css.infoContainer}>
- <SWMansionIcon icon="warning-circle" size={22} />
- <p className={css.deletionWarning}>
- Your account will be permanently deleted. There is no way to
- reverse this.
- </p>
- </div>
- {error}
- </form>
- </div>
- </Modal>
- );
- },
-);
-
-export default AccountDeleteModal;
diff --git a/web/settings/danger-zone.css b/web/settings/danger-zone.css
deleted file mode 100644
--- a/web/settings/danger-zone.css
+++ /dev/null
@@ -1,33 +0,0 @@
-.container {
- flex: 1;
- background-color: var(--frame-background-primary-default);
-}
-
-.contentContainer {
- padding: 40px;
- width: 343px;
-}
-
-.header {
- color: var(--text-background-primary-default);
- font-weight: var(--semi-bold);
- line-height: var(--line-height-display);
- padding-bottom: 40px;
-}
-
-.subheading {
- color: var(--text-background-secondary-default);
- font-size: var(--xl-font-20);
- font-weight: var(--semi-bold);
- line-height: var(--line-height-display);
- padding-bottom: 40px;
-}
-
-.button {
- width: 100%;
-}
-
-.explanation {
- padding-top: 8px;
- color: var(--text-background-tertiary-default);
-}
diff --git a/web/settings/danger-zone.react.js b/web/settings/danger-zone.react.js
deleted file mode 100644
--- a/web/settings/danger-zone.react.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// @flow
-
-import * as React from 'react';
-
-import { useModalContext } from 'lib/components/modal-provider.react.js';
-import { usingCommServicesAccessToken } from 'lib/utils/services-utils.js';
-
-import AccountDeleteModal from './account-delete-modal.react.js';
-import css from './danger-zone.css';
-import Button, { buttonThemes } from '../components/button.react.js';
-
-function DangerZone(): React.Node {
- const { pushModal } = useModalContext();
- const onDeleteAccountClick = React.useCallback(
- () => pushModal(<AccountDeleteModal />),
- [pushModal],
- );
-
- // Once we're using the identity service for auth, a user may only delete
- // their Comm account using their primary device. Their primary device cannot
- // be a web device at this time, so we hide the Danger Zone from web users.
- if (usingCommServicesAccessToken) {
- return null;
- }
-
- return (
- <div className={css.container}>
- <div className={css.contentContainer}>
- <h4 className={css.header}>Danger Zone</h4>
- <h5 className={css.subheading}>Delete Account</h5>
- <Button
- onClick={onDeleteAccountClick}
- variant="filled"
- buttonColor={buttonThemes.danger}
- className={css.button}
- >
- Delete Account
- </Button>
- <p className={css.explanation}>
- Your account will be permanently deleted. There is no way to reverse
- this.
- </p>
- </div>
- </div>
- );
-}
-
-export default DangerZone;
diff --git a/web/settings/user-settings-list.react.js b/web/settings/user-settings-list.react.js
--- a/web/settings/user-settings-list.react.js
+++ b/web/settings/user-settings-list.react.js
@@ -51,13 +51,6 @@
});
}, [dispatch]);
- const onClickDangerZone = React.useCallback(() => {
- dispatch({
- type: updateNavInfoActionType,
- payload: { tab: 'settings', settingsSection: 'danger-zone' },
- });
- }, [dispatch]);
-
const keyserverSettingsListItem = React.useMemo(() => {
if (!staffCanSee) {
return null;
@@ -96,11 +89,6 @@
name="Build info"
onClick={onClickBuildInfo}
/>
- <UserSettingsListItem
- id="danger-zone"
- name="Danger zone"
- onClick={onClickDangerZone}
- />
</div>
),
[
@@ -108,7 +96,6 @@
onClickAccountSettings,
onClickBlockList,
onClickBuildInfo,
- onClickDangerZone,
onClickFriendList,
],
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 16, 11:17 AM (15 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5943794
Default Alt Text
D14577.1768562243.diff (12 KB)
Attached To
Mode
D14577: [web] Remove danger zone
Attached
Detach File
Event Timeline
Log In to Comment