[Dashboards] Relation fields groupby#16093
Merged
Conversation
Contributor
Greptile OverviewGreptile SummaryThis PR adds support for grouping charts by relation fields (MANY_TO_ONE only), including nested composite fields within relations (e.g., Key Changes:
Implementation Notes:
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant DropdownBase as ChartGroupByFieldSelectionDropdownContentBase
participant RelationView as ChartGroupByFieldSelectionRelationFieldView
participant CompositeView as ChartGroupByFieldSelectionCompositeFieldView
participant Utils as Utility Functions
participant Config as Widget Config
User->>DropdownBase: Select Group By Field
alt Field is Relation (MANY_TO_ONE)
DropdownBase->>RelationView: Navigate to relation field view
RelationView->>RelationView: Fetch target object metadata
RelationView->>RelationView: Filter available subfields<br/>(exclude system, relations, dates)
User->>RelationView: Select subfield
alt Subfield is Composite
RelationView->>CompositeView: Navigate to composite view
User->>CompositeView: Select composite subfield
CompositeView->>RelationView: Return "fieldName.subFieldName"
else Subfield is Scalar
RelationView->>DropdownBase: Return subfield name
end
DropdownBase->>Config: Update with field ID + subfield name
else Field is Composite
DropdownBase->>CompositeView: Navigate to composite view
User->>CompositeView: Select composite subfield
CompositeView->>DropdownBase: Return subfield name
DropdownBase->>Config: Update with field ID + subfield name
else Field is Scalar
DropdownBase->>Config: Update with field ID only
end
Config->>Utils: generateGroupByQueryVariables()
Utils->>Utils: buildGroupByFieldObject()<br/>(handles nested relations)
Utils->>Utils: getGroupByOrderBy()
Utils->>Utils: getFieldOrderBy()<br/>(dispatches by field type)
alt Field is Relation with Subfield
Utils->>Utils: getRelationFieldOrderBy()<br/>(builds nested structure)
end
Utils-->>Config: GraphQL query variables
|
...e-layout/widgets/graph/utils/generateGroupByQueryVariablesFromBarOrLineChartConfiguration.ts
Outdated
Show resolved
Hide resolved
Contributor
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:25967 This environment will automatically shut down when the PR is closed or after 5 hours. |
bosiraphael
reviewed
Nov 27, 2025
...e-layout/widgets/graph/utils/generateGroupByQueryVariablesFromBarOrLineChartConfiguration.ts
Outdated
Show resolved
Hide resolved
bosiraphael
approved these changes
Nov 27, 2025
Contributor
bosiraphael
left a comment
There was a problem hiding this comment.
LGTM, just remove the double dropdown closure
...es/page-layout/components/dropdown-content/ChartGroupByFieldSelectionDropdownContentBase.tsx
Outdated
Show resolved
Hide resolved
Contributor
|
Thanks @ehconitin for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.