Skip to content

[Admin] Add ability to show/hide content related to BE #4508

Description

@ya092

Overview

Introduce an adminApiEnabled feature flag to control access to Admin API-dependent functionality throughout the application.

The flag is derived from the presence of DIAL_ADMIN_API_URL and ensures that Admin API features are consistently hidden, disabled, and inaccessible when the Admin API is not configured.

Changes

Feature Flag

  • Add adminApiEnabled to FeatureFlags.
  • Set the flag based on whether DIAL_ADMIN_API_URL is configured.

Menu Configuration

  • Hide the following menu groups when Admin API is disabled:
    • Entities
    • Builders
    • Access Management
  • Hide the Activity Audit menu item when Admin API is disabled.
  • Preserve the existing behavior and independence of:
    • deploymentsEnabled
    • evaluationEnabled
    • analyticsEnabled
    • analyticsConversationsEnabled

Menu Actions

  • Hide Import config and Export config when Admin API is disabled.
  • Apply the same restriction to both expanded and collapsed menu action bars.
  • Keep System properties available regardless of the Admin API flag.
  • Preserve the existing isReadOnlyAdmin restrictions.

Footer and Status Polling

  • Disable application status polling when Admin API is disabled.
  • Disable core version polling when Admin API is disabled.
  • Prevent both the initial API calls and recurring setInterval calls from being started.
  • Hide the Footer when Admin API is disabled.

Route Guards

Add server-side route guards that redirect to the Home route when DIAL_ADMIN_API_URL is not configured.

The guard is added to the following Admin API-dependent routes:

Entities

  • Models
  • Applications
  • Interceptors
  • Toolsets
  • Routes

Builders

  • Adapters
  • Application Runners
  • Interceptor Templates

Access Management

  • Roles
  • Keys

Other Admin API functionality

  • Activity Audit
  • Import Config
  • Export Config

Expected Behavior

When DIAL_ADMIN_API_URL is configured:

  • All existing Admin API functionality remains available.
  • Existing menu, footer, and polling behavior is preserved.

When DIAL_ADMIN_API_URL is not configured:

  • Admin API-related navigation and actions are hidden.
  • Admin API status/version polling is disabled.
  • The Footer is hidden.
  • Direct access to Admin API-dependent routes redirects to Home.

This provides consistent Admin API feature gating across the UI, background API calls, and server-side routing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew requested features or functional improvements to existing components.to-be-documentedTasks or features that require documentation but have not yet been covered.

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions