Graylog2 / graylog2-server

Free and open log management
https://www.graylog.org
Other
7.33k stars 1.05k forks source link

custom plugin breaks the configuration page #15641

Closed papirosko closed 11 months ago

papirosko commented 1 year ago

We have a plugin with configuration component. When we open the plugins section in configuration page, it shows:

Loading component failed: Cannot destructure property 'displayName' of 'f.find(...)' as it is undefined.

This happens because in the https://github.com/Graylog2/graylog2-server/blob/5.1/graylog2-web-interface/src/components/configurations/PluginsConfig.tsx#L88

            const { displayName } = pluginDisplayNames.find((entry) => entry.configType === configType);

it tries to get the plugin display name from the pluginDisplayNames - a set of predefined names and fails (because this set doesn't contain name for my custom plugin)

Expected Behavior

I should be able to specify the displayName, or the page should fallback to the plugin id.

Current Behavior

Page crashes

Context

Graylog 5.1.1

grotlue commented 1 year ago

Hi @papirosko, thanks a lot for reporting this bug! Can you share which plugin you used when discovering this issue for testing purposes?

papirosko commented 1 year ago

this is my own custom plugin. I register the configuration page like this:

    systemConfigurations: [
        {
            component: BackendConfigDetails,
            configType: 'my.plugin.PluginId',
        },
    ],
}));