Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Plugin configuration missing priority value will still render Plugin, but disrupts ordering #68

Open
jsnwesson opened this issue May 24, 2024 · 0 comments

Comments

@jsnwesson
Copy link
Contributor

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',
          },
        },
      ],
    },
Screenshot 2024-05-24 at 10 22 44 AM

Suggested effect:
If the priority is missing from a plugin config, the plugin should either:

  1. 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.
  2. 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant