You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add UiScriptProvider for custom admin console pages - #54586
Introduce a declarative-ui SPI that exposes a nav item and dynamically
imports a Java-declared ES module, mounting the returned element with
realm, i18n, and adminClient context.
Closeskeycloak#54583
Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The effect omits providerId from its dependencies, so switching between providers with the same module URL leaves the previous element mounted and skips the new page’s factory.
Adds script-backed admin console pages to the experimental declarative UI extension system, allowing providers to supply custom interfaces without forking the console.
Changes:
Introduces the feature-gated ui-script SPI and exposes module URLs through Server Info.
Adds Configure navigation and routes for script-backed pages.
Dynamically imports modules, mounts their returned elements, and removes them on exit.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Test coverage is missing for Server Info provider metadata and feature gating, and for asynchronous script mounting, context passing, and cleanup during navigation.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Test async UI mounting and navigation cleanup
js/apps/admin-ui/src/page/ScriptPage.tsx:58
The new asynchronous mounting lifecycle has no admin UI test coverage. Add a test with a controllable module import that verifies the context passed to the module, removal of its element on navigation away, and prevention of mounting when navigation occurs before the import completes.
Add Server Info coverage for declarative UI providers
The new Server Info serialization branch has no test registering a UiScriptProviderFactory; the existing ServerInfoTest exercises configured providers instead. Add integration coverage under tests/ that verifies the provider ID and metadata.url with declarative-ui enabled, and verifies that the SPI is absent when the feature is disabled.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Erik Jan de Wit <edewit@redhat.com>
Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Automated coverage is missing for module-loading context, cleanup, and stale imports, as well as feature-gated UI script provider discovery and serialization.
} else if (pi instanceof UiScriptProviderFactory scriptFactory) {
ComponentTypeRepresentation rep = new ComponentTypeRepresentation();
rep.setId(pi.getId());
Map<String, Object> metadata = new HashMap<>();
metadata.put("url", scriptFactory.getUrl());
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UiScriptProvider/ui-scriptSPI under the experimentaldeclarative-uifeature for nav items backed by a dynamically imported ES modulecomponentTypeswithmetadata.urldefault({ realm, i18n, adminClient })on navigate and unmounts on leaveCloses #54583