From b7a1c8c30204940976939f6f16890dc18368696a Mon Sep 17 00:00:00 2001 From: ryanml Date: Tue, 18 May 2021 15:00:34 -0700 Subject: [PATCH] Adding notification for updated seed phrase wording (#11131) * Adding notification for updated seed phrase wording * Updating e2e notification state * Always displaying image for swaps notification --- app/_locales/en/messages.json | 4 ++++ shared/notifications/index.js | 13 +++++++++++++ test/e2e/fixtures/address-entry/state.json | 4 ++-- test/e2e/fixtures/connected-state/state.json | 4 ++-- test/e2e/fixtures/custom-rpc/state.json | 4 ++-- test/e2e/fixtures/import-ui/state.json | 4 ++-- test/e2e/fixtures/imported-account/state.json | 4 ++-- test/e2e/fixtures/localization/state.json | 4 ++-- test/e2e/fixtures/metrics-enabled/state.json | 4 ++-- test/e2e/fixtures/send-edit/state.json | 4 ++-- test/e2e/fixtures/threebox-enabled/state.json | 4 ++-- .../app/whats-new-popup/whats-new-popup.js | 9 ++++++++- ui/selectors/selectors.js | 1 + 13 files changed, 44 insertions(+), 19 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 36f1930cd..0a95ed9ca 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1288,6 +1288,10 @@ "message": "Swap on Binance Smart Chain", "description": "Title for a notification in the 'See What's New' popup. Encourages users to do swaps on Binance Smart Chain." }, + "notifications5Description": { + "message": "Your \"Seed Phrase\" is now called your \"Secret Recovery Phrase.\"", + "description": "Description of a notification in the 'See What's New' popup. Describes the seed phrase wording update." + }, "ofTextNofM": { "message": "of" }, diff --git a/shared/notifications/index.js b/shared/notifications/index.js index eb5f67e1a..ee5aabbe5 100644 --- a/shared/notifications/index.js +++ b/shared/notifications/index.js @@ -22,6 +22,10 @@ export const UI_NOTIFICATIONS = { width: '100%', }, }, + 5: { + id: 5, + date: '2021-05-18', + }, }; export const getTranslatedUINoficiations = (t, locale) => { @@ -53,5 +57,14 @@ export const getTranslatedUINoficiations = (t, locale) => { new Date(UI_NOTIFICATIONS[4].date), ), }, + 5: { + ...UI_NOTIFICATIONS[5], + title: t('walletSeed'), + description: t('notifications5Description'), + actionText: t('notifications3ActionText'), + date: new Intl.DateTimeFormat(locale).format( + new Date(UI_NOTIFICATIONS[5].date), + ), + }, }; }; diff --git a/test/e2e/fixtures/address-entry/state.json b/test/e2e/fixtures/address-entry/state.json index e53e3a922..abf7e220c 100644 --- a/test/e2e/fixtures/address-entry/state.json +++ b/test/e2e/fixtures/address-entry/state.json @@ -55,10 +55,10 @@ "1": { "isShown": true }, - "2": { + "3": { "isShown": true }, - "3": { + "5": { "isShown": true } } diff --git a/test/e2e/fixtures/connected-state/state.json b/test/e2e/fixtures/connected-state/state.json index a88a31a74..4f3e724af 100644 --- a/test/e2e/fixtures/connected-state/state.json +++ b/test/e2e/fixtures/connected-state/state.json @@ -45,10 +45,10 @@ "1": { "isShown": true }, - "2": { + "3": { "isShown": true }, - "3": { + "5": { "isShown": true } } diff --git a/test/e2e/fixtures/custom-rpc/state.json b/test/e2e/fixtures/custom-rpc/state.json index 6954fec38..df646bb0d 100644 --- a/test/e2e/fixtures/custom-rpc/state.json +++ b/test/e2e/fixtures/custom-rpc/state.json @@ -41,10 +41,10 @@ "1": { "isShown": true }, - "2": { + "3": { "isShown": true }, - "3": { + "5": { "isShown": true } } diff --git a/test/e2e/fixtures/import-ui/state.json b/test/e2e/fixtures/import-ui/state.json index 350ed8848..380d28b22 100644 --- a/test/e2e/fixtures/import-ui/state.json +++ b/test/e2e/fixtures/import-ui/state.json @@ -96,10 +96,10 @@ "1": { "isShown": true }, - "2": { + "3": { "isShown": true }, - "3": { + "5": { "isShown": true } } diff --git a/test/e2e/fixtures/imported-account/state.json b/test/e2e/fixtures/imported-account/state.json index a3d51e5d5..fc3ea0a4f 100644 --- a/test/e2e/fixtures/imported-account/state.json +++ b/test/e2e/fixtures/imported-account/state.json @@ -41,10 +41,10 @@ "1": { "isShown": true }, - "2": { + "3": { "isShown": true }, - "3": { + "5": { "isShown": true } } diff --git a/test/e2e/fixtures/localization/state.json b/test/e2e/fixtures/localization/state.json index 22d76151b..d0ddfd0f9 100644 --- a/test/e2e/fixtures/localization/state.json +++ b/test/e2e/fixtures/localization/state.json @@ -41,10 +41,10 @@ "1": { "isShown": true }, - "2": { + "3": { "isShown": true }, - "3": { + "5": { "isShown": true } } diff --git a/test/e2e/fixtures/metrics-enabled/state.json b/test/e2e/fixtures/metrics-enabled/state.json index 2fa9931c5..91e3553d2 100644 --- a/test/e2e/fixtures/metrics-enabled/state.json +++ b/test/e2e/fixtures/metrics-enabled/state.json @@ -45,10 +45,10 @@ "1": { "isShown": true }, - "2": { + "3": { "isShown": true }, - "3": { + "5": { "isShown": true } } diff --git a/test/e2e/fixtures/send-edit/state.json b/test/e2e/fixtures/send-edit/state.json index c5c548f4c..228cf7004 100644 --- a/test/e2e/fixtures/send-edit/state.json +++ b/test/e2e/fixtures/send-edit/state.json @@ -42,10 +42,10 @@ "1": { "isShown": true }, - "2": { + "3": { "isShown": true }, - "3": { + "5": { "isShown": true } } diff --git a/test/e2e/fixtures/threebox-enabled/state.json b/test/e2e/fixtures/threebox-enabled/state.json index 8bac5f889..5908d0a25 100644 --- a/test/e2e/fixtures/threebox-enabled/state.json +++ b/test/e2e/fixtures/threebox-enabled/state.json @@ -52,10 +52,10 @@ "1": { "isShown": true }, - "2": { + "3": { "isShown": true }, - "3": { + "5": { "isShown": true } } diff --git a/ui/components/app/whats-new-popup/whats-new-popup.js b/ui/components/app/whats-new-popup/whats-new-popup.js index e63dd5fc0..df0656810 100644 --- a/ui/components/app/whats-new-popup/whats-new-popup.js +++ b/ui/components/app/whats-new-popup/whats-new-popup.js @@ -30,6 +30,12 @@ function getActionFunctionById(id, history) { updateViewedNotifications({ 4: true }); history.push(BUILD_QUOTE_ROUTE); }, + 5: () => { + updateViewedNotifications({ 5: true }); + global.platform.openTab({ + url: 'https://metamask.zendesk.com/hc/en-us/articles/360060826432', + }); + }, }; return actionFunctions[id]; @@ -174,7 +180,8 @@ export default function WhatsNewPopup({ onClose }) {
{notifications.map(({ id }, index) => { const notification = getTranslatedUINoficiations(t, locale)[id]; - return index === 0 + // Display the swaps notification with full image + return index === 0 || id === 1 ? renderFirstNotification(notification, idRefMap, history) : renderSubsequentNotification(notification, idRefMap, history); })} diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index dff8c6a91..5b429c8f7 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -528,6 +528,7 @@ function getAllowedNotificationIds(state) { 2: true, 3: true, 4: getCurrentChainId(state) === BSC_CHAIN_ID, + 5: true, }; }