Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added "What's New" Notification for Improved token allowance experience #16465

Merged
merged 3 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions shared/notifications/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export const UI_NOTIFICATIONS = {
id: 15,
date: '2022-09-15',
},
16: {
id: 16,
date: null,
},
};

export const getTranslatedUINotifications = (t, locale) => {
Expand Down Expand Up @@ -224,5 +228,16 @@ export const getTranslatedUINotifications = (t, locale) => {
)
: '',
},
16: {
...UI_NOTIFICATIONS[16],
title: t('notifications16Title'),
description: t('notifications16Description'),
actionText: t('notifications16ActionText'),
date: UI_NOTIFICATIONS[16].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[16].date),
)
: '',
},
};
};
11 changes: 8 additions & 3 deletions test/e2e/fixture-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ function defaultFixture() {
src: 'images/token-detection.svg',
width: '100%',
},
isShown: true,
isShown: false,
},
11: {
date: '2022-09-15',
id: 11,
isShown: true,
isShown: false,
},
12: {
date: '2022-05-18',
Expand All @@ -98,11 +98,16 @@ function defaultFixture() {
14: {
date: '2022-09-15',
id: 14,
isShown: true,
isShown: false,
},
15: {
date: '2022-09-15',
id: 15,
isShown: false,
},
16: {
date: null,
id: 16,
isShown: true,
},
},
Expand Down
4 changes: 4 additions & 0 deletions ui/components/app/whats-new-popup/whats-new-popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ function getActionFunctionById(id, history) {
updateViewedNotifications({ 14: true });
history.push(`${ADVANCED_ROUTE}#backup-userdata`);
},
16: () => {
updateViewedNotifications({ 16: true });
history.push(EXPERIMENTAL_ROUTE);
},
};

return actionFunctions[id];
Expand Down
7 changes: 4 additions & 3 deletions ui/selectors/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -956,12 +956,13 @@ function getAllowedAnnouncementIds(state) {
7: false,
8: supportsWebHid && currentKeyringIsLedger && currentlyUsingLedgerLive,
9: false,
10: true,
11: true,
10: false,
11: false,
12: false,
13: false,
14: false,
15: true,
15: false,
16: true,
};
}

Expand Down