Closed Bug 1826775 Opened 2 years ago Closed 2 years ago

Look up missing imageResource property by looking up other cards via the card type

Categories

(Firefox for Android :: Onboarding, task)

All
Android
task

Tracking

()

RESOLVED INVALID

People

(Reporter: jhugman, Unassigned)

References

Details

This is to ensure that cards that don't include an ordering property use their type to lookup one that does, so we can run experiments on conditional cards at the same time as rollouts that play with the ordering.

"cards": {
   "set-to-default-en": {
      "type": "set-to-default",
      "text": "Make it permanent!"
   }
}

and

"cards": {
   "set-to-default": {
       "image-resource": "onboarding_card_set_to_default_1"
   }
}

Add the imageResource as Option<Image> in the OnboardingCardRawData in the FML.
Add the default values for image resource to the default cards in the FML. (note: find out where are we going to get those images from).
When unpacking/sorting, look up the imageResource (when not set) from card looked up by the type, for example:

val rawCards = feature.cards
val cards = rawCards.entries.map { (key, value) -> 
    val type = value.type ?: reportMalformed(key)
    val imageResource = value.imageResource ?: rawCards[type.toString()]?.imageResource ?: reportMalformed(key)
    val resId = imageResource.resId
    …
}
Component: General → Onboarding

Not required for current requirements.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.