Skip to content

Commit

Permalink
Bug 1848973 - Fixes upgrade dialog dismissing after import by adding …
Browse files Browse the repository at this point in the history
…embedded import r=omc-reviewers,Mardak

Differential Revision: https://phabricator.services.mozilla.com/D186365
  • Loading branch information
nuggetsnegin committed Aug 16, 2023
1 parent fe8f5c7 commit 23ac751
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
26 changes: 10 additions & 16 deletions browser/components/newtab/lib/OnboardingMessageProvider.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -238,31 +238,23 @@ const BASE_MESSAGES = () => [
},
},
{
id: "UPGRADE_IMPORT_SETTINGS",
id: "UPGRADE_IMPORT_SETTINGS_EMBEDDED",
content: {
tiles: { type: "migration-wizard" },
position: "split",
split_narrow_bkg_position: "-42px",
image_alt_text: {
string_id: "mr2022-onboarding-import-image-alt",
},
progress_bar: "true",
background:
"url('chrome://activity-stream/content/data/content/assets/mr-import.svg') var(--mr-secondary-position) no-repeat var(--mr-screen-background-color)",
logo: {},
title: {
string_id: "mr2022-onboarding-import-header",
},
subtitle: {
string_id: "mr2022-onboarding-import-subtitle",
progress_bar: true,
hide_secondary_section: "responsive",
migrate_start: {
action: {},
},
primary_button: {
label: {
string_id:
"mr2022-onboarding-import-primary-button-label-no-attribution",
},
migrate_close: {
action: {
type: "SHOW_MIGRATION_WIZARD",
data: {},
navigate: true,
},
},
Expand Down Expand Up @@ -1188,7 +1180,9 @@ const OnboardingMessageProvider = {

//If a user has Firefox as default remove import screen
if (!needDefault) {
removeScreens(screen => screen.id?.startsWith("UPGRADE_IMPORT_SETTINGS"));
removeScreens(screen =>
screen.id?.startsWith("UPGRADE_IMPORT_SETTINGS_EMBEDDED")
);
}

// If already pinned, convert "pin" screen to "welcome" with desired action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ add_task(async function test_OnboardingMessageProvider_getNoImport_default() {
// No import screen is shown when user has Firefox both pinned and default
Assert.notEqual(
message.content.screens[1]?.id,
"UPGRADE_IMPORT_SETTINGS",
"UPGRADE_IMPORT_SETTINGS_EMBEDDED",
"Screen has no import screen id"
);
sandbox.restore();
Expand All @@ -109,7 +109,7 @@ add_task(async function test_OnboardingMessageProvider_getImport_nodefault() {
// Import screen is shown when user doesn't have Firefox pinned and default
Assert.equal(
message.content.screens[1]?.id,
"UPGRADE_IMPORT_SETTINGS",
"UPGRADE_IMPORT_SETTINGS_EMBEDDED",
"Screen has import screen id"
);
sandbox.restore();
Expand Down

0 comments on commit 23ac751

Please sign in to comment.