openedx / openedx/frontend-plugin-framework
Bug: Plugin configuration missing `priority` value will still render Plugin, but disrupts ordering
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
In the example app, I noticed that if a PLUGIN_OPERATION.Insert was missing a priority value, then all of the plugins in the slot would still render, but they would not appear in the order defined in the env.config.js.
Example:
pluginSlots: {
slot_with_insert_operation: {
keepDefault: true,
plugins: [
{
op: PLUGIN_OPERATIONS.Insert,
widget: {
id: 'inserted_direct_plugin',
type: DIRECT_PLUGIN,
// PRIORITY VALUE IS REMOVED
RenderWidget: PluginDirect,
},
},
{
op: PLUGIN_OPERATIONS.Insert,
widget: {
id: 'inserted_iframe_plugin',
type: IFRAME_PLUGIN,
priority: 30,
url: 'http://localhost:8081/plugin_iframe',
title: 'The iFrame plugin that is inserted in the slot',
},
},
],
},
Suggested effect:
If the priority is missing from a plugin config, the plugin should either:
- Not be rendered, but then any other plugin operations that manipulate that Insert-ed plugin should be ignored/removed. In development, the logged error in the browser console will at least indicate that there's a misconfiguration.
- Should render, but be placed at the end of the plugin ordering. This will make it obvious during development that it isn't rendering as expected, but it doesn't make it clear why that is the case even with the logged error in the browser console.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the example app's env.config.js and reproduce the PLUGIN_OPERATIONS.Insert configuration with the priority removed. Trace the plugin ordering and the browser-console error, then inspect any related implementation or tests. Done means the missing-priority behavior is consistent, documented, and covered for the chosen handling of the affected plugin and subsequent operations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100