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

   ### SUMMARY
   Adds a new native filter plugin, **Date range filter**, that renders a plain 
calendar date-range picker (AntD `RangePicker`, date-only — no time-of-day 
input) with no other range-type UI (no No filter / Advanced / Relative / 
Previous tabs). It's registered as its own filter type (`filter_date_range`) 
alongside the existing Time Range filter, so existing dashboards/filters are 
unaffected — teams that only need a bare calendar picker can add this filter 
type instead.
   
   It follows the same UI-only pattern as the existing Time filter 
(`filter_time`): no `buildQuery`, and on change it emits a standard 
`time_range` `extraFormData` value (`"YYYY-MM-DD : YYYY-MM-DD"`), so it is 
compatible with the backend's existing `time_range` `QueryObject` filter 
handling — no backend changes required.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before: no native filter type offers a date-only calendar picker — the only 
calendar-based option is the Time Range filter, which always shows a date+time 
input and a No filter/Advanced/Relative/Previous picker.
   
   After: a new "Date range filter" type is selectable in the native filter's 
"Filter Type" dropdown, rendering only a plain calendar range picker.
   
   ### TESTING INSTRUCTIONS
   1. `docker compose up` (or run the frontend dev server) and open any 
dashboard as an admin.
   2. Open "Add or edit filters and controls" > "+ New" > "Add filter".
   3. Set Filter Type to "Date range filter", give it a name, save.
   4. Confirm the filter bar renders a plain calendar date-range control (Start 
date / End date, no time-of-day fields) with no other range-type options.
   5. Pick a date range and apply — confirm dependent charts scoped to this 
filter re-query and their data changes accordingly (verified manually against 
the sample Sales Dashboard: selecting Jan 2024 filtered "Total Products Sold" 
from 99.1k to 2.04k).
   6. `npx jest src/filters/components/DateRange` — unit tests for the 
date-range parsing/formatting utilities pass.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration
   - [x] 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