From e273403dd0695ac3c442875d21be33e25901b707 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Thu, 27 Jul 2017 10:34:36 -0700 Subject: [PATCH] Temp: comment out and mock getIndices functionality. --- .../create_index_pattern_wizard.js | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js index 05a12c5509737..82c14ad458222 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js @@ -104,6 +104,36 @@ uiModules.get('apps/management') let mostRecentFetchMatchingIndicesRequest; this.fetchMatchingIndices = () => { + this.isFetchingMatchingIndices = true; + + // Default to searching for all indices. + const exactSearchQuery = this.formValues.name; + let partialSearchQuery = this.formValues.name; + + if (!_.endsWith(partialSearchQuery, '*')) { + partialSearchQuery = `${partialSearchQuery}*`; + } + if (!_.startsWith(partialSearchQuery, '*')) { + partialSearchQuery = `*${partialSearchQuery}`; + } + + const thisFetchMatchingIndicesRequest = mostRecentFetchMatchingIndicesRequest = Promise.all([ + createReasonableWait(), + ]) + .then(([ + ]) => { + if (thisFetchMatchingIndicesRequest === mostRecentFetchMatchingIndicesRequest) { + const matchingIndicesResponse = [{ name: 'logstash-0' }, { name: '.kibana' }]; + const partialMatchingIndicesResponse = [{ name: 'logstash-0' }, { name: '.kibana' }]; + matchingIndices = matchingIndicesResponse.sort(); + partialMatchingIndices = partialMatchingIndicesResponse.sort(); + updateWhiteListedIndices(); + this.isFetchingMatchingIndices = false; + } + }).catch(error => { + notify.error(error); + }); + /** this.isFetchingMatchingIndices = true; @@ -140,6 +170,22 @@ uiModules.get('apps/management') }; this.fetchExistingIndices = () => { + this.isFetchingExistingIndices = true; + const allExistingLocalAndRemoteIndicesPattern = '*,*:*'; + + Promise.all([ + createReasonableWait(), + ]) + .then(([]) => { + const allIndicesResponse = [{ name: 'logstash-0' }, { name: '.kibana' }]; + // Cache all indices. + allIndices = allIndicesResponse.sort(); + updateWhiteListedIndices(); + this.isFetchingExistingIndices = false; + }).catch(error => { + notify.error(error); + }); + /** this.isFetchingExistingIndices = true; const allExistingLocalAndRemoteIndicesPattern = '*,*:*';