mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
refactor: add frontend debounce constants (#13250)
This commit is contained in:
@@ -22,7 +22,11 @@ import { FormControl } from 'react-bootstrap';
|
||||
import { Column } from 'react-table';
|
||||
import debounce from 'lodash/debounce';
|
||||
|
||||
import { BOOL_FALSE_DISPLAY, BOOL_TRUE_DISPLAY } from 'src/constants';
|
||||
import {
|
||||
BOOL_FALSE_DISPLAY,
|
||||
BOOL_TRUE_DISPLAY,
|
||||
SLOW_DEBOUNCE,
|
||||
} from 'src/constants';
|
||||
import Button from 'src/components/Button';
|
||||
import {
|
||||
applyFormattingToTabularData,
|
||||
@@ -67,7 +71,7 @@ export const FilterInput = ({
|
||||
}: {
|
||||
onChangeHandler(filterText: string): void;
|
||||
}) => {
|
||||
const debouncedChangeHandler = debounce(onChangeHandler, 500);
|
||||
const debouncedChangeHandler = debounce(onChangeHandler, SLOW_DEBOUNCE);
|
||||
return (
|
||||
<FormControl
|
||||
placeholder={t('Search')}
|
||||
|
||||
@@ -27,8 +27,9 @@ import {
|
||||
} from '@superset-ui/chart-controls';
|
||||
import { debounce } from 'lodash';
|
||||
import { matchSorter, rankings } from 'match-sorter';
|
||||
import { ExploreActions } from '../actions/exploreActions';
|
||||
import Control from './Control';
|
||||
import { FAST_DEBOUNCE } from 'src/constants';
|
||||
import { ExploreActions } from 'src/explore/actions/exploreActions';
|
||||
import Control from 'src/explore/components/Control';
|
||||
|
||||
interface DatasourceControl extends ControlConfig {
|
||||
datasource?: DatasourceMeta;
|
||||
@@ -162,7 +163,7 @@ export default function DataSourcePanel({
|
||||
String(a.rankedValue).localeCompare(b.rankedValue),
|
||||
}),
|
||||
});
|
||||
}, 200);
|
||||
}, FAST_DEBOUNCE);
|
||||
|
||||
useEffect(() => {
|
||||
setList({
|
||||
|
||||
@@ -22,11 +22,12 @@ import { FormGroup, FormControl } from 'react-bootstrap';
|
||||
import { debounce } from 'lodash';
|
||||
import { t } from '@superset-ui/core';
|
||||
|
||||
import { FAST_DEBOUNCE } from 'src/constants';
|
||||
import Button from 'src/components/Button';
|
||||
import { TextAreaEditor } from 'src/components/AsyncAceEditor';
|
||||
import ModalTrigger from 'src/components/ModalTrigger';
|
||||
|
||||
import ControlHeader from '../ControlHeader';
|
||||
import ControlHeader from 'src/explore/components/ControlHeader';
|
||||
|
||||
const propTypes = {
|
||||
name: PropTypes.string,
|
||||
@@ -63,7 +64,7 @@ export default class TextAreaControl extends React.Component {
|
||||
super();
|
||||
this.onAceChangeDebounce = debounce(value => {
|
||||
this.onAceChange(value);
|
||||
}, 300);
|
||||
}, FAST_DEBOUNCE);
|
||||
}
|
||||
|
||||
onControlChange(event) {
|
||||
|
||||
Reference in New Issue
Block a user