[DASHBOARDS] Add default order by and date granularity when choosing field#16143
Merged
bosiraphael merged 2 commits intomainfrom Nov 27, 2025
Merged
Conversation
Contributor
Greptile OverviewGreptile SummaryRefactors chart field selection to automatically set default
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Dropdown as ChartGroupByFieldSelectionDropdownContentBase
participant Util as buildChartGroupByFieldConfigUpdate
participant Hook as useUpdateCurrentWidgetConfig
participant Store as Widget Config Store
User->>Dropdown: Select field from dropdown
Dropdown->>Dropdown: handleSelectField(fieldMetadataItem)
Dropdown->>Util: buildChartGroupByFieldConfigUpdate({configuration, keys, fieldId})
alt Primary Axis
Util->>Util: Set primaryAxisOrderBy = FIELD_ASC (if not exists)
Util->>Util: Set primaryAxisDateGranularity = DAY (if not exists)
else Secondary Axis (Bar Chart)
Util->>Util: Set secondaryAxisOrderBy = FIELD_ASC (if not exists)
Util->>Util: Set secondaryAxisGroupByDateGranularity = DAY (if not exists)
Util->>Util: Set groupMode = STACKED (if not exists)
else Secondary Axis (Line Chart)
Util->>Util: Set secondaryAxisOrderBy = FIELD_ASC (if not exists)
Util->>Util: Set secondaryAxisGroupByDateGranularity = DAY (if not exists)
Util->>Util: Set isStacked = true (if not exists)
else Pie Chart GroupBy
Util->>Util: Set orderBy = FIELD_ASC (if not exists)
Util->>Util: Set dateGranularity = DAY (if not exists)
end
Util-->>Dropdown: Return config update object
Dropdown->>Hook: updateCurrentWidgetConfig(configToUpdate)
Hook->>Store: Update widget configuration
Store-->>User: Chart updates with default ordering and date granularity
|
...es/command-menu/pages/page-layout/utils/__tests__/buildChartGroupByFieldConfigUpdate.test.ts
Show resolved
Hide resolved
Contributor
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:34242 This environment will automatically shut down when the PR is closed or after 5 hours. |
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.
QA
CleanShot.2025-11-27.at.15.55.50.mp4
CleanShot.2025-11-27.at.15.57.44.mp4