Skip to content

Commit

Permalink
fix(filter-picker): add defaultOperationsOption on FilterCondition (#…
Browse files Browse the repository at this point in the history
…1773)

Co-authored-by: maxin <maxin@growingio.com>
  • Loading branch information
nnmax and maxin committed Jan 6, 2022
1 parent 6b41a98 commit 127648b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/legacy/filter-picker/FilterPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Dropdown from '../dropdown';
import defaultLocaleTextObject from './locales/zh-CN';
import './style';

const defaultOperationsOption: operationsOptionType = {
export const defaultOperationsOption: operationsOptionType = {
string: ['=', '!=', 'in', 'not in', 'like', 'not like', 'hasValue', 'noValue'],
int: ['=', '!=', '>', '>=', '<', '<=', 'between', 'not between', 'hasValue', 'noValue'],
double: ['=', '!=', '>', '>=', '<', '<=', 'between', 'not between', 'hasValue', 'noValue'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { attributeValue, FilterValueType, StringValue, NumberValue, DateValue }
import Selector from '../../../../../selector-pro';
import { ListValue, operationsOptionType } from '../../../../interfaces';
import Tooltip from '../../../../../../tooltip'; // new
import { FilterPickerContext, TextObject } from '../../../../FilterPicker';
import { defaultOperationsOption, FilterPickerContext, TextObject } from '../../../../FilterPicker';
import defaultLocaleTextObject from '../../../../locales/zh-CN';

interface FilterConditionProps {
Expand Down Expand Up @@ -95,7 +95,7 @@ function FilterCondition(props: FilterConditionProps) {
curryDimensionValueRequest={curryDimensionValueRequest}
values={values}
exprKey={exprKey}
operationsOption={operationsOption}
operationsOption={{ ...defaultOperationsOption, ...operationsOption }}
numType={numType}
/>
);
Expand Down

1 comment on commit 127648b

@vercel
Copy link

@vercel vercel bot commented on 127648b Jan 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.