Skip to content

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

Open
@jsnwesson

Description

@jsnwesson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions