Prevent plugin with no mainComponent from being injected into the left menu

Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
soupette 2020-01-30 10:31:52 +01:00
parent 940b1ebec5
commit b94d1a6a08

View File

@ -68,7 +68,13 @@ function LeftMenuLinkContainer({ plugins, ...rest }) {
// Check if the plugins list is empty or not and display plugins by name // Check if the plugins list is empty or not and display plugins by name
const pluginsLinks = !isEmpty(plugins) ? ( const pluginsLinks = !isEmpty(plugins) ? (
map(sortBy(plugins, 'name'), plugin => { map(sortBy(plugins, 'name'), plugin => {
if (plugin.id !== 'email' && plugin.id !== 'content-manager') { const shouldInjectPlugin = plugin.mainComponent !== null;
if (
plugin.id !== 'email' &&
plugin.id !== 'content-manager' &&
shouldInjectPlugin
) {
const pluginSuffixUrl = plugin.suffixUrl const pluginSuffixUrl = plugin.suffixUrl
? plugin.suffixUrl(plugins) ? plugin.suffixUrl(plugins)
: ''; : '';