CTA DTOs
The CTA (Call to Action) DTOs (Data Transfer Objects) are used to define the structure and behavior of various CTAs within the application. These CTAs are used to prompt users to take specific actions such as playing content, ordering content, logging in, or adding content to their favorites.
You can review the general Assemble Documentation in Confluence
Types of CTAs
There are four main types of CTAs:
- OrderCTA: Used for ordering content.
- PlaybackCTA: Used for playing content.
- LoginCTA: Used for prompting users to log in.
- FavoriteCTA: Used for adding content to favorites.
OrderCTA
The OrderCTA is used to handle actions related to ordering content. It includes the following properties:
contentId: The ID of the content.cta: The call to action text.action: The action type, which is "ORDER".orderId: The ID of the order.orderType: The type of the order.detail: Additional details about the order.dataTestId: Unique ID for data-testid (optional).
PlaybackCTA
The PlaybackCTA is used to handle actions related to playing content. It includes the following properties:
contentId: The ID of the content.cta: The call to action text.action: The action type, which is "PLAY".startTime: The start time for playback (optional).isTrailer: Indicates if the content is a trailer (optional).dataTestId: Unique ID for data-testid (optional).
LoginCTA
The LoginCTA is used to prompt users to log in. It includes the following properties:
contentId: The ID of the content.cta: The call to action text.action: The action type, which is "LOGIN".dataTestId: Unique ID for data-testid (optional).
FavoriteCTA
The FavoriteCTA is used to handle actions related to adding content to favorites. It includes the following properties:
contentId: The ID of the content.cta: The call to action text.action: The action type, which is "FAVORITE".dataTestId: Unique ID for data-testid (optional).
Architecture and usage
Assemble Web includes all the logic of the Detail CTA inside the DTO file ctadto.ts located in src/dto
This file handles the entire set of possibilities based on:
- User state using
accountId,profileIdandsegmentationValue - Content using
contentIdandcontentType
Inside the Detail view (or a subcomponent) Assemble makes use of the exported getDetailCTAs in order to get the Array of CTAs and create the Button using the CTAButtons and CTAButton Component create for this purpose which will automatically handle if a "more buttons" icon needs to be presented to the user.