how to add jalali date picker in filters with extension ? #43094
Replies: 2 comments 7 replies
|
Hi @shomidrashidi! I'm Dosu and I'm helping the Apache Superset team. Your registration code is structurally correct — 1. The Check the browser console when you open a dashboard with a Time filter. If you don't see your pip install ./superset-core ./superset-extensions-cli2. Duplicate
To verify: your code already logs 3. Props mismatch
interface DateFilterControlProps {
name: string;
onChange: (timeRange: string) => void;
value?: string;
onOpenPopover?: () => void;
onClosePopover?: () => void;
overlayStyle?: 'Modal' | 'Popover';
isOverflowingFilterBar?: boolean;
}If your component crashes on these props, React may swallow the error silently and render nothing. Debugging steps:
To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
|
cannot way for add jalali date picker extension to filters ? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I want to add a Jalali date filter as an extension to Superset.
I created a extension with superset-extensions cmd and added jalali date picker to project extension.
I build and get supx file and add to supperset extension folder but not show jalali date picker in filters.
frontend/src/index.tsx::
`
import { getExtensionsRegistry } from '@superset-ui/core';
import PersianDateRange from './PersianDateRange';
console.log(
'🔥 [PersianDateRange] extension loaded',
);
const registry = getExtensionsRegistry();
/*
any.*/
type DateFilterExtensionRegistry = {
set(
key: 'filter.dateFilterControl',
value: typeof PersianDateRange,
): void;
get(
key: 'filter.dateFilterControl',
): typeof PersianDateRange | undefined;
};
const dateFilterRegistry =
registry as unknown as DateFilterExtensionRegistry;
console.log(
'🔥 [PersianDateRange] registering filter.dateFilterControl',
);
dateFilterRegistry.set(
'filter.dateFilterControl',
PersianDateRange,
);
console.log(
'🔥 [PersianDateRange] registered:',
dateFilterRegistry.get(
'filter.dateFilterControl',
),
);
`
All reactions