DamianPendrak commented on code in PR #40000:
URL: https://github.com/apache/superset/pull/40000#discussion_r3254306389
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx:
##########
@@ -93,7 +93,11 @@ export const applyTimeGrainAllowlist = (
allowedTimeGrains: string[] | undefined,
results: ChartDataResponseResult[],
): ChartDataResponseResult[] => {
- if (filterType !== 'filter_timegrain' || !allowedTimeGrains?.length) {
+ if (
+ (filterType !== 'filter_timegrain' &&
+ filterType !== 'chart_customization_timegrain') ||
+ !allowedTimeGrains?.length
+ ) {
Review Comment:
Verified - if dashboard already has a time grain selected that is outside
the pre-filter allowlist, `applyTimeGrainAllowlist` will remove it silently.
That can be confusing for users
##########
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx:
##########
@@ -1297,7 +1297,9 @@ const FiltersConfigForm = (
</CollapsibleControl>
</FormItem>
)}
- {itemTypeField === 'filter_timegrain' &&
+ {(itemTypeField === 'filter_timegrain' ||
+ itemTypeField ===
+ 'chart_customization_timegrain') &&
hasDataset &&
Review Comment:
+1
When the time grain has a saved allowlist, opening the edit modal shows the
pre-filter control as unchecked with no selected grains.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]