massucattoj opened a new pull request, #40000:
URL: https://github.com/apache/superset/pull/40000

   ### SUMMARY
   The "Pre-filter available values" option configured for Time Grain controls 
only worked when the control was created as a Native Filter. When the same 
control was created as a Display Control (chart
   customization), the configured allowlist was silently dropped — the 
dashboard end user always saw all 14 time grains regardless of what the 
dashboard author had configured.
   
   This regression had three root causes, all in the parallel plumbing that was 
added for chart customizations after the native filter pre-filter feature 
shipped (PR #38922):
   
   1. Form (author side) — The "Pre-filter available values" checkbox is 
rendered in FiltersConfigForm.tsx only when itemTypeField === 
'filter_timegrain'. Display Controls use chart_customization_timegrain and never
    matched, so the checkbox never rendered.
   2. Save (persistence) — Even if the checkbox had rendered, 
customizationTransformer.transformFormInput() did not copy time_grains from the 
form input to the saved ChartCustomization. The native filter equivalent
   (filterTransformer.ts) already does this.
   3. Consumer (read side) — FilterValue.tsx hardcoded allowedTimeGrains = 
undefined for any chart customization, and applyTimeGrainAllowlist 
short-circuited unless filterType === 'filter_timegrain'.
   
   The fix mirrors the existing native filter wiring across all three layers 
and threads the time_grains field through the supporting types 
(ChartCustomization, ChartCustomizationsFormItem,
   PluginFilterTimeGrainCustomizeProps).
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before:
   <img width="901" height="649" alt="Screenshot 2026-05-10 at 13 20 13" 
src="https://github.com/user-attachments/assets/01146dbc-8351-4d3d-84ae-2aaaaf0fbe82";
 />
   
   After:
   <img width="964" height="800" alt="Screenshot 2026-05-10 at 13 48 20" 
src="https://github.com/user-attachments/assets/8e640009-c426-41a8-8fe6-76ff648b75c5";
 />
   
   <img width="954" height="459" alt="Screenshot 2026-05-10 at 13 46 40" 
src="https://github.com/user-attachments/assets/480a4ef5-f66e-48bc-89d5-4b3015dbb63a";
 />
   
   
   ### TESTING INSTRUCTIONS
   1. Open any dashboard and click the Filters and controls gear → Add or edit 
filters and controls.
   2. Click Add display control.
   3. Set:
     - Display control type: Time grain
     - Datasource: any dataset that supports time grains (e.g. birth_names)
     - Display control name: any value
   4. Expand Display control configuration. Verify the "Pre-filter available 
values" checkbox is present (this is the new behavior).
   5. Check the box, pick a subset of grains (e.g. Day and Week), and Save the 
dashboard.
   6. On the dashboard, open the new Time Grain control. Verify the dropdown 
shows only the configured subset.
   7. Edit the control again, leave the checkbox checked but clear all values, 
save. The dropdown should show all grains again (empty allowlist = no 
restriction, same backwards-compat behavior as the native filter).
   8. Repeat steps 1–6 with a Native Filter of type Time Grain and confirm 
there is no regression there.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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]

Reply via email to