Implement Core Feedback Object Hierarchy #4366
Labels
DEV: frontend
javascript
Pull requests that update Javascript code
P1 - important
Priority: High impact on UX
TAG: new feature
TAG: unit tests
Milestone
Overview
Implement the base feedback object hierarchy, consisting of BaseFeedback, BaseFeedbackEvent, BaseFeedbackInteractionEvent, BaseFlagFeedback, and FlagFeedbackEvent. These classes should form the foundation for creating feedback objects in the feedback mechanism.
Description and outcomes
frontend/shared folder
.FLAG_FEEDBACK_EVENT_URL
andFeedbackTypeOptions
to ensure consistency.FeedbackTypeOptions should be:
BaseFeedBack Class:
BaseFeedback
with the constructor accepting parameters forcontext
,contentnode_id
, andcontent_id
.id
,context
,contentnode_id
, andcontent_id
.getDataObject
to construct a data object excluding functions from the current instance. This should be used to convert the feedback object into a format suitable for API requests.getDataObject
method should return an object excluding theURL
field of the class.getUrl
to retrieve the object's URL. Throw an error if URL is not defined.BaseFeedbackEvent Class:
BaseFeedback
to create the classBaseFeedbackEvent
.BaseFeedback
class by passing them to the super constructor.user
andtarget_channel_id
to the constructor.BaseFeedbackInteractionEvent Class:
BaseFeedback
to create the classBaseFeedbackInteractionEvent
.BaseFeedbackInteractionEven
class by passing them to the super constructor.feedback_type
andfeedback_reason
to the constructor.BaseFlagFeedback Class:
BaseFeedbackInteractionEvent
to create the classBaseFlagFeedback
.target_topic_id
to the constructor.FlagFeedbackEvent Class:
BaseFlagFeedback
to create the classFlagFeedbackEvent.
FLAG_FEEDBACK_EVENT_URL
.Acceptance criteria
FLAG_FEEDBACK_EVENT_URL
andFeedbackTypeOptions
should be appropriately defined.BaseFeedback class
should be correctly implemented with properties and methods as specified.The text was updated successfully, but these errors were encountered: