Bug 1845747 - Allow enabling/disabling of onboarding cards

As there might be situations where experiments require disabling
certain juno onboarding cards and enabling others, a new flag has
been added to the `OnboardingCardData` which gives more freedom and
options to the experimenter. This flag is by default set to true.

(cherry picked from commit 30a4e7d1d9b879f7862217276cb2ce7c4af04c05)
fenix/118.0
DreVla 10 months ago committed by Mergify
parent fb8aabefa1
commit 9064ac07c0

@ -25,6 +25,7 @@ features:
add-search-widget: add-search-widget:
card-type: add-search-widget card-type: add-search-widget
enabled: false
title: juno_onboarding_add_search_widget_title title: juno_onboarding_add_search_widget_title
body: juno_onboarding_add_search_widget_description body: juno_onboarding_add_search_widget_description
image-res: ic_onboarding_search_widget image-res: ic_onboarding_search_widget
@ -68,6 +69,10 @@ objects:
description: The type of the card. description: The type of the card.
# This should never be defaulted. # This should never be defaulted.
default: default-browser default: default-browser
enabled:
type: Boolean
description: If true, this card is shown to the user.
default: true
title: title:
type: Text type: Text
description: The title text displayed to the user. description: The title text displayed to the user.

@ -14,18 +14,18 @@ import org.mozilla.fenix.settings.SupportUtils
*/ */
internal fun Collection<OnboardingCardData>.toPageUiData( internal fun Collection<OnboardingCardData>.toPageUiData(
showNotificationPage: Boolean, showNotificationPage: Boolean,
canShowAddWidgetPage: Boolean, showAddWidgetPage: Boolean,
): List<OnboardingPageUiData> = ): List<OnboardingPageUiData> =
filter { filter {
when (it.cardType) { when (it.cardType) {
OnboardingCardType.NOTIFICATION_PERMISSION -> { OnboardingCardType.NOTIFICATION_PERMISSION -> {
showNotificationPage it.enabled && showNotificationPage
} }
OnboardingCardType.ADD_SEARCH_WIDGET -> { OnboardingCardType.ADD_SEARCH_WIDGET -> {
canShowAddWidgetPage it.enabled && showAddWidgetPage
} }
else -> { else -> {
true it.enabled
} }
} }
}.sortedBy { it.ordering } }.sortedBy { it.ordering }

@ -330,13 +330,13 @@
<string name="juno_onboarding_enable_notifications_positive_button" tools:ignore="UnusedResources">Turn on notifications</string> <string name="juno_onboarding_enable_notifications_positive_button" tools:ignore="UnusedResources">Turn on notifications</string>
<!-- Text for the button dismiss the screen and move on with the flow --> <!-- Text for the button dismiss the screen and move on with the flow -->
<string name="juno_onboarding_enable_notifications_negative_button" tools:ignore="UnusedResources">Not now</string> <string name="juno_onboarding_enable_notifications_negative_button" tools:ignore="UnusedResources">Not now</string>
<!-- Title for add search widget screen. <!-- Title for add search widget screen used by Nimbus experiments. Nimbus experiments do not support string placeholders.
Note: The word "Firefox" should NOT be translated --> Note: The word "Firefox" should NOT be translated -->
<string name="juno_onboarding_add_search_widget_title" tools:ignore="UnusedResources">Try the Firefox search widget</string> <string name="juno_onboarding_add_search_widget_title" tools:ignore="UnusedResources">Try the Firefox search widget</string>
<!-- Description for add search widget screen. <!-- Description for add search widget screen used by Nimbus experiments. Nimbus experiments do not support string placeholders.
Note: The word "Firefox" should NOT be translated --> Note: The word "Firefox" should NOT be translated -->
<string name="juno_onboarding_add_search_widget_description" tools:ignore="UnusedResources">With Firefox on your home screen, youll have easy access to the privacy-first browser that blocks cross-site trackers.</string> <string name="juno_onboarding_add_search_widget_description" tools:ignore="UnusedResources">With Firefox on your home screen, youll have easy access to the privacy-first browser that blocks cross-site trackers.</string>
<!-- Text for the button to add search widget on the device <!-- Text for the button to add search widget on the device used by Nimbus experiments. Nimbus experiments do not support string placeholders.
Note: The word "Firefox" should NOT be translated --> Note: The word "Firefox" should NOT be translated -->
<string name="juno_onboarding_add_search_widget_positive_button" tools:ignore="UnusedResources">Add Firefox widget</string> <string name="juno_onboarding_add_search_widget_positive_button" tools:ignore="UnusedResources">Add Firefox widget</string>
<!-- Text for the button to dismiss the screen and move on with the flow --> <!-- Text for the button to dismiss the screen and move on with the flow -->

Loading…
Cancel
Save