openedx / openedx/frontend-plugin-framework

Extend customizability of Default Content

Open
#46 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Context:
The content that is wrapped by a PluginSlot is referred to as the defaultContents. In the current implementation, the defaultContents is rendered by default (and can be hidden by assigning keepDefault to false in the JS config) with the properties:

{
  id: 'default_contents',
  priority: 50,
  renderWidget: children // this is the actual children object inside Plugin Slot, whose contents are read-only
} 

Problem:
This implementation works best when there's only one component as the default content, but lacks customizability in the case where multiples of the same component might need to be rendered as default content (ie. several links in a side bar) and there's a desire to insert plugins in between the default content (Insert) or to Modify/Wrap/Hide individual parts of the default contents.

Solution:
Use something like Braden MacDonald's implementation in his UI Plugin Slot framework where a DefaultPluginSlot exists for instances when we don't need to modify the default content and convert the PluginSlot to handle instances where default contents are customizable.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the PluginSlot implementation and reading how defaultContents, keepDefault, priority, and renderWidget currently work. Compare the proposed DefaultPluginSlot approach with the linked UI Plugin Slot framework. Done means default content can be individually inserted, modified, wrapped, or hidden while retaining a simple path for uncustomized content.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.