From baca162aacb8b4f29c086b32de98a9c3b1c20b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Oliv=C3=A9?= Date: Thu, 20 Jul 2023 12:29:13 +0200 Subject: [PATCH 1/3] Added back trackEvents to whats-new-popup --- shared/constants/metametrics.ts | 2 ++ .../app/whats-new-popup/whats-new-popup.js | 27 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/shared/constants/metametrics.ts b/shared/constants/metametrics.ts index 9e7fdbe1fdec..2a6c9a7ffcc0 100644 --- a/shared/constants/metametrics.ts +++ b/shared/constants/metametrics.ts @@ -586,6 +586,8 @@ export enum MetaMetricsEventName { DeeplinkClicked = 'Deeplink Clicked', ConnectCustodialAccountClicked = 'Connect Custodial Account Clicked', MMIPortfolioButtonClicked = 'MMI Portfolio Button Clicked', + MMIPortfolioDashboardModalButton = 'Portfolio Dashboard Modal Button', + MMIPortfolioDashboardModalOpen = 'Portfolio Dashboard Modal Open', StakeButtonClicked = 'Stake Button Clicked', InteractiveReplacementTokenButtonClicked = 'Interactive Replacement Token Button Clicked', RefreshTokenListClicked = 'Refresh Token List Clicked', 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 09e26129fc46..41b8048cd39c 100644 --- a/ui/components/app/whats-new-popup/whats-new-popup.js +++ b/ui/components/app/whats-new-popup/whats-new-popup.js @@ -347,10 +347,26 @@ export default function WhatsNewPopup({ observer.observe(ref.current); }); + ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) + trackEvent({ + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.MMIPortfolioDashboardModalOpen, + properties: { + action: 'Modal was opened', + }, + }); + ///: END:ONLY_INCLUDE_IN + return () => { observer.disconnect(); }; - }, [idRefMap, setSeenNotifications]); + }, [ + idRefMap, + setSeenNotifications, + ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) + trackEvent, + ///: END:ONLY_INCLUDE_IN` + ]); // Display the swaps notification with full image // Displays the NFTs & OpenSea notifications 18,19 with full image @@ -377,6 +393,15 @@ export default function WhatsNewPopup({ completed_all: true, }, }); + ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) + trackEvent({ + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.MMIPortfolioDashboardModalButton, + properties: { + action: 'Button was clicked', + }, + }); + ///: END:ONLY_INCLUDE_IN onClose(); }} popoverRef={popoverRef} From e6226f02f0565769eb9d0a8894a5258b804b0f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Oliv=C3=A9?= Date: Thu, 20 Jul 2023 15:01:03 +0200 Subject: [PATCH 2/3] Renamed constants --- shared/constants/metametrics.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/constants/metametrics.ts b/shared/constants/metametrics.ts index 2a6c9a7ffcc0..1371a451dc2f 100644 --- a/shared/constants/metametrics.ts +++ b/shared/constants/metametrics.ts @@ -586,8 +586,8 @@ export enum MetaMetricsEventName { DeeplinkClicked = 'Deeplink Clicked', ConnectCustodialAccountClicked = 'Connect Custodial Account Clicked', MMIPortfolioButtonClicked = 'MMI Portfolio Button Clicked', - MMIPortfolioDashboardModalButton = 'Portfolio Dashboard Modal Button', - MMIPortfolioDashboardModalOpen = 'Portfolio Dashboard Modal Open', + PortfolioDashboardModalButtonClicked = 'Portfolio Dashboard Modal Button Clicked', + PortfolioDashboardModalOpened = 'Portfolio Dashboard Modal Opened', StakeButtonClicked = 'Stake Button Clicked', InteractiveReplacementTokenButtonClicked = 'Interactive Replacement Token Button Clicked', RefreshTokenListClicked = 'Refresh Token List Clicked', From 0fe345fded96ff229338f859c6b97c8c80ea4bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Oliv=C3=A9?= Date: Thu, 20 Jul 2023 15:02:36 +0200 Subject: [PATCH 3/3] Fixed code fences issue --- ui/components/app/whats-new-popup/whats-new-popup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 41b8048cd39c..fb4ea7286da8 100644 --- a/ui/components/app/whats-new-popup/whats-new-popup.js +++ b/ui/components/app/whats-new-popup/whats-new-popup.js @@ -365,7 +365,7 @@ export default function WhatsNewPopup({ setSeenNotifications, ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) trackEvent, - ///: END:ONLY_INCLUDE_IN` + ///: END:ONLY_INCLUDE_IN ]); // Display the swaps notification with full image