From 2d5813f4ed7c537ebd7276b1d27b31a46cd8a389 Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Fri, 19 Feb 2021 14:30:00 -0700 Subject: [PATCH 1/4] Set index pattern limit to 1000 --- .../ui/index_pattern_select/index_pattern_select.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx b/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx index 96e7a6d83d2d2..c4c8cd8580685 100644 --- a/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx +++ b/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx @@ -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 { + static defaultProps = { + maxIndexPatterns: 1000, + }; + private isMounted: boolean = false; state: IndexPatternSelectState; @@ -103,7 +108,10 @@ export default class IndexPatternSelect extends Component { 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. From c2b54b2407e9615016484ab11e9bc765672cdc4b Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Mon, 22 Feb 2021 10:53:55 -0700 Subject: [PATCH 2/4] Docs updates --- .../kibana-plugin-plugins-data-public.indexpatternselectprops.md | 1 + src/plugins/data/public/public.api.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselectprops.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselectprops.md index 5cfd5e1bc9929..80f4832ba5643 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselectprops.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselectprops.md @@ -12,5 +12,6 @@ export declare type IndexPatternSelectProps = Required void; + maxIndexPatterns?: number; }; ``` diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index 36e34479ad2d1..394fb182a1490 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -1531,6 +1531,7 @@ export type IndexPatternSelectProps = Required, '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) From ece064a0d60a7566926ec1b8ccc3db9034a37156 Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Wed, 24 Feb 2021 09:05:52 -0700 Subject: [PATCH 3/4] Fix typo. Replace equals with colon --- .../public/ui/index_pattern_select/index_pattern_select.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx b/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx index c4c8cd8580685..7d629954ad25e 100644 --- a/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx +++ b/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx @@ -42,8 +42,8 @@ interface IndexPatternSelectState { // Needed for React.lazy // eslint-disable-next-line import/no-default-export export default class IndexPatternSelect extends Component { - static defaultProps = { - maxIndexPatterns: 1000, + static defaultProps: { + maxIndexPatterns: 1000 }; private isMounted: boolean = false; From 7349132aa738e74b473736deacc185b7a214a0fa Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Wed, 24 Feb 2021 11:05:25 -0700 Subject: [PATCH 4/4] Linting fix --- .../public/ui/index_pattern_select/index_pattern_select.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx b/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx index 7d629954ad25e..aa36323d11bcc 100644 --- a/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx +++ b/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx @@ -43,7 +43,7 @@ interface IndexPatternSelectState { // eslint-disable-next-line import/no-default-export export default class IndexPatternSelect extends Component { static defaultProps: { - maxIndexPatterns: 1000 + maxIndexPatterns: 1000; }; private isMounted: boolean = false;