Increase index pattern select limit to 1000 (#92093)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Aaron Caldwell 2021-02-24 18:01:11 -05:00 committed by GitHub
parent 0280d5a92b
commit 91d03f0c45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View file

@ -12,5 +12,6 @@ export declare type IndexPatternSelectProps = Required<Omit<EuiComboBoxProps<any
indexPatternId: string;
fieldTypes?: string[];
onNoIndexPatterns?: () => void;
maxIndexPatterns?: number;
};
```

View file

@ -1531,6 +1531,7 @@ export type IndexPatternSelectProps = Required<Omit<EuiComboBoxProps<any>, 'isLo
indexPatternId: string;
fieldTypes?: string[];
onNoIndexPatterns?: () => void;
maxIndexPatterns?: number;
};
// Warning: (ae-missing-release-tag) "IndexPatternSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)

View file

@ -25,6 +25,7 @@ export type IndexPatternSelectProps = Required<
indexPatternId: string;
fieldTypes?: string[];
onNoIndexPatterns?: () => void;
maxIndexPatterns?: number;
};
export type IndexPatternSelectInternalProps = IndexPatternSelectProps & {
@ -41,6 +42,10 @@ interface IndexPatternSelectState {
// Needed for React.lazy
// eslint-disable-next-line import/no-default-export
export default class IndexPatternSelect extends Component<IndexPatternSelectInternalProps> {
static defaultProps: {
maxIndexPatterns: 1000;
};
private isMounted: boolean = false;
state: IndexPatternSelectState;
@ -103,7 +108,10 @@ export default class IndexPatternSelect extends Component<IndexPatternSelectInte
debouncedFetch = _.debounce(async (searchValue: string) => {
const { fieldTypes, onNoIndexPatterns, indexPatternService } = this.props;
const indexPatterns = await indexPatternService.find(`${searchValue}*`, 100);
const indexPatterns = await indexPatternService.find(
`${searchValue}*`,
this.props.maxIndexPatterns
);
// We need this check to handle the case where search results come back in a different
// order than they were sent out. Only load results for the most recent search.