Skip to content

feat(admin): configurable tabs via admin config array #3846

Description

@PierreBrisorgueil

Problem

The admin page (/admin) has hardcoded tabs (Users, Organizations). Downstream projects need to add their own admin tabs (e.g. Costs, Logs, Billing) but currently have to either:

  • Fork admin.view.vue and hardcode new tabs
  • Create separate sidenav items (bad UX — splits admin into multiple nav entries)

Proposed solution

Add an adminTabs array to the admin module config (or the app-level config) that downstream projects can extend:

```js
// config/index.js (downstream project)
admin: {
tabs: [
{ value: 'costs', label: 'Costs', icon: 'fa-solid fa-coins', route: '/admin/costs' },
],
}
```

admin.view.vue reads this config and renders extra tabs alongside the default Users/Organizations tabs.

Expected behavior

  • Default tabs (Users, Organizations) always rendered
  • Extra tabs from config rendered after defaults
  • Each extra tab is a <router-link> / <v-tab :to="tab.route"> pointing to the downstream route
  • Tab hidden if user doesn't have manage UserAdmin ability (same guard as today)
  • No change to existing downstream projects that don't use this config

Acceptance criteria

  • config.admin.tabs array read in admin.view.vue
  • Each entry: { value, label, icon, route }icon optional
  • Tabs rendered as v-tab with <router-link> (or to prop)
  • Falls back gracefully to current behavior when array is empty/undefined
  • Unit test: renders extra tab when config provides one
  • Downstream usage example in devkit docs or comment

Context

First downstream use case: trawl_vue needs a "Costs" tab → /admin/costs (cost tracking per history — D5.5).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions