Allow specifying the groupBy feature #13857
ds-onv
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey Payload Team & Contributors!
I would like to propose an enhancement to the
groupBy
feature for collection list views:Currently, the
groupBy
property in a collection'sadmin
configuration accepts a boolean to enable the grouping UI. I propose extending this functionality in two ways:Problem & Motivation
In many use cases, there is a primary field that is the most logical grouping criterion. Requiring users to manually select this field adds a repetitive step. Setting a default would improve the user experience by presenting a more organized view immediately.
Furthermore, not all fields are suitable for grouping. Allowing every field to appear in the group-by dropdown can clutter the UI with irrelevant options (e.g., grouping by a unique fields like ids, descriptions... is not useful). Limiting the available options would guide the payload users and make the interface cleaner.
By allowing a default field and a list of allowed fields to be set, we can:
Proposed Solution
I suggest the
groupBy
property be enhanced to accept a string for a default field, an array of strings for allowed fields, or an object to specify both.Current Implementation:
The
groupBy
property only enables the feature.Proposed Implementation:
The
groupBy
property could be expanded to offer more granular control.Specify a default field:
Specify allowed fields for grouping:
Combine both using an object (most flexible):
This structure could maintain backward compatibility. If
groupBy
istrue
, the current behavior persists. The new options would provide a small but powerful improvement to the admin UI's usability and developer control.Thank you for your time and for considering this feature request.
Beta Was this translation helpful? Give feedback.
All reactions