Core: New Reference Asset - Choice
hborawski opened this issue · comments
To reduce the time it takes for new users to evaluate Player, we need to expand the reference asset set to incoporate more common user interaction patterns.
A choice
asset represents a single selection choice, often displayed as radio buttons in a web context. This will allow users to test out more complex flows than just inputs + buttons.
Requirements
choice
- A
choice
asset must have atitle
to give the user context on what choice they are making- The
title
should be an asset
- The
- A
choice
asset can have an optionalnote
to provide more detailed information about the selection- The
note
should be an asset
- The
- A
choice
asset should update the value of abinding
property supplied to it - A
choice
asset should retrievevalidation
information for its binding, and expose that for all rendering platforms to display - A
choice
asset will have an array ofchoices
- Each entry in
choices
will not be an asset, as thechoice
assets per platform will need direct control over the layout - Each entry must have a
value
that is set to thebinding
when the option is selected- The
value
should be a primitive
- The
- Each entry must have a
label
that describes what value is being selected- The
label
should be an asset
- The
- Each entry in
Execution
- Create a new
choice
asset in the core reference assets and add types for the authored content, and the transformed content. - Create a transform for this
choice
asset- The transform should use the
binding
and provide functions on the transformed type to make it simple for the rendering platform to select an option, similar torun
in theaction
asset - The transform should populate a property on each choice to indicate its selection status
validation
to be populated from the binding/schema informationvalidation
is not a content authored field
- The transform should use the
- Add mocks to the mocks package to exercise required and optional fields, to ease unit testing, and implementations for rendering
- Add the DSL Component for
choice
to allow programmatic content authoring - Add unit tests for the transform
- Verify selecting options
- Verify validation information being populated
Hey, can I take on this task?