Skip to content

Admin site related records - #33

Merged
itsharrykim merged 5 commits into
mainfrom
admin-site-related-records
Jun 30, 2026
Merged

Admin site related records#33
itsharrykim merged 5 commits into
mainfrom
admin-site-related-records

Conversation

@itsharrykim

@itsharrykim itsharrykim commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces enhancements to the admin interface's handling and display of relation (edge) fields for Ent models. It adds richer metadata for relations, improves UI/UX for navigating related records, and refines field configuration and discovery. The most important changes are summarized below.

Relation Field Metadata and Discovery

  • Extended FieldConfig to include relation metadata: Relation, RelationTarget, and RelationMany, allowing the admin UI to better understand and display entity relationships.
  • Improved relation field extraction in extractRelationFields by determining the target type and cardinality (one/many) using the new relationTargetFromEdgeType helper. [1] [2]
  • Added tests to ensure that relation metadata is correctly discovered and preserved for both directions of entity relationships. [1] [2]

Field Configuration Improvements

  • Added a Column field to FieldConfig and logic to compute the database column name from struct tags or field names, ensuring more accurate field mapping. [1] [2] [3]

Admin UI/UX Enhancements

  • Updated the grid and record drawer views to render relation fields as links to related records, improving navigation between related entities. [1] [2]
  • Added a "related filter chip" UI component and logic to indicate and clear when a grid is filtered by a related record, and hid the "Add record" button in such cases to prevent context confusion. [1] [2] [3] [4] [5] [6] [7] [8]

Styling Updates

  • Added and refined CSS classes for relation links and filter chips to provide a consistent and accessible visual style for relation navigation elements. [1] [2] [3] [4]

Miscellaneous

  • Added an optional QueryModifier hook to ModelConfig for customizing Ent queries, supporting more advanced data loading scenarios. [1] [2]

These changes collectively improve the admin experience for working with related data, making relationships clearer and navigation more intuitive.

@itsharrykim itsharrykim added the enhancement New feature or request label Jun 30, 2026
@itsharrykim itsharrykim linked an issue Jun 30, 2026 that may be closed by this pull request
@itsharrykim
itsharrykim merged commit baf261d into main Jun 30, 2026
1 check passed
@itsharrykim
itsharrykim deleted the admin-site-related-records branch June 30, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

admin site - can't see related records

1 participant