1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00
metamask-extension/shared/notifications/index.js

424 lines
11 KiB
JavaScript
Raw Permalink Normal View History

Whats new popup (#10583) * Add 'What's New' notification popup * Move selectors from shared/notifications into ui/ directory * Use keys for localized message in whats new notifications objects, to ensure notifications will be translated. * Remove unused swaps intro popup locale messages * Fix keys of whats new notification locales * Remove notifications messages and descriptions from comment in shared/notifications * Move notifcationActionFunctions to shared/notifications and make it stateless * Get notification data from constants instead of state in whats-new-popup * Code cleanup * Fix build quote reference to swapsEthToken, broken during rebase * Rename notificationFilters to notificationToExclude to clarify its purpose * Documentation for getSortedNotificationsToShow * Move notification action functions from shared/ to whats-new-popup.js * Stop setting swapsWelcomeMessageHasBeenShown to state in app-state controller * Update e2e tests for whats new popup changes * Updating migration files * Addressing feedback part 1 * Addressing feedback part 2 * Remove unnecessary div in whats-new-popup * Change getNotificationsToExclude to getNotificationsToInclude for use in the getSortedNotificationsToShow selector * Delete intro-popup directory and test files * Lint fix * Add notifiction state to address-entry fixture * Use two separate functions for rendering first and subsequent notifications in the whats-new-popup * Ensure that string literals are passed to t for whats new popup text * Update import-ui fixtures to include notificaiton controller state * Remove unnecessary, accidental change confirm-approve * Remove swaps notification in favour of mobile swaps as first notifcation and TBD 3rd notification * Update whats-new-popup to use intersection observer api to detect if notification has been seen * Add notifications to send-edit and threebox e2e test fixtures * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Clean up locale code for whats-new-popup notifications * Disconnect observers in whats-new-popup when their callback is first called * Add test case for migration 58 for when the AppStateController does not exist * Rename popover components containerRef to popoverWrapRef * Fix messages.json * Update notification messages and images * Rename popoverWrapRef -> popoverRef in whats-new-popup and popover.component * Only create one observer, and only after images have loaded, in whats-new-popup * Set width and height on whats-new-popup image, instead of setting state on img load * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Code clean up in whats new popup re: notification rendering and action functions * Code cleanup in render notification functions of whats-new-popup * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * lint fix * Update and localize notification dates * Clean up date code in shred/notifications/index.js Co-authored-by: ryanml <ryanlanese@gmail.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-04-28 18:51:41 +02:00
// Messages and descriptions for these locale keys are in app/_locales/en/messages.json
/**
* I'm trying something new here, where notifications get names that are translated
* into numbers in only one place. This should make merge conflicts easier.
*/
export const NOTIFICATION_DROP_LEDGER_FIREFOX = 25;
export const NOTIFICATION_OPEN_BETA_SNAPS = 26;
Whats new popup (#10583) * Add 'What's New' notification popup * Move selectors from shared/notifications into ui/ directory * Use keys for localized message in whats new notifications objects, to ensure notifications will be translated. * Remove unused swaps intro popup locale messages * Fix keys of whats new notification locales * Remove notifications messages and descriptions from comment in shared/notifications * Move notifcationActionFunctions to shared/notifications and make it stateless * Get notification data from constants instead of state in whats-new-popup * Code cleanup * Fix build quote reference to swapsEthToken, broken during rebase * Rename notificationFilters to notificationToExclude to clarify its purpose * Documentation for getSortedNotificationsToShow * Move notification action functions from shared/ to whats-new-popup.js * Stop setting swapsWelcomeMessageHasBeenShown to state in app-state controller * Update e2e tests for whats new popup changes * Updating migration files * Addressing feedback part 1 * Addressing feedback part 2 * Remove unnecessary div in whats-new-popup * Change getNotificationsToExclude to getNotificationsToInclude for use in the getSortedNotificationsToShow selector * Delete intro-popup directory and test files * Lint fix * Add notifiction state to address-entry fixture * Use two separate functions for rendering first and subsequent notifications in the whats-new-popup * Ensure that string literals are passed to t for whats new popup text * Update import-ui fixtures to include notificaiton controller state * Remove unnecessary, accidental change confirm-approve * Remove swaps notification in favour of mobile swaps as first notifcation and TBD 3rd notification * Update whats-new-popup to use intersection observer api to detect if notification has been seen * Add notifications to send-edit and threebox e2e test fixtures * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Clean up locale code for whats-new-popup notifications * Disconnect observers in whats-new-popup when their callback is first called * Add test case for migration 58 for when the AppStateController does not exist * Rename popover components containerRef to popoverWrapRef * Fix messages.json * Update notification messages and images * Rename popoverWrapRef -> popoverRef in whats-new-popup and popover.component * Only create one observer, and only after images have loaded, in whats-new-popup * Set width and height on whats-new-popup image, instead of setting state on img load * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Code clean up in whats new popup re: notification rendering and action functions * Code cleanup in render notification functions of whats-new-popup * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * lint fix * Update and localize notification dates * Clean up date code in shred/notifications/index.js Co-authored-by: ryanml <ryanlanese@gmail.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-04-28 18:51:41 +02:00
export const UI_NOTIFICATIONS = {
1: {
id: 1,
date: '2021-03-17',
image: {
src: 'images/mobile-link-qr.svg',
height: '230px',
width: '230px',
placeImageBelowDescription: true,
Whats new popup (#10583) * Add 'What's New' notification popup * Move selectors from shared/notifications into ui/ directory * Use keys for localized message in whats new notifications objects, to ensure notifications will be translated. * Remove unused swaps intro popup locale messages * Fix keys of whats new notification locales * Remove notifications messages and descriptions from comment in shared/notifications * Move notifcationActionFunctions to shared/notifications and make it stateless * Get notification data from constants instead of state in whats-new-popup * Code cleanup * Fix build quote reference to swapsEthToken, broken during rebase * Rename notificationFilters to notificationToExclude to clarify its purpose * Documentation for getSortedNotificationsToShow * Move notification action functions from shared/ to whats-new-popup.js * Stop setting swapsWelcomeMessageHasBeenShown to state in app-state controller * Update e2e tests for whats new popup changes * Updating migration files * Addressing feedback part 1 * Addressing feedback part 2 * Remove unnecessary div in whats-new-popup * Change getNotificationsToExclude to getNotificationsToInclude for use in the getSortedNotificationsToShow selector * Delete intro-popup directory and test files * Lint fix * Add notifiction state to address-entry fixture * Use two separate functions for rendering first and subsequent notifications in the whats-new-popup * Ensure that string literals are passed to t for whats new popup text * Update import-ui fixtures to include notificaiton controller state * Remove unnecessary, accidental change confirm-approve * Remove swaps notification in favour of mobile swaps as first notifcation and TBD 3rd notification * Update whats-new-popup to use intersection observer api to detect if notification has been seen * Add notifications to send-edit and threebox e2e test fixtures * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Clean up locale code for whats-new-popup notifications * Disconnect observers in whats-new-popup when their callback is first called * Add test case for migration 58 for when the AppStateController does not exist * Rename popover components containerRef to popoverWrapRef * Fix messages.json * Update notification messages and images * Rename popoverWrapRef -> popoverRef in whats-new-popup and popover.component * Only create one observer, and only after images have loaded, in whats-new-popup * Set width and height on whats-new-popup image, instead of setting state on img load * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Code clean up in whats new popup re: notification rendering and action functions * Code cleanup in render notification functions of whats-new-popup * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * lint fix * Update and localize notification dates * Clean up date code in shred/notifications/index.js Co-authored-by: ryanml <ryanlanese@gmail.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-04-28 18:51:41 +02:00
},
},
3: {
id: 3,
date: '2021-03-08',
Whats new popup (#10583) * Add 'What's New' notification popup * Move selectors from shared/notifications into ui/ directory * Use keys for localized message in whats new notifications objects, to ensure notifications will be translated. * Remove unused swaps intro popup locale messages * Fix keys of whats new notification locales * Remove notifications messages and descriptions from comment in shared/notifications * Move notifcationActionFunctions to shared/notifications and make it stateless * Get notification data from constants instead of state in whats-new-popup * Code cleanup * Fix build quote reference to swapsEthToken, broken during rebase * Rename notificationFilters to notificationToExclude to clarify its purpose * Documentation for getSortedNotificationsToShow * Move notification action functions from shared/ to whats-new-popup.js * Stop setting swapsWelcomeMessageHasBeenShown to state in app-state controller * Update e2e tests for whats new popup changes * Updating migration files * Addressing feedback part 1 * Addressing feedback part 2 * Remove unnecessary div in whats-new-popup * Change getNotificationsToExclude to getNotificationsToInclude for use in the getSortedNotificationsToShow selector * Delete intro-popup directory and test files * Lint fix * Add notifiction state to address-entry fixture * Use two separate functions for rendering first and subsequent notifications in the whats-new-popup * Ensure that string literals are passed to t for whats new popup text * Update import-ui fixtures to include notificaiton controller state * Remove unnecessary, accidental change confirm-approve * Remove swaps notification in favour of mobile swaps as first notifcation and TBD 3rd notification * Update whats-new-popup to use intersection observer api to detect if notification has been seen * Add notifications to send-edit and threebox e2e test fixtures * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Clean up locale code for whats-new-popup notifications * Disconnect observers in whats-new-popup when their callback is first called * Add test case for migration 58 for when the AppStateController does not exist * Rename popover components containerRef to popoverWrapRef * Fix messages.json * Update notification messages and images * Rename popoverWrapRef -> popoverRef in whats-new-popup and popover.component * Only create one observer, and only after images have loaded, in whats-new-popup * Set width and height on whats-new-popup image, instead of setting state on img load * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Code clean up in whats new popup re: notification rendering and action functions * Code cleanup in render notification functions of whats-new-popup * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * lint fix * Update and localize notification dates * Clean up date code in shred/notifications/index.js Co-authored-by: ryanml <ryanlanese@gmail.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-04-28 18:51:41 +02:00
},
4: {
id: 4,
date: '2021-05-11',
image: {
src: 'images/source-logos-bsc.svg',
width: '100%',
},
},
5: {
id: 5,
date: '2021-06-09',
},
6: {
id: 6,
date: '2021-05-26',
},
7: {
id: 7,
date: '2021-09-17',
},
8: {
id: 8,
date: '2021-11-01',
},
9: {
id: 9,
date: '2021-12-07',
image: {
src: 'images/txinsights.png',
width: '80%',
},
},
10: {
id: 10,
date: '2022-09-15',
image: {
src: 'images/token-detection.svg',
width: '100%',
},
},
11: {
id: 11,
date: '2022-09-15',
},
12: {
id: 12,
date: '2022-05-18',
image: {
src: 'images/darkmode-banner.png',
width: '100%',
},
},
13: {
id: 13,
date: '2022-09-15',
},
14: {
id: 14,
date: '2022-09-15',
},
15: {
id: 15,
date: '2022-09-15',
},
16: {
id: 16,
date: null,
},
17: {
id: 17,
date: null,
},
18: {
id: 18,
date: null,
image: {
src: 'images/open-sea-security-provider.svg',
width: '100%',
},
},
19: {
id: 19,
date: null,
image: {
src: 'images/nfts.svg',
width: '100%',
},
},
20: {
id: 20,
date: null,
},
2023-06-15 20:17:21 +02:00
21: {
id: 21,
date: null,
image: {
src: 'images/swaps-redesign.svg',
width: '100%',
},
},
22: {
id: 22,
date: null,
image: {
src: 'images/global-menu-block-explorer.svg',
},
},
Whats new blockaid popup (#20071) * deprecate opensea security alerts check Signedoff-by: Olusegun Akintayo <akintayo.segun@gmail.com> set metrics to [] Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> fix jest tests Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> Remove sec provider spec Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> lint fix Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> What's new for blockaid...with placeholder texts Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> i18n Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> lint fixes Rebase to develop Add image to whatsnew blockaid. Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> Fixed i18n Fixed snapshot for ui/pages/settings/experimental-tab/experimental-tab.test.js Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> Fix i18n messages Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> lint fixes Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> Add unit tests Lint fixes use new image that works for both dark and light mode 22 is taken Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> * comment out blockaid Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> * rever change in builds.yml Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> * reverted changes in test/e2e/tests/security-provider.spec.js * fix unit test Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> --------- Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>
2023-08-02 17:14:02 +02:00
///: BEGIN:ONLY_INCLUDE_IN(blockaid)
23: {
id: 23,
date: null,
image: {
src: 'images/blockaid-security-provider.png',
width: '100%',
},
},
///: END:ONLY_INCLUDE_IN
24: {
id: 24,
date: null,
},
// This syntax is unusual, but very helpful here. It's equivalent to `UI_NOTIFICATIONS[NOTIFICATION_DROP_LEDGER_FIREFOX] =`
[NOTIFICATION_DROP_LEDGER_FIREFOX]: {
id: Number(NOTIFICATION_DROP_LEDGER_FIREFOX),
date: null,
},
[NOTIFICATION_OPEN_BETA_SNAPS]: {
id: Number(NOTIFICATION_OPEN_BETA_SNAPS),
date: null,
image: {
src: 'images/introducing-snaps.svg',
width: '100%',
},
},
Whats new popup (#10583) * Add 'What's New' notification popup * Move selectors from shared/notifications into ui/ directory * Use keys for localized message in whats new notifications objects, to ensure notifications will be translated. * Remove unused swaps intro popup locale messages * Fix keys of whats new notification locales * Remove notifications messages and descriptions from comment in shared/notifications * Move notifcationActionFunctions to shared/notifications and make it stateless * Get notification data from constants instead of state in whats-new-popup * Code cleanup * Fix build quote reference to swapsEthToken, broken during rebase * Rename notificationFilters to notificationToExclude to clarify its purpose * Documentation for getSortedNotificationsToShow * Move notification action functions from shared/ to whats-new-popup.js * Stop setting swapsWelcomeMessageHasBeenShown to state in app-state controller * Update e2e tests for whats new popup changes * Updating migration files * Addressing feedback part 1 * Addressing feedback part 2 * Remove unnecessary div in whats-new-popup * Change getNotificationsToExclude to getNotificationsToInclude for use in the getSortedNotificationsToShow selector * Delete intro-popup directory and test files * Lint fix * Add notifiction state to address-entry fixture * Use two separate functions for rendering first and subsequent notifications in the whats-new-popup * Ensure that string literals are passed to t for whats new popup text * Update import-ui fixtures to include notificaiton controller state * Remove unnecessary, accidental change confirm-approve * Remove swaps notification in favour of mobile swaps as first notifcation and TBD 3rd notification * Update whats-new-popup to use intersection observer api to detect if notification has been seen * Add notifications to send-edit and threebox e2e test fixtures * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Clean up locale code for whats-new-popup notifications * Disconnect observers in whats-new-popup when their callback is first called * Add test case for migration 58 for when the AppStateController does not exist * Rename popover components containerRef to popoverWrapRef * Fix messages.json * Update notification messages and images * Rename popoverWrapRef -> popoverRef in whats-new-popup and popover.component * Only create one observer, and only after images have loaded, in whats-new-popup * Set width and height on whats-new-popup image, instead of setting state on img load * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Code clean up in whats new popup re: notification rendering and action functions * Code cleanup in render notification functions of whats-new-popup * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * lint fix * Update and localize notification dates * Clean up date code in shred/notifications/index.js Co-authored-by: ryanml <ryanlanese@gmail.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-04-28 18:51:41 +02:00
};
export const getTranslatedUINotifications = (t, locale) => {
Whats new blockaid popup (#20071) * deprecate opensea security alerts check Signedoff-by: Olusegun Akintayo <akintayo.segun@gmail.com> set metrics to [] Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> fix jest tests Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> Remove sec provider spec Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> lint fix Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> What's new for blockaid...with placeholder texts Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> i18n Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> lint fixes Rebase to develop Add image to whatsnew blockaid. Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> Fixed i18n Fixed snapshot for ui/pages/settings/experimental-tab/experimental-tab.test.js Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> Fix i18n messages Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> lint fixes Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> Add unit tests Lint fixes use new image that works for both dark and light mode 22 is taken Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> * comment out blockaid Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> * rever change in builds.yml Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> * reverted changes in test/e2e/tests/security-provider.spec.js * fix unit test Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> --------- Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>
2023-08-02 17:14:02 +02:00
const formattedLocale = locale?.replace('_', '-');
Whats new popup (#10583) * Add 'What's New' notification popup * Move selectors from shared/notifications into ui/ directory * Use keys for localized message in whats new notifications objects, to ensure notifications will be translated. * Remove unused swaps intro popup locale messages * Fix keys of whats new notification locales * Remove notifications messages and descriptions from comment in shared/notifications * Move notifcationActionFunctions to shared/notifications and make it stateless * Get notification data from constants instead of state in whats-new-popup * Code cleanup * Fix build quote reference to swapsEthToken, broken during rebase * Rename notificationFilters to notificationToExclude to clarify its purpose * Documentation for getSortedNotificationsToShow * Move notification action functions from shared/ to whats-new-popup.js * Stop setting swapsWelcomeMessageHasBeenShown to state in app-state controller * Update e2e tests for whats new popup changes * Updating migration files * Addressing feedback part 1 * Addressing feedback part 2 * Remove unnecessary div in whats-new-popup * Change getNotificationsToExclude to getNotificationsToInclude for use in the getSortedNotificationsToShow selector * Delete intro-popup directory and test files * Lint fix * Add notifiction state to address-entry fixture * Use two separate functions for rendering first and subsequent notifications in the whats-new-popup * Ensure that string literals are passed to t for whats new popup text * Update import-ui fixtures to include notificaiton controller state * Remove unnecessary, accidental change confirm-approve * Remove swaps notification in favour of mobile swaps as first notifcation and TBD 3rd notification * Update whats-new-popup to use intersection observer api to detect if notification has been seen * Add notifications to send-edit and threebox e2e test fixtures * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Clean up locale code for whats-new-popup notifications * Disconnect observers in whats-new-popup when their callback is first called * Add test case for migration 58 for when the AppStateController does not exist * Rename popover components containerRef to popoverWrapRef * Fix messages.json * Update notification messages and images * Rename popoverWrapRef -> popoverRef in whats-new-popup and popover.component * Only create one observer, and only after images have loaded, in whats-new-popup * Set width and height on whats-new-popup image, instead of setting state on img load * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Code clean up in whats new popup re: notification rendering and action functions * Code cleanup in render notification functions of whats-new-popup * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * lint fix * Update and localize notification dates * Clean up date code in shred/notifications/index.js Co-authored-by: ryanml <ryanlanese@gmail.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-04-28 18:51:41 +02:00
return {
1: {
...UI_NOTIFICATIONS[1],
title: t('notifications1Title'),
description: t('notifications1Description'),
date: new Intl.DateTimeFormat(formattedLocale).format(
Whats new popup (#10583) * Add 'What's New' notification popup * Move selectors from shared/notifications into ui/ directory * Use keys for localized message in whats new notifications objects, to ensure notifications will be translated. * Remove unused swaps intro popup locale messages * Fix keys of whats new notification locales * Remove notifications messages and descriptions from comment in shared/notifications * Move notifcationActionFunctions to shared/notifications and make it stateless * Get notification data from constants instead of state in whats-new-popup * Code cleanup * Fix build quote reference to swapsEthToken, broken during rebase * Rename notificationFilters to notificationToExclude to clarify its purpose * Documentation for getSortedNotificationsToShow * Move notification action functions from shared/ to whats-new-popup.js * Stop setting swapsWelcomeMessageHasBeenShown to state in app-state controller * Update e2e tests for whats new popup changes * Updating migration files * Addressing feedback part 1 * Addressing feedback part 2 * Remove unnecessary div in whats-new-popup * Change getNotificationsToExclude to getNotificationsToInclude for use in the getSortedNotificationsToShow selector * Delete intro-popup directory and test files * Lint fix * Add notifiction state to address-entry fixture * Use two separate functions for rendering first and subsequent notifications in the whats-new-popup * Ensure that string literals are passed to t for whats new popup text * Update import-ui fixtures to include notificaiton controller state * Remove unnecessary, accidental change confirm-approve * Remove swaps notification in favour of mobile swaps as first notifcation and TBD 3rd notification * Update whats-new-popup to use intersection observer api to detect if notification has been seen * Add notifications to send-edit and threebox e2e test fixtures * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Clean up locale code for whats-new-popup notifications * Disconnect observers in whats-new-popup when their callback is first called * Add test case for migration 58 for when the AppStateController does not exist * Rename popover components containerRef to popoverWrapRef * Fix messages.json * Update notification messages and images * Rename popoverWrapRef -> popoverRef in whats-new-popup and popover.component * Only create one observer, and only after images have loaded, in whats-new-popup * Set width and height on whats-new-popup image, instead of setting state on img load * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Code clean up in whats new popup re: notification rendering and action functions * Code cleanup in render notification functions of whats-new-popup * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * lint fix * Update and localize notification dates * Clean up date code in shred/notifications/index.js Co-authored-by: ryanml <ryanlanese@gmail.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-04-28 18:51:41 +02:00
new Date(UI_NOTIFICATIONS[1].date),
),
},
3: {
...UI_NOTIFICATIONS[3],
title: t('notifications3Title'),
description: t('notifications3Description'),
actionText: t('notifications3ActionText'),
date: new Intl.DateTimeFormat(formattedLocale).format(
Whats new popup (#10583) * Add 'What's New' notification popup * Move selectors from shared/notifications into ui/ directory * Use keys for localized message in whats new notifications objects, to ensure notifications will be translated. * Remove unused swaps intro popup locale messages * Fix keys of whats new notification locales * Remove notifications messages and descriptions from comment in shared/notifications * Move notifcationActionFunctions to shared/notifications and make it stateless * Get notification data from constants instead of state in whats-new-popup * Code cleanup * Fix build quote reference to swapsEthToken, broken during rebase * Rename notificationFilters to notificationToExclude to clarify its purpose * Documentation for getSortedNotificationsToShow * Move notification action functions from shared/ to whats-new-popup.js * Stop setting swapsWelcomeMessageHasBeenShown to state in app-state controller * Update e2e tests for whats new popup changes * Updating migration files * Addressing feedback part 1 * Addressing feedback part 2 * Remove unnecessary div in whats-new-popup * Change getNotificationsToExclude to getNotificationsToInclude for use in the getSortedNotificationsToShow selector * Delete intro-popup directory and test files * Lint fix * Add notifiction state to address-entry fixture * Use two separate functions for rendering first and subsequent notifications in the whats-new-popup * Ensure that string literals are passed to t for whats new popup text * Update import-ui fixtures to include notificaiton controller state * Remove unnecessary, accidental change confirm-approve * Remove swaps notification in favour of mobile swaps as first notifcation and TBD 3rd notification * Update whats-new-popup to use intersection observer api to detect if notification has been seen * Add notifications to send-edit and threebox e2e test fixtures * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Clean up locale code for whats-new-popup notifications * Disconnect observers in whats-new-popup when their callback is first called * Add test case for migration 58 for when the AppStateController does not exist * Rename popover components containerRef to popoverWrapRef * Fix messages.json * Update notification messages and images * Rename popoverWrapRef -> popoverRef in whats-new-popup and popover.component * Only create one observer, and only after images have loaded, in whats-new-popup * Set width and height on whats-new-popup image, instead of setting state on img load * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Code clean up in whats new popup re: notification rendering and action functions * Code cleanup in render notification functions of whats-new-popup * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * lint fix * Update and localize notification dates * Clean up date code in shred/notifications/index.js Co-authored-by: ryanml <ryanlanese@gmail.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-04-28 18:51:41 +02:00
new Date(UI_NOTIFICATIONS[3].date),
),
},
4: {
...UI_NOTIFICATIONS[4],
title: t('notifications4Title'),
description: t('notifications4Description'),
actionText: t('notifications4ActionText'),
date: new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[4].date),
),
},
5: {
...UI_NOTIFICATIONS[5],
title: t('secretRecoveryPhrase'),
description: t('notifications5Description'),
actionText: t('notifications3ActionText'),
date: new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[5].date),
),
},
6: {
...UI_NOTIFICATIONS[6],
title: t('notifications6Title'),
description: [
t('notifications6DescriptionOne'),
t('notifications6DescriptionTwo'),
t('notifications6DescriptionThree'),
],
date: new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[6].date),
),
},
7: {
...UI_NOTIFICATIONS[7],
title: t('notifications7Title'),
description: [
t('notifications7DescriptionOne'),
t('notifications7DescriptionTwo'),
],
date: new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[7].date),
),
},
8: {
...UI_NOTIFICATIONS[8],
title: t('notifications8Title'),
description: [
t('notifications8DescriptionOne'),
t('notifications8DescriptionTwo'),
],
date: new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[8].date),
),
actionText: t('notifications8ActionText'),
},
9: {
...UI_NOTIFICATIONS[9],
title: t('notifications9Title'),
description: [
t('notifications9DescriptionOne'),
t('notifications9DescriptionTwo'),
],
date: new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[9].date),
),
},
10: {
...UI_NOTIFICATIONS[10],
title: t('notifications10Title'),
description: [
t('notifications10DescriptionOne'),
t('notifications10DescriptionTwo'),
t('notifications10DescriptionThree'),
],
actionText: t('notifications10ActionText'),
date: new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[10].date),
),
},
11: {
...UI_NOTIFICATIONS[11],
title: t('notifications11Title'),
description: t('notifications11Description'),
date: new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[11].date),
),
},
12: {
...UI_NOTIFICATIONS[12],
title: t('notifications12Title'),
description: t('notifications12Description'),
actionText: t('notifications12ActionText'),
date: new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[12].date),
),
},
13: {
...UI_NOTIFICATIONS[13],
title: t('notifications13Title'),
description: t('notifications13Description'),
actionText: t('notifications13ActionText'),
date: new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[13].date),
),
},
14: {
...UI_NOTIFICATIONS[14],
title: t('notifications14Title'),
description: t('notifications14Description'),
actionText: t('notifications14ActionText'),
date: UI_NOTIFICATIONS[14].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[14].date),
)
: '',
},
15: {
...UI_NOTIFICATIONS[15],
title: t('notifications15Title'),
description: t('notifications15Description'),
date: UI_NOTIFICATIONS[15].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[15].date),
)
: '',
},
18: {
...UI_NOTIFICATIONS[18],
title: t('notifications18Title'),
description: [
t('notifications18DescriptionOne'),
t('notifications18DescriptionTwo'),
t('notifications18DescriptionThree'),
],
actionText: t('notifications18ActionText'),
date: UI_NOTIFICATIONS[18].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[18].date),
)
: '',
},
19: {
...UI_NOTIFICATIONS[19],
title: t('notifications19Title'),
description: [
t('notifications19DescriptionOne'),
t('notifications19DescriptionTwo'),
t('notifications19DescriptionThree'),
],
actionText: t('notifications19ActionText'),
date: UI_NOTIFICATIONS[19].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[19].date),
)
: '',
},
20: {
...UI_NOTIFICATIONS[20],
title: t('notifications20Title'),
description: [t('notifications20Description')],
actionText: t('notifications20ActionText'),
date: UI_NOTIFICATIONS[20].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[20].date),
)
: '',
},
2023-06-15 20:17:21 +02:00
21: {
...UI_NOTIFICATIONS[21],
title: t('notifications21Title'),
description: t('notifications21Description'),
actionText: t('notifications21ActionText'),
date: UI_NOTIFICATIONS[21].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[21].date),
)
: '',
},
22: {
...UI_NOTIFICATIONS[22],
title: t('notifications22Title'),
description: t('notifications22Description'),
actionText: t('notifications22ActionText'),
date: UI_NOTIFICATIONS[22].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[22].date),
)
: '',
},
Whats new blockaid popup (#20071) * deprecate opensea security alerts check Signedoff-by: Olusegun Akintayo <akintayo.segun@gmail.com> set metrics to [] Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> fix jest tests Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> Remove sec provider spec Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> lint fix Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> What's new for blockaid...with placeholder texts Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> i18n Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> lint fixes Rebase to develop Add image to whatsnew blockaid. Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> Fixed i18n Fixed snapshot for ui/pages/settings/experimental-tab/experimental-tab.test.js Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> Fix i18n messages Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> lint fixes Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> Add unit tests Lint fixes use new image that works for both dark and light mode 22 is taken Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> * comment out blockaid Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> * rever change in builds.yml Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> * reverted changes in test/e2e/tests/security-provider.spec.js * fix unit test Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com> --------- Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>
2023-08-02 17:14:02 +02:00
///: BEGIN:ONLY_INCLUDE_IN(blockaid)
23: {
...UI_NOTIFICATIONS[23],
title: t('notifications23Title'),
description: [
t('notifications23DescriptionOne'),
t('notifications23DescriptionTwo'),
],
actionText: t('notifications23ActionText'),
date: UI_NOTIFICATIONS[23].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[23].date),
)
: '',
},
///: END:ONLY_INCLUDE_IN
24: {
...UI_NOTIFICATIONS[24],
title: t('notifications24Title'),
description: t('notifications24Description'),
actionText: t('notifications24ActionText'),
date: UI_NOTIFICATIONS[24].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[24].date),
)
: '',
},
// This syntax is unusual, but very helpful here. It's equivalent to `unnamedObject[NOTIFICATION_DROP_LEDGER_FIREFOX] =`
[NOTIFICATION_DROP_LEDGER_FIREFOX]: {
...UI_NOTIFICATIONS[NOTIFICATION_DROP_LEDGER_FIREFOX],
title: t('notificationsDropLedgerFirefoxTitle'),
description: [t('notificationsDropLedgerFirefoxDescription')],
date: UI_NOTIFICATIONS[NOTIFICATION_DROP_LEDGER_FIREFOX].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[NOTIFICATION_DROP_LEDGER_FIREFOX].date),
)
: '',
},
[NOTIFICATION_OPEN_BETA_SNAPS]: {
...UI_NOTIFICATIONS[NOTIFICATION_OPEN_BETA_SNAPS],
title: t('notificationsOpenBetaSnapsTitle'),
description: [
t('notificationsOpenBetaSnapsDescriptionOne'),
t('notificationsOpenBetaSnapsDescriptionTwo'),
t('notificationsOpenBetaSnapsDescriptionThree'),
],
actionText: t('notificationsOpenBetaSnapsActionText'),
date: UI_NOTIFICATIONS[NOTIFICATION_OPEN_BETA_SNAPS].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[NOTIFICATION_OPEN_BETA_SNAPS].date),
)
: '',
},
Whats new popup (#10583) * Add 'What's New' notification popup * Move selectors from shared/notifications into ui/ directory * Use keys for localized message in whats new notifications objects, to ensure notifications will be translated. * Remove unused swaps intro popup locale messages * Fix keys of whats new notification locales * Remove notifications messages and descriptions from comment in shared/notifications * Move notifcationActionFunctions to shared/notifications and make it stateless * Get notification data from constants instead of state in whats-new-popup * Code cleanup * Fix build quote reference to swapsEthToken, broken during rebase * Rename notificationFilters to notificationToExclude to clarify its purpose * Documentation for getSortedNotificationsToShow * Move notification action functions from shared/ to whats-new-popup.js * Stop setting swapsWelcomeMessageHasBeenShown to state in app-state controller * Update e2e tests for whats new popup changes * Updating migration files * Addressing feedback part 1 * Addressing feedback part 2 * Remove unnecessary div in whats-new-popup * Change getNotificationsToExclude to getNotificationsToInclude for use in the getSortedNotificationsToShow selector * Delete intro-popup directory and test files * Lint fix * Add notifiction state to address-entry fixture * Use two separate functions for rendering first and subsequent notifications in the whats-new-popup * Ensure that string literals are passed to t for whats new popup text * Update import-ui fixtures to include notificaiton controller state * Remove unnecessary, accidental change confirm-approve * Remove swaps notification in favour of mobile swaps as first notifcation and TBD 3rd notification * Update whats-new-popup to use intersection observer api to detect if notification has been seen * Add notifications to send-edit and threebox e2e test fixtures * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Update ui/app/selectors/selectors.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Clean up locale code for whats-new-popup notifications * Disconnect observers in whats-new-popup when their callback is first called * Add test case for migration 58 for when the AppStateController does not exist * Rename popover components containerRef to popoverWrapRef * Fix messages.json * Update notification messages and images * Rename popoverWrapRef -> popoverRef in whats-new-popup and popover.component * Only create one observer, and only after images have loaded, in whats-new-popup * Set width and height on whats-new-popup image, instead of setting state on img load * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Code clean up in whats new popup re: notification rendering and action functions * Code cleanup in render notification functions of whats-new-popup * Update ui/app/components/app/whats-new-popup/whats-new-popup.js Co-authored-by: Mark Stacey <markjstacey@gmail.com> * lint fix * Update and localize notification dates * Clean up date code in shred/notifications/index.js Co-authored-by: ryanml <ryanlanese@gmail.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-04-28 18:51:41 +02:00
};
};