-
-
Notifications
You must be signed in to change notification settings - Fork 302
Implement Core Feedback Object Hierarchy #4366
Copy link
Copy link
Closed
Labels
DEV: frontendP1 - importantPriority: High impact on UXPriority: High impact on UXTAG: new featureTAG: unit testsjavascriptPull requests that update Javascript codePull requests that update Javascript code
Milestone
Metadata
Metadata
Assignees
Labels
DEV: frontendP1 - importantPriority: High impact on UXPriority: High impact on UXTAG: new featureTAG: unit testsjavascriptPull requests that update Javascript codePull requests that update Javascript code
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_URLandFeedbackTypeOptionsto ensure consistency.FeedbackTypeOptions should be:
BaseFeedBack Class:
BaseFeedbackwith the constructor accepting parameters forcontext,contentnode_id, andcontent_id.id,context,contentnode_id, andcontent_id.getDataObjectto 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.getDataObjectmethod should return an object excluding theURLfield of the class.getUrlto retrieve the object's URL. Throw an error if URL is not defined.BaseFeedbackEvent Class:
BaseFeedbackto create the classBaseFeedbackEvent.BaseFeedbackclass by passing them to the super constructor.userandtarget_channel_idto the constructor.BaseFeedbackInteractionEvent Class:
BaseFeedbackto create the classBaseFeedbackInteractionEvent.BaseFeedbackInteractionEvenclass by passing them to the super constructor.feedback_typeandfeedback_reasonto the constructor.BaseFlagFeedback Class:
BaseFeedbackInteractionEventto create the classBaseFlagFeedback.target_topic_idto the constructor.FlagFeedbackEvent Class:
BaseFlagFeedbackto create the classFlagFeedbackEvent.FLAG_FEEDBACK_EVENT_URL.Acceptance criteria
FLAG_FEEDBACK_EVENT_URLandFeedbackTypeOptionsshould be appropriately defined.BaseFeedback classshould be correctly implemented with properties and methods as specified.