Skip to content

Commit

Permalink
Add Enhanced Token Detection to Security & Privacy Tab
Browse files Browse the repository at this point in the history
Signed-off-by: Akintayo A. Olusegun <[email protected]>
  • Loading branch information
segun committed Dec 1, 2022
1 parent 80e4a1f commit 66c2577
Show file tree
Hide file tree
Showing 11 changed files with 405 additions and 325 deletions.
3 changes: 2 additions & 1 deletion ui/components/app/whats-new-popup/whats-new-popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
BUILD_QUOTE_ROUTE,
ADVANCED_ROUTE,
EXPERIMENTAL_ROUTE,
SECURITY_ROUTE,
} from '../../../helpers/constants/routes';
import { TYPOGRAPHY } from '../../../helpers/constants/design-system';
import ZENDESK_URLS from '../../../helpers/constants/zendesk-url';
Expand Down Expand Up @@ -48,7 +49,7 @@ function getActionFunctionById(id, history) {
},
10: () => {
updateViewedNotifications({ 10: true });
history.push(`${ADVANCED_ROUTE}#token-description`);
history.push(`${SECURITY_ROUTE}#token-description`);
},
12: () => {
updateViewedNotifications({ 12: true });
Expand Down
14 changes: 7 additions & 7 deletions ui/helpers/constants/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@ export const SETTINGS_CONSTANTS = [
route: `${SECURITY_ROUTE}#metrametrics`,
icon: 'fa fa-lock',
},
{
tabMessage: (t) => t('securityAndPrivacy'),
sectionMessage: (t) => t('enhancedTokenDetection'),
descriptionMessage: (t) => t('enhancedTokenDetectionDescription'),
route: `${SECURITY_ROUTE}#token-description`,
icon: 'fas fa-sliders-h',
},
{
tabMessage: (t) => t('alerts'),
sectionMessage: (t) => t('alertSettingsUnconnectedAccount'),
Expand Down Expand Up @@ -299,13 +306,6 @@ export const SETTINGS_CONSTANTS = [
route: `${EXPERIMENTAL_ROUTE}#enable-advanced-gas`,
icon: 'fa fa-flask',
},
{
tabMessage: (t) => t('advanced'),
sectionMessage: (t) => t('enhancedTokenDetection'),
descriptionMessage: (t) => t('enhancedTokenDetectionDescription'),
route: `${ADVANCED_ROUTE}#token-description`,
icon: 'fas fa-sliders-h',
},
{
tabMessage: (t) => t('experimental'),
sectionMessage: (t) => t('enableOpenSeaAPI'),
Expand Down
4 changes: 2 additions & 2 deletions ui/helpers/utils/settings-search.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ describe('Settings Search Utils', () => {
});

it('should get good advanced section number', () => {
expect(getNumberOfSettingsInSection(t, t('advanced'))).toStrictEqual(15);
expect(getNumberOfSettingsInSection(t, t('advanced'))).toStrictEqual(14);
});

it('should get good contact section number', () => {
Expand All @@ -169,7 +169,7 @@ describe('Settings Search Utils', () => {
it('should get good security & privacy section number', () => {
expect(
getNumberOfSettingsInSection(t, t('securityAndPrivacy')),
).toStrictEqual(4);
).toStrictEqual(5);
});

it('should get good alerts section number', () => {
Expand Down
6 changes: 3 additions & 3 deletions ui/pages/import-token/import-token.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { tokenInfoGetter } from '../../helpers/utils/token-util';
import {
ADD_COLLECTIBLE_ROUTE,
CONFIRM_IMPORT_TOKEN_ROUTE,
ADVANCED_ROUTE,
SECURITY_ROUTE,
} from '../../helpers/constants/routes';
import TextField from '../../components/ui/text-field';
import PageContainer from '../../components/ui/page-container';
Expand Down Expand Up @@ -445,7 +445,7 @@ class ImportToken extends Component {
key="import-token-token-detection-announcement"
className="import-token__link"
onClick={() =>
history.push(`${ADVANCED_ROUTE}#token-description`)
history.push(`${SECURITY_ROUTE}#token-description`)
}
>
{t('inYourSettings')}
Expand Down Expand Up @@ -588,7 +588,7 @@ class ImportToken extends Component {
key="token-detection-announcement"
className="import-token__link"
onClick={() =>
history.push(`${ADVANCED_ROUTE}#token-description`)
history.push(`${SECURITY_ROUTE}#token-description`)
}
>
{t('enableFromSettings')}
Expand Down
Loading

0 comments on commit 66c2577

Please sign in to comment.