feat: Add on-demand federated API discovery UI with async task management and result rendering#1383
feat: Add on-demand federated API discovery UI with async task management and result rendering#1383DinithEdirisinghe wants to merge 12 commits into
Conversation
… API management portal
…ton is there in the publisher UI
…d import functionality
… publisher portal
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
on.demand.federated.api.discovery.UI.mp4 |



Summary
This PR introduces the Publisher Portal UI for the on-demand federated API discovery feature. It enables users to manually trigger API discovery from external gateways (AWS, Azure, Apigee, Kong), monitor the async discovery task status, review discovered APIs categorized as NEW or UPDATE, and selectively import or update them into WSO2 API Manager.
File Changes
package.jsonFixed the
build:prod,build:dev, andanalysisnpm scripts to correctly usecross-envfor setting environment variables. The original scripts used a semicolon (;) to separate thecross-envprefix from the build command chain, which caused the environment variable to be silently dropped before the build ran on all platforms. The fix brings these scripts in line with the pattern already used by the devportal portal.package-lock.jsonUpdated the lockfile reflecting dependency resolution changes — added the optional
fsevents(macOS file watcher) entry and removed a stale@types/reactpeer dependency nested underswagger-ui-react. These are standard lockfile reconciliation changes.en.jsonAdded localization strings for all new UI elements introduced by the federated API discovery feature, including labels for the discover button, task status messages (PENDING, COMPLETED, FAILED), table column headers, import/update action buttons, and empty-state messages.
Apis.jsxAdded the client-side route definition for the new discovery page (
/apis/discover), wiring it to theDiscoverAPIscomponent so users can navigate to it within the Publisher SPA.DiscoverAPIs.jsx(new file)The top-level page component for the on-demand discovery flow. Handles environment selection, triggers the
POST /federated-apis/discoverREST call, polls the task status endpoint, reads cached results from the DB-backed cache endpoint, and passes categorized API lists (NEW / UPDATE) down toDiscoveryResults.DiscoveryResults.jsx(new file)The main results display component. Renders discovered APIs in a tabbed view separating NEW and UPDATE categories, with a data table showing API name, version, context, gateway type, and status badge. Provides per-row and bulk checkboxes to select APIs for import or update, and calls the respective
POST /federated-apis/importandPOST /federated-apis/updateendpoints on confirmation.DiscoverAPIsCard.jsx(new file)A landing page card component for the "Discover APIs" entry point. Displayed on the Publisher landing page alongside existing cards like "Create API" and "Import API". Includes an icon, title, and description that routes the user to
/apis/discover.index.jsx(Listing/Landing)Added the
DiscoverAPIsCardto the Publisher portal landing page grid, making the discovery entry point visible to users who have access to federated gateway environments.TopMenu.jsxAdded a "Discover APIs" menu item to the top navigation bar of the API listing view, with appropriate visibility gating via
FederatedAPIDiscoveryRouteGuardso the option only appears for users whose organization has external gateway environments configured.ApisSection.jsxUpdated the Publisher landing APIs section to include the new discover card alongside the existing create and import options.
FederatedAPIDiscoveryRouteGuard.jsx(new file)A shared route guard component that conditionally renders its children only when the Publisher settings response includes at least one external gateway environment. Used to hide discovery-related UI elements for organizations that have no federated gateways configured, preventing confusion.