From da677dd650ee83569bd4257b723503cf5f0ba83b Mon Sep 17 00:00:00 2001 From: Gabriel Luong Date: Wed, 24 Aug 2022 12:33:11 -0400 Subject: [PATCH] For #26620 - Replace the onboarding nimbus feature with MR2022 nimbus feature --- .experimenter.yaml | 8 ---- .../java/org/mozilla/fenix/utils/Settings.kt | 16 +++---- nimbus.fml.yaml | 48 ------------------- 3 files changed, 8 insertions(+), 64 deletions(-) diff --git a/.experimenter.yaml b/.experimenter.yaml index acca9095c..0d1d7dff2 100644 --- a/.experimenter.yaml +++ b/.experimenter.yaml @@ -66,14 +66,6 @@ nimbus-validation: settings-title: type: string description: The title of displayed in the Settings screen and app menu. -onboarding: - description: The onboarding features displayed on homescreen. - hasExposure: true - exposureDescription: "" - variables: - sections-enabled: - type: json - description: This property provides a lookup table of whether or not the given section should be enabled. search-term-groups: description: A feature allowing the grouping of URLs around the search term that it came from. hasExposure: true diff --git a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt index 2d117a9a7..ad2ebcd21 100644 --- a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt +++ b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt @@ -43,7 +43,7 @@ import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.getPreferenceKey import org.mozilla.fenix.nimbus.FxNimbus import org.mozilla.fenix.nimbus.HomeScreenSection -import org.mozilla.fenix.nimbus.OnboardingSection +import org.mozilla.fenix.nimbus.Mr2022Section import org.mozilla.fenix.settings.PhoneFeature import org.mozilla.fenix.settings.deletebrowsingdata.DeleteBrowsingDataOnQuitType import org.mozilla.fenix.settings.logins.SavedLoginsSortingStrategyMenu @@ -196,7 +196,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { val showWallpaperOnboarding by lazyFeatureFlagPreference( key = appContext.getPreferenceKey(R.string.pref_key_wallpapers_onboarding), featureFlag = FeatureFlags.wallpaperOnboardingEnabled, - default = { onboardScreenSection[OnboardingSection.WALLPAPERS] == true }, + default = { mr2022Sections[Mr2022Section.WALLPAPERS_SELECTION_TOOL] == true }, ) var openLinksInAPrivateTab by booleanPreference( @@ -862,7 +862,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { var shouldShowJumpBackInCFR by lazyFeatureFlagPreference( appContext.getPreferenceKey(R.string.pref_key_should_show_jump_back_in_tabs_popup), featureFlag = FeatureFlags.showJumpBackInCFR, - default = { onboardScreenSection[OnboardingSection.JUMP_BACK_IN_CFR] == true }, + default = { mr2022Sections[Mr2022Section.JUMP_BACK_IN_CFR] == true }, ) fun getSitePermissionsPhoneFeatureAction( @@ -1196,8 +1196,8 @@ class Settings(private val appContext: Context) : PreferencesHolder { default = false ) - private val onboardScreenSection: Map get() = - FxNimbus.features.onboarding.value().sectionsEnabled + private val mr2022Sections: Map get() = + FxNimbus.features.mr2022.value().sectionsEnabled private val homescreenSections: Map get() = FxNimbus.features.homescreen.value().sectionsEnabled @@ -1215,7 +1215,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { var showSyncCFR by lazyFeatureFlagPreference( appContext.getPreferenceKey(R.string.pref_key_should_show_sync_cfr), featureFlag = FeatureFlags.showSynCFR, - default = { onboardScreenSection[OnboardingSection.SYNC_CFR] == true }, + default = { mr2022Sections[Mr2022Section.SYNC_CFR] == true }, ) /** @@ -1224,7 +1224,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { var showHomeOnboardingDialog by lazyFeatureFlagPreference( appContext.getPreferenceKey(R.string.pref_key_should_show_home_onboarding_dialog), featureFlag = FeatureFlags.showHomeOnboarding, - default = { onboardScreenSection[OnboardingSection.HOME_ONBOARDING_DIALOG] == true }, + default = { mr2022Sections[Mr2022Section.HOME_ONBOARDING_DIALOG_EXISTING_USERS] == true }, ) /** @@ -1233,7 +1233,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { var showFirstRunOnboardingUpdate by lazyFeatureFlagPreference( appContext.getPreferenceKey(R.string.pref_key_show_first_run_onboarding_update), featureFlag = FeatureFlags.showFirstRunOnboardingUpdates, - default = { onboardScreenSection[OnboardingSection.FIRST_RUN_ONBOARDING] == true }, + default = { mr2022Sections[Mr2022Section.HOME_ONBOARDING_DIALOG_NEW_USERS] == true }, ) /** diff --git a/nimbus.fml.yaml b/nimbus.fml.yaml index 48b4b7b64..253004b2d 100644 --- a/nimbus.fml.yaml +++ b/nimbus.fml.yaml @@ -43,41 +43,6 @@ features: "pocket-sponsored-stories": true, } } - onboarding: - description: The onboarding features displayed on homescreen. - variables: - sections-enabled: - description: "This property provides a lookup table of whether or not the given section should be enabled." - type: Map - default: - { - "sync-cfr": false, - "wallpapers": false, - "home-onboarding-dialog": false, - "jump-back-in-cfr": false, - "first-run-onboarding": false, - } - defaults: - - channel: nightly - value: { - "sections-enabled": { - "sync-cfr": false, - "wallpapers": false, - "home-onboarding-dialog": false, - "jump-back-in-cfr": false, - "first-run-onboarding": false, - } - } - - channel: developer - value: { - "sections-enabled": { - "sync-cfr": false, - "wallpapers": true, - "home-onboarding-dialog": false, - "jump-back-in-cfr": false, - "first-run-onboarding": false, - } - } nimbus-validation: description: "A feature that does not correspond to an application feature suitable for showing that Nimbus is working. This should never be used in production." @@ -367,19 +332,6 @@ types: description: A setting in the settings screen. homescreen-banner: description: A banner in the homescreen. - OnboardingSection: - description: The identifiers for the sections of the onboarding. - variants: - sync-cfr: - description: Sync onboarding CFR. - wallpapers: - description: Wallpapers onboarding dialog. - home-onboarding-dialog: - description: Home onboarding dialog for upgraded users. - jump-back-in-cfr: - description: Jump back in onboarding CFR. - first-run-onboarding: - description: First run onboarding page updates. MR2022Section: description: The identifiers for the sections of the MR 2022. variants: