PhoenixKit.Dashboard.AdminTabs (phoenix_kit v2.52.2)

Copy Markdown View Source

Default admin navigation tabs for PhoenixKit.

Defines all admin sidebar navigation items as Tab structs. These are registered in the Dashboard Registry during initialization and can be customized by parent applications via config.

Summary

Functions

Applies module_tab_order/0 to module tabs: a listed top-level tab takes core's priority (and group, where given); subtabs and unlisted tabs are returned unchanged.

Returns core admin tabs (always present, gated only by permission).

Returns the default admin tab groups.

Returns all default admin tabs.

Whether the Website Integrations subtab is visible — the user holds the website-wide integrations_system key. The personal integrations key no longer factors in here; that UI moved to the profile settings page.

Core's default sidebar position (:priority, and :group where it changes) for the top-level tabs of known feature modules, keyed by tab id.

Returns feature module admin tabs (collected from ModuleRegistry).

Returns settings admin tabs.

Visibility function for the Settings parent tab. Returns true if user has "settings" permission or any sub-module permission.

Functions

apply_module_tab_order(tabs)

@spec apply_module_tab_order([PhoenixKit.Dashboard.Tab.t()]) :: [
  PhoenixKit.Dashboard.Tab.t()
]

Applies module_tab_order/0 to module tabs: a listed top-level tab takes core's priority (and group, where given); subtabs and unlisted tabs are returned unchanged.

Public so the ordering can be tested as the pure function it is — this is the exact step module_tabs/0 applies to ModuleRegistry.all_admin_tabs/0.

core_tabs()

@spec core_tabs() :: [PhoenixKit.Dashboard.Tab.t()]

Returns core admin tabs (always present, gated only by permission).

default_groups()

@spec default_groups() :: [PhoenixKit.Dashboard.Group.t()]

Returns the default admin tab groups.

default_tabs()

@spec default_tabs() :: [PhoenixKit.Dashboard.Tab.t()]

Returns all default admin tabs.

integrations_visible?(scope)

@spec integrations_visible?(map()) :: boolean()

Whether the Website Integrations subtab is visible — the user holds the website-wide integrations_system key. The personal integrations key no longer factors in here; that UI moved to the profile settings page.

module_tab_order()

@spec module_tab_order() :: %{required(atom()) => map()}

Core's default sidebar position (:priority, and :group where it changes) for the top-level tabs of known feature modules, keyed by tab id.

module_tabs()

@spec module_tabs() :: [PhoenixKit.Dashboard.Tab.t()]

Returns feature module admin tabs (collected from ModuleRegistry).

settings_tabs()

@spec settings_tabs() :: [PhoenixKit.Dashboard.Tab.t()]

Returns settings admin tabs.

Core settings (General, Organization, Users, Media) are hardcoded here. Feature module settings subtabs are collected from the ModuleRegistry.

settings_visible?(scope)

@spec settings_visible?(map()) :: boolean()

Visibility function for the Settings parent tab. Returns true if user has "settings" permission or any sub-module permission.