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

Plugin Extensions: Custom limits for extensions-per-plugin #69430

Merged
merged 5 commits into from
Jun 2, 2023

Conversation

leventebalogh
Copy link
Contributor

Related issue: #69297
Authors: @jackw, @leventebalogh

Preface

Until now we were always limiting the extensions per plugins to 2, regardless of the extension point. We figured that this is something that varies by what we are trying to extend, and it should be the extension point that decides how many extensions it allows from the same plugin.

What changed?

We are not limiting the number of extensions by default, and return all of them unless the extension point specifies a limit explicitly.

// No limit set  -> All extensions
const { extensions } = getPluginExtensions({
    extensionPointId: PluginExtensionPoints.DashboardPanelMenu,
    context: {},
});

// Limiting -> Only return the first 2 extensions for every plugin
const { extensions } = getPluginExtensions({
    extensionPointId: PluginExtensionPoints.DashboardPanelMenu,
    context: {},
    limitPerPlugin: 2,
});

Copy link
Contributor

@mckn mckn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great work on this 🙌🏻

@leventebalogh leventebalogh merged commit 7b2bd48 into main Jun 2, 2023
16 checks passed
@leventebalogh leventebalogh deleted the extensions-placement-limit branch June 2, 2023 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants