mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
feat(explore): new datasets have autocomplete filters enabled if UX_BETA is set (#15864)
* feat(explore): new datasets have autocomplete filters enabled if UX_BETA is set * Lint fix * Set autocomplete to True in example datasets * Use "IN" as a default operator in dnd filters * Default operator only if UX_BETA enabled
This commit is contained in:
committed by
GitHub
parent
019e74652d
commit
3f5237a3c1
@@ -17,12 +17,19 @@
|
||||
* under the License.
|
||||
*/
|
||||
import React, { useEffect, useMemo, useState } from 'react';
|
||||
import { logging, SupersetClient, t, Metric } from '@superset-ui/core';
|
||||
import {
|
||||
FeatureFlag,
|
||||
isFeatureEnabled,
|
||||
logging,
|
||||
Metric,
|
||||
SupersetClient,
|
||||
t,
|
||||
} from '@superset-ui/core';
|
||||
import { ColumnMeta } from '@superset-ui/chart-controls';
|
||||
import { Tooltip } from 'src/components/Tooltip';
|
||||
import {
|
||||
Operators,
|
||||
OPERATOR_ENUM_TO_OPERATOR_TYPE,
|
||||
Operators,
|
||||
} from 'src/explore/constants';
|
||||
import { OptionSortType } from 'src/explore/types';
|
||||
import {
|
||||
@@ -304,9 +311,14 @@ export const DndFilterSelect = (props: DndFilterSelectProps) => {
|
||||
sqlExpression: (droppedItem as AdhocMetric)?.translateToSql(),
|
||||
});
|
||||
}
|
||||
return new AdhocFilter({
|
||||
const config: Partial<AdhocFilter> = {
|
||||
subject: (droppedItem as ColumnMeta)?.column_name,
|
||||
});
|
||||
};
|
||||
if (isFeatureEnabled(FeatureFlag.UX_BETA)) {
|
||||
config.operator = OPERATOR_ENUM_TO_OPERATOR_TYPE[Operators.IN].operation;
|
||||
config.operatorId = Operators.IN;
|
||||
}
|
||||
return new AdhocFilter(config);
|
||||
}, [droppedItem]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -427,7 +427,7 @@ const AdhocFilterEditPopoverSimpleTabContent: React.FC<Props> = props => {
|
||||
>
|
||||
{suggestions.map((suggestion: string) => (
|
||||
<Select.Option value={suggestion} key={suggestion}>
|
||||
{suggestion}
|
||||
{String(suggestion)}
|
||||
</Select.Option>
|
||||
))}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user