Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: fix(time_picker): Fix incorrect time range display #17816

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ import { Divider } from 'src/components';
import Icons from 'src/components/Icons';
import Select from 'src/components/Select/Select';
import { Tooltip } from 'src/components/Tooltip';
import { DEFAULT_TIME_RANGE } from 'src/explore/constants';
import {
DEFAULT_TIME_RANGE,
DEFAULT_TIME_RANGE_ENDPOINTS,
} from 'src/explore/constants';
import { useDebouncedEffect } from 'src/explore/exploreUtils';
import { SLOW_DEBOUNCE } from 'src/constants';
import { testWithId } from 'src/utils/testUtils';
Expand Down Expand Up @@ -178,6 +181,7 @@ export const getDateFilterControlTestId = testWithId(
export default function DateFilterLabel(props: DateFilterControlProps) {
const {
value = DEFAULT_TIME_RANGE,
endpoints = DEFAULT_TIME_RANGE_ENDPOINTS,
onChange,
type,
onOpenPopover = noOp,
Expand Down
7 changes: 6 additions & 1 deletion superset-frontend/src/explore/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { t } from '@superset-ui/core';
import { t, TimeRangeEndpoints } from '@superset-ui/core';

export const AGGREGATES = {
AVG: 'AVG',
Expand Down Expand Up @@ -147,6 +147,11 @@ export const TIME_FILTER_MAP = {

// TODO: make this configurable per Superset installation
export const DEFAULT_TIME_RANGE = 'No filter';
// Default time range endpoints [start, end), see SIP-15 #6360 for more info
export const DEFAULT_TIME_RANGE_ENDPOINTS: TimeRangeEndpoints = [
CodeingBoy marked this conversation as resolved.
Show resolved Hide resolved
'inclusive',
'exclusive',
];
export const NO_TIME_RANGE = 'No filter';

export enum FILTER_BOX_MIGRATION_STATES {
Expand Down