sadpandajoe opened a new pull request, #43146:
URL: https://github.com/apache/superset/pull/43146
### SUMMARY
On a chart's Explore control panel (Table chart and others sharing the
`timeComparisonControls` section), selecting **Custom date** for **Time
shift**
and then clicking the `x` on **Shift start date** to clear it correctly
raises
a "date required" validation error. However, switching **Time shift** to a
different preset afterward (e.g. *1 week ago*) did not clear that error — it
stayed stuck, blocking further chart updates until a full page refresh.
The `start_date_offset` control's `mapStateToProps` derives its validation
error from a sibling control's value (`time_compare`), but the control config
never declared `validationDependencies: ['time_compare']`. The Explore
reducer's `SET_FIELD_VALUE` handler only re-runs a control's
`mapStateToProps`
for the control that changed or for controls that declare it as a
`validationDependencies` entry, so `start_date_offset` was never re-validated
when `time_compare` changed.
This adds the missing `validationDependencies: ['time_compare']` declaration,
mirroring the existing `validationDependencies: ['server_pagination']`
pattern already used for a different control in the Table chart's control
panel.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: Time shift = Custom date → clear Shift start date (error appears,
correctly) → change Time shift to a preset (e.g. "1 week ago") → error
persists and the chart cannot be updated until the page is refreshed.
After: same steps → the error clears as soon as Time shift changes away from
"Custom date", and the chart can be updated immediately.
(Evidence to follow as a PR update.)
### TESTING INSTRUCTIONS
1. Create or open a Table chart in Explore.
2. Expand **Time Comparison**, set **Time shift** to **Custom date**.
3. Click the `x` on **Shift start date** to clear it — a "date required"
error
appears (expected).
4. Change **Time shift** to any other preset (e.g. "1 week ago").
5. Confirm the error clears immediately and the chart can be updated without
a
page refresh.
A reducer-level regression test covering this exact clear-then-switch
sequence
was added at `superset-frontend/src/explore/reducers/exploreReducer.test.ts`.
### ADDITIONAL INFORMATION
- [ ] 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]