Active Modules

Active Modules

Starting from version 2026.3.0, the admin UI dynamically hides navigation items for inactive modules. This is powered by the useActiveModules composable.

How it works

  1. During app initialization (initGlobalSettings), the admin fetches the list of active modules from the backend /modules endpoint.
  2. The module list is cached in localStorage under the key CACHE_KEY_ACTIVE_MODULES.
  3. Navigation items annotated with a module field are filtered: only items whose module is active are shown.

Module annotations

Navigation items in navigation.js and module-specific navigation-config.js files can include a module field:

{
    title: 'nav.a.posts',
    icon: 'post',
    to: { name: 'post-manage' },
    module: 'Content',       // hidden when Content module is inactive
}

Current module annotations

Navigation ItemModule
PostsContent
ContactsContent
ProductsProduct
OrdersEcommerce
Real EstateRealEstate
EducationEducation
GameGame

Composable API

import { useActiveModules } from '@/composables/useActiveModules'

const { isModuleActive, fetchAndCacheActiveModules, activeModuleSet } = useActiveModules()

// Check if a module is active (case-insensitive)
isModuleActive('Education')  // true or false
isModuleActive('education')  // same result

// Force refresh from backend
await fetchAndCacheActiveModules()

// O(1) lookup via computed Set
activeModuleSet.value.has('CONTENT')

Backend endpoint

The admin calls GET /v2/admin/modules to retrieve the active module list. The response is an array of module objects with at minimum a name field.

Caching behavior

  • Modules are fetched once during app initialization.
  • Cached in localStorage to avoid repeated API calls on page refresh.
  • Cache is refreshed when the user explicitly triggers a module activation change in settings.

Module name matching

Module names are compared case-insensitively. Use the canonical module name (e.g., Content, Education, RealEstate) when annotating navigation items.