feat: update chat component to use PluginSlot #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors the
Chatcomponent to remove feature-specific logic and enable a more generic, plugin-based architecture for learner tools. The changes simplify the component, delegate feature gating to plugins, and update related configuration and tests. The most important changes are:Refactor to Plugin-Based Architecture:
Chatcomponent (src/courseware/course/chat/Chat.jsx) is rewritten to remove all feature-specific logic (such as enrollment mode checks, exam state, and date validation) and instead renders a genericPluginSlotwith minimal context (courseId,unitId,userId,isStaff,enrollmentMode). Plugins are now responsible for their own gating and requirements.contentToolsEnabledis removed fromChatas it is no longer needed in the generic context.Testing Overhaul:
Chatcomponent test suite (src/courseware/course/chat/Chat.test.jsx) is completely rewritten. Tests now focus on verifying thatPluginSlotis rendered when enabled, receives the correct props, and does not render when disabled. All previous feature-specific tests and mocks are removed, and a new strategy is used to mock and spy onPluginSlotprops.Openedx PR: openedx#1810
Configuration Updates:
.env.development, theBASE_URLandPORTare updated to use port 2010 instead of 2000, and theENABLE_XPERT_AUDITflag is added (previouslyFEATURE_ENABLE_CHAT_V2_ENDPOINT). [1] [2] [3].env.