Ujjwaljain16 commented on code in PR #44237:
URL: https://github.com/apache/superset/pull/44237#discussion_r4005548221
##########
superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx:
##########
@@ -179,45 +180,47 @@ export default function DateFilterLabel(props:
DateFilterControlProps) {
setValidTimeRange(true);
return;
}
- fetchTimeRange(value).then(({ value: actualRange, error }) => {
- if (error) {
- setEvalResponse(error || '');
- setValidTimeRange(false);
- setTooltipTitle(t(value) || null);
- } else {
- /*
- HRT == human readable text
- ADR == actual datetime range
- +--------------+------+----------+--------+----------+-----------+
- | | Last | Previous | Custom | Advanced | No Filter |
- +--------------+------+----------+--------+----------+-----------+
- | control pill | HRT | HRT | ADR | ADR | HRT |
- +--------------+------+----------+--------+----------+-----------+
- | tooltip | ADR | ADR | HRT | HRT | ADR |
- +--------------+------+----------+--------+----------+-----------+
- */
- if (
- guessedFrame === 'Common' ||
- guessedFrame === 'Calendar' ||
- guessedFrame === 'Current' ||
- guessedFrame === 'No filter'
- ) {
- setActualTimeRange(value);
- setTooltipTitle(
- getTooltipTitle(labelIsTruncated, value, actualRange),
- );
+ fetchTimeRange(value, 'col', undefined, displayFormat).then(
+ ({ value: actualRange, error }) => {
Review Comment:
Good catch — this was real. Fixed by tracking a monotonic request id
(useRef) and ignoring any fetchTimeRange response that's no longer the latest
one. Pushed in 99bf4a7.
##########
superset-frontend/src/filters/components/Time/TimeFilterPlugin.tsx:
##########
@@ -131,6 +131,7 @@ export default function TimeFilterPlugin(props:
PluginFilterTimeProps) {
unsetFocusedFilter();
}}
isOverflowingFilterBar={isOverflowingFilterBar}
+ displayFormat={props.formData.displayFormat}
Review Comment:
You're right — the extension registry keeps its own separate copy of
DateFilterControlProps in ui-overrides/types.ts, and displayFormat was missing
from it. Added there too, in 99bf4a7.
--
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]