Skip to content

feat(Native Filters): Time Filter Plugin Redesign #33242

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

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Using ant icons
  • Loading branch information
amaannawab923 committed Apr 25, 2025
commit 53a5143fe94fc7f7a6beffb32e9a600e35ecbd36
10 changes: 0 additions & 10 deletions superset-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@
"json-bigint": "^1.0.0",
"json-stringify-pretty-compact": "^2.0.0",
"lodash": "^4.17.21",
"lucide-react": "^0.503.0",
"luxon": "^3.5.0",
"mapbox-gl": "^2.10.0",
"markdown-to-jsx": "^7.7.4",
Expand Down
6 changes: 6 additions & 0 deletions superset-frontend/src/components/Icons/AntdEnhanced.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {
DatabaseOutlined,
DeleteFilled,
DownSquareOutlined,
DoubleLeftOutlined,
DeleteOutlined,
DownOutlined,
DownloadOutlined,
Expand All @@ -75,6 +76,7 @@ import {
InsertRowBelowOutlined,
LineChartOutlined,
LinkOutlined,
LeftOutlined,
MailOutlined,
MinusCircleOutlined,
LoadingOutlined,
Expand Down Expand Up @@ -111,6 +113,7 @@ import {
UnorderedListOutlined,
WarningOutlined,
KeyOutlined,
DoubleRightOutlined,
} from '@ant-design/icons';
import { FC } from 'react';
import { IconType } from './types';
Expand Down Expand Up @@ -153,6 +156,8 @@ const AntdIcons = {
DeleteOutlined,
DownOutlined,
DownloadOutlined,
DoubleLeftOutlined,
DoubleRightOutlined,
EditOutlined,
EllipsisOutlined,
ExclamationCircleOutlined,
Expand All @@ -173,6 +178,7 @@ const AntdIcons = {
InfoCircleFilled,
InsertRowAboveOutlined,
InsertRowBelowOutlined,
LeftOutlined,
LineChartOutlined,
LinkOutlined,
LoadingOutlined,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useState } from 'react';
// eslint-disable-next-line no-restricted-imports
import { Tabs, Button, Input, Radio } from 'antd';
import { ChevronLeft, ChevronRight, ChevronsRight } from 'lucide-react';
import dayjs, { Dayjs, ManipulateType } from 'dayjs';
import quarterOfYear from 'dayjs/plugin/quarterOfYear';
import { useTheme } from '@superset-ui/core';
import { Icons } from 'src/components/Icons';
import {
FilterContainer,
CalendarGrid,
Expand Down Expand Up @@ -41,24 +41,6 @@ interface DateFilterProps {
onCancel: () => void;
}

const ChevronsLeft = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
className="lucide lucide-chevrons-left-icon lucide-chevrons-left"
>
<path d="m11 17-5-5 5-5" />
<path d="m18 17-5-5 5-5" />
</svg>
);

const DateFilter: React.FC<DateFilterProps> = ({ onApply, onCancel }) => {
const theme = useTheme();
const [mode, setMode] = useState<FilterMode>('absolute');
Expand Down Expand Up @@ -240,23 +222,23 @@ const DateFilter: React.FC<DateFilterProps> = ({ onApply, onCancel }) => {
<CalendarHeader>
<ButtonGroup>
<IconButton
icon={<ChevronsLeft />}
icon={<Icons.DoubleLeftOutlined />}
onClick={() => setCurrentMonth(m => m.subtract(1, 'year'))}
/>
<IconButton
icon={<ChevronLeft />}
icon={<Icons.LeftOutlined />}
onClick={() => setCurrentMonth(m => m.subtract(1, 'month'))}
/>
</ButtonGroup>
<span>{currentMonth.format('MMM YYYY')}</span>
<span>{nextMonth.format('MMM YYYY')}</span>
<ButtonGroup>
<IconButton
icon={<ChevronRight />}
icon={<Icons.RightOutlined />}
onClick={() => setCurrentMonth(m => m.add(1, 'month'))}
/>
<IconButton
icon={<ChevronsRight />}
icon={<Icons.DoubleRightOutlined />}
onClick={() => setCurrentMonth(m => m.add(1, 'year'))}
/>
</ButtonGroup>
Expand Down
Loading