Skip to content

feat(admin): add Taxonomy Types management page#213

Open
MauricioPerera wants to merge 7 commits intoemdash-cms:mainfrom
MauricioPerera:feat/taxonomy-types-admin
Open

feat(admin): add Taxonomy Types management page#213
MauricioPerera wants to merge 7 commits intoemdash-cms:mainfrom
MauricioPerera:feat/taxonomy-types-admin

Conversation

@MauricioPerera
Copy link
Copy Markdown

@MauricioPerera MauricioPerera commented Apr 4, 2026

Summary

  • Full CRUD admin UI for managing taxonomy definitions (not just terms), similar to Content Types page
  • Custom taxonomy definitions created via API now visible in sidebar with edit/delete UI
  • Dynamic sidebar taxonomy entries fetched from API instead of hardcoded
  • Custom field definitions for taxonomy types using the same FieldEditor dialog UI from content types (14 field types)
  • SEO metadata support for taxonomy terms (title, description, image, canonical, noIndex)
  • Features system for taxonomies (drafts, revisions, preview, search) mirroring content type feature toggles
  • Content visibility system (public/members/private) across all content collections
  • PUT /api/auth/me endpoint for profile self-service

Changes

Server-side (packages/core)

  • New API route GET/PUT/DELETE /_emdash/api/taxonomies/:name for single taxonomy definition operations
  • New handlers handleTaxonomyGet, handleTaxonomyUpdate, handleTaxonomyDelete in taxonomies handler
  • New schema updateTaxonomyDefBody for PUT validation
  • Taxonomy field definitions schema with 14 field types (string, text, number, integer, boolean, datetime, select, multiSelect, image, file, reference, json, url, color) with validation, options, required, widget, defaultValue
  • Term SEO integration with SeoRepository using taxonomy:{name} collection key
  • Content visibility column + filtering on all ec_* content tables
  • PUT /api/auth/me for user profile self-service updates
  • Migrations 033-036: content visibility, taxonomy fields, taxonomy SEO, taxonomy supports

Admin UI (packages/admin)

  • TaxonomyTypeEditor: reuses FieldEditor dialog (2-step: type selection grid → configuration form) from ContentTypeEditor for managing custom fields
  • TaxonomyTypeEditor: features section (drafts, revisions, preview, search, SEO) identical to ContentTypeEditor
  • TaxonomyManager: updated with TaxonomyFieldInput supporting all 14 field types, SEO fields section
  • ContentEditor: visibility dropdown (public/members/private)
  • Sidebar: dynamic taxonomy nav items from API
  • New routes: /taxonomy-types, /taxonomy-types/new, /taxonomy-types/$name

Addresses PR review feedback

  • @tohaitrieu: Custom field definitions on taxonomy types ✅
  • @tohaitrieu: SEO metadata for taxonomy terms ✅

Test plan

  • Navigate to Admin > Taxonomy Types — see list of all taxonomy definitions
  • Create a new custom taxonomy with custom fields using the FieldEditor dialog
  • Verify all 14 field types work in the FieldEditor for taxonomy fields
  • Edit an existing taxonomy — change label, toggle hierarchical, update collections, add/edit/remove fields
  • Toggle features (drafts, revisions, preview, search, SEO) on a taxonomy type
  • Create a term with custom field data and verify it persists
  • Enable SEO on a taxonomy and verify SEO fields appear when editing terms
  • Delete a taxonomy — confirm terms and SEO data are also removed
  • Verify custom taxonomy appears in sidebar after creation
  • Verify content visibility dropdown works on content editor
  • Verify role-based access: only admins see Taxonomy Types

🤖 Generated with Claude Code

Add a full CRUD admin UI for managing taxonomy definitions, similar
to Content Types. Previously, custom taxonomies could only be created
via the API but had no way to be listed, edited, or deleted from the
admin interface.

Changes:
- Add GET/PUT/DELETE API endpoints for single taxonomy definitions
- Add updateTaxonomy/deleteTaxonomy client functions
- Add TaxonomyTypeList and TaxonomyTypeEditor components
- Add /taxonomy-types, /taxonomy-types/new, /taxonomy-types/$name routes
- Add "Taxonomy Types" entry in the Admin sidebar section
- Make taxonomy sidebar entries dynamic (fetched from API)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 4, 2026

⚠️ No Changeset found

Latest commit: 81e952c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@tohaitrieu
Copy link
Copy Markdown

Can you

  • Add the custom fields for Taxonomy Type?
  • Enable SEO for Taxonomy Edit Dialog.

I created Custom Plugin for that.

The confirm dialog remained open after successfully deleting a
taxonomy, causing errors on subsequent clicks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MauricioPerera
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Apr 4, 2026
MauricioPerera and others added 5 commits April 4, 2026 15:17
- Add custom field definitions for taxonomy types using the same FieldEditor
  dialog UI from content types (14 field types with full configuration)
- Add SEO metadata support for taxonomy terms (title, description, image)
- Add features system (drafts, revisions, preview, search) mirroring
  content types feature toggles
- Add content visibility system (public/members/private) across all
  content collections
- Add PUT /api/auth/me endpoint for profile self-service
- Migrations 033-036: content visibility, taxonomy fields, taxonomy SEO,
  taxonomy supports columns

Addresses feedback from PR emdash-cms#213 review (tohaitrieu):
- Custom field definitions on taxonomy types
- SEO metadata for taxonomy terms

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The users table already has a JSON `data` column for extensible user
metadata, but it was not exposed in any API endpoint. Now available in:

- GET /api/auth/me — returns user.data
- PUT /api/auth/me — accepts data (merge with existing keys)
- PUT /api/admin/users/:id — accepts data (admin override)
- GET /api/admin/users/:id — returns user.data
- Response schemas updated to include data field

No migration needed — the column has existed since migration 001.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Backend for custom role definitions with configurable permissions:

- Migration 037: _emdash_role_defs table with 5 built-in roles seeded
- RoleRegistry in-memory cache for custom role permission lookups
- Extended hasPermission() to support custom roles via registry
- Relaxed toRoleLevel() and roleLevel Zod schema for custom levels (1-99)
- CRUD API: GET/POST /api/roles, GET/PUT/DELETE /api/roles/:name
- Built-in roles are protected: cannot delete or change their permissions
- Deleting a custom role reassigns affected users to subscriber
- Admin API client with ALL_PERMISSIONS reference for UI
- Custom metadata fields support (reuses FieldEditor field definitions)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- RoleTypeList: list all roles (built-in + custom) with CRUD actions
- RoleTypeEditor: create/edit roles with permission picker and metadata fields
- RoleBadge: dynamically fetches custom roles for labels and colors
- InviteUserModal, UserDetail, UserList: use dynamic roles in dropdowns
- Sidebar: add Role Types nav entry under Admin section
- Router: add /role-types, /role-types/new, /role-types/$name routes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The /roles and /roles/[name] endpoints were returning 404 because they
were not injected via injectCoreRoutes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

Overlapping PRs

This PR modifies files that are also changed by other open PRs:

This may cause merge conflicts or duplicated work. A maintainer will coordinate.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants