From 31c9f04c1567ddd5e9df59d5b59cb57a959b0b4f Mon Sep 17 00:00:00 2001 From: David Walsh Date: Thu, 5 Sep 2024 14:46:01 -0500 Subject: [PATCH] fix: Add Basic Functionality to Settings Search (#25185) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Adds "Basic Functionality" to the Settings search [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25185?quickstart=1) ## **Related issues** Fixes: https://github.com/MetaMask/metamask-extension/issues/25441 ## **Manual testing steps** 1. Go to Settings 2. Search the term "Basic" 3. See "Basic Functionality" and click it 4. End up on top of the Privacy tab ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Brian Bergeron --- ui/helpers/constants/settings.js | 40 +++++++++++-------- ui/helpers/utils/settings-search.test.js | 2 +- .../security-tab/security-tab.component.js | 34 ++++++++-------- 3 files changed, 42 insertions(+), 34 deletions(-) diff --git a/ui/helpers/constants/settings.js b/ui/helpers/constants/settings.js index 5a9c48b8bd6e..4ed6672ad4a7 100644 --- a/ui/helpers/constants/settings.js +++ b/ui/helpers/constants/settings.js @@ -144,6 +144,14 @@ const SETTINGS_CONSTANTS = [ iconName: IconName.Book, }, // securityAndPrivacy settingsRefs[0] + { + tabMessage: (t) => t('securityAndPrivacy'), + sectionMessage: (t) => t('basicConfigurationLabel'), + descriptionMessage: (t) => t('basicConfigurationDescription'), + route: `${SECURITY_ROUTE}#basic-functionality-toggle`, + icon: 'fa fa-lock', + }, + // securityAndPrivacy settingsRefs[1] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('revealSeedWords'), @@ -151,7 +159,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#reveal-secretrecovery`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[1] + // securityAndPrivacy settingsRefs[2] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('showIncomingTransactions'), @@ -159,7 +167,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#incoming-transaction`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[2] + // securityAndPrivacy settingsRefs[3] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('usePhishingDetection'), @@ -167,7 +175,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#phishing-detection`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[3] + // securityAndPrivacy settingsRefs[4] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('use4ByteResolution'), @@ -175,7 +183,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#decode-smart-contracts`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[4] + // securityAndPrivacy settingsRefs[5] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('participateInMetaMetrics'), @@ -183,7 +191,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#metametrics`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[5] + // securityAndPrivacy settingsRefs[6] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('networkProvider'), @@ -192,7 +200,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#network-provider`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[6] + // securityAndPrivacy settingsRefs[7] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('ipfsGateway'), @@ -200,7 +208,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#add-custom-ipfs-gateway`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[7] + // securityAndPrivacy settingsRefs[8] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('autoDetectTokens'), @@ -208,7 +216,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#auto-detect-tokens`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[8] + // securityAndPrivacy settingsRefs[9] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('useMultiAccountBalanceChecker'), @@ -217,7 +225,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#batch-account-balance-requests`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[9] + // securityAndPrivacy settingsRefs[10] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('currencyRateCheckToggle'), @@ -225,7 +233,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#price-checker`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[10] + // securityAndPrivacy settingsRefs[11] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('ensDomainsSettingTitle'), @@ -233,7 +241,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#ens-domains`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[11] + // securityAndPrivacy settingsRefs[12] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('displayNftMedia'), @@ -241,7 +249,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#display-nft-media`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[12] + // securityAndPrivacy settingsRefs[13] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('useNftDetection'), @@ -249,7 +257,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#autodetect-nfts`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[13] + // securityAndPrivacy settingsRefs[14] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('useSafeChainsListValidation'), @@ -257,7 +265,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#network-details-check`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[14] + // securityAndPrivacy settingsRefs[15] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('externalNameSourcesSetting'), @@ -265,7 +273,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#proposed-nicknames`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[15] + // securityAndPrivacy settingsRefs[16] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('securityAlerts'), @@ -273,7 +281,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#security-alerts`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[16] + // securityAndPrivacy settingsRefs[17] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('blockaid'), diff --git a/ui/helpers/utils/settings-search.test.js b/ui/helpers/utils/settings-search.test.js index 76640355b492..5cef1cd12321 100644 --- a/ui/helpers/utils/settings-search.test.js +++ b/ui/helpers/utils/settings-search.test.js @@ -170,7 +170,7 @@ describe('Settings Search Utils', () => { it('returns "Security & privacy" section count', () => { expect( getNumberOfSettingRoutesInTab(t, t('securityAndPrivacy')), - ).toStrictEqual(18); + ).toStrictEqual(19); }); it('returns "Alerts" section count', () => { diff --git a/ui/pages/settings/security-tab/security-tab.component.js b/ui/pages/settings/security-tab/security-tab.component.js index 15d198da3218..81759bd6392c 100644 --- a/ui/pages/settings/security-tab/security-tab.component.js +++ b/ui/pages/settings/security-tab/security-tab.component.js @@ -161,7 +161,7 @@ export default class SecurityTab extends PureComponent { return ( <>
{t('secretRecoveryPhrase')} @@ -211,14 +211,14 @@ export default class SecurityTab extends PureComponent { return ( <> -
+
{t('securityAlerts')}
@@ -660,7 +660,7 @@ export default class SecurityTab extends PureComponent { return ( {this.context.t('networkProvider')}