mirror of
https://github.com/apache/superset.git
synced 2026-07-18 20:55:47 +00:00
feat: Adds the ECharts Histogram chart (#28652)
This commit is contained in:
committed by
GitHub
parent
bc9eab9902
commit
896fe854dc
@@ -74,6 +74,7 @@ interface ColumnSelectPopoverProps {
|
||||
label: string;
|
||||
isTemporal?: boolean;
|
||||
setDatasetModal?: Dispatch<SetStateAction<boolean>>;
|
||||
disabledTabs?: Set<string>;
|
||||
}
|
||||
|
||||
const getInitialColumnValues = (
|
||||
@@ -102,6 +103,7 @@ const ColumnSelectPopover = ({
|
||||
onClose,
|
||||
setDatasetModal,
|
||||
setLabel,
|
||||
disabledTabs = new Set<'saved' | 'simple' | 'sqlExpression'>(),
|
||||
}: ColumnSelectPopoverProps) => {
|
||||
const datasourceType = useSelector<ExplorePageState, string | undefined>(
|
||||
state => state.explore.datasource.type,
|
||||
@@ -299,7 +301,11 @@ const ColumnSelectPopover = ({
|
||||
width: ${width}px;
|
||||
`}
|
||||
>
|
||||
<Tabs.TabPane key="saved" tab={t('Saved')}>
|
||||
<Tabs.TabPane
|
||||
key="saved"
|
||||
tab={t('Saved')}
|
||||
disabled={disabledTabs.has('saved')}
|
||||
>
|
||||
{calculatedColumns.length > 0 ? (
|
||||
<FormItem label={savedExpressionsLabel}>
|
||||
<StyledSelect
|
||||
@@ -375,7 +381,11 @@ const ColumnSelectPopover = ({
|
||||
/>
|
||||
)}
|
||||
</Tabs.TabPane>
|
||||
<Tabs.TabPane key="simple" tab={t('Simple')}>
|
||||
<Tabs.TabPane
|
||||
key="simple"
|
||||
tab={t('Simple')}
|
||||
disabled={disabledTabs.has('simple')}
|
||||
>
|
||||
{isTemporal && simpleColumns.length === 0 ? (
|
||||
<EmptyStateSmall
|
||||
image="empty.svg"
|
||||
@@ -419,7 +429,11 @@ const ColumnSelectPopover = ({
|
||||
)}
|
||||
</Tabs.TabPane>
|
||||
|
||||
<Tabs.TabPane key="sqlExpression" tab={t('Custom SQL')}>
|
||||
<Tabs.TabPane
|
||||
key="sqlExpression"
|
||||
tab={t('Custom SQL')}
|
||||
disabled={disabledTabs.has('sqlExpression')}
|
||||
>
|
||||
<SQLEditor
|
||||
value={
|
||||
adhocColumn?.sqlExpression ||
|
||||
|
||||
@@ -36,6 +36,7 @@ interface ColumnSelectPopoverTriggerProps {
|
||||
closePopover?: () => void;
|
||||
children: React.ReactNode;
|
||||
isTemporal?: boolean;
|
||||
disabledTabs?: Set<string>;
|
||||
}
|
||||
|
||||
const defaultPopoverLabel = t('My column');
|
||||
@@ -48,6 +49,7 @@ const ColumnSelectPopoverTrigger = ({
|
||||
isControlledComponent,
|
||||
children,
|
||||
isTemporal,
|
||||
disabledTabs,
|
||||
...props
|
||||
}: ColumnSelectPopoverTriggerProps) => {
|
||||
// @ts-ignore
|
||||
@@ -108,6 +110,7 @@ const ColumnSelectPopoverTrigger = ({
|
||||
setLabel={setPopoverLabel}
|
||||
getCurrentTab={getCurrentTab}
|
||||
isTemporal={isTemporal}
|
||||
disabledTabs={disabledTabs}
|
||||
/>
|
||||
</ExplorePopoverContent>
|
||||
),
|
||||
|
||||
@@ -37,6 +37,7 @@ import { DndControlProps } from './types';
|
||||
export type DndColumnSelectProps = DndControlProps<QueryFormColumn> & {
|
||||
options: ColumnMeta[];
|
||||
isTemporal?: boolean;
|
||||
disabledTabs?: Set<string>;
|
||||
};
|
||||
|
||||
function DndColumnSelect(props: DndColumnSelectProps) {
|
||||
@@ -50,6 +51,7 @@ function DndColumnSelect(props: DndColumnSelectProps) {
|
||||
name,
|
||||
label,
|
||||
isTemporal,
|
||||
disabledTabs,
|
||||
} = props;
|
||||
const [newColumnPopoverVisible, setNewColumnPopoverVisible] = useState(false);
|
||||
|
||||
@@ -121,6 +123,7 @@ function DndColumnSelect(props: DndColumnSelectProps) {
|
||||
}}
|
||||
editedColumn={column}
|
||||
isTemporal={isTemporal}
|
||||
disabledTabs={disabledTabs}
|
||||
>
|
||||
<OptionWrapper
|
||||
key={idx}
|
||||
|
||||
Reference in New Issue
Block a user