-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TSVB] Fields dropdowns are not populated if one of the indices is missing #77363
Changes from 3 commits
14cd01c
5cc1b79
031e90b
1c0b314
89de6fa
91e9e5d
3524b27
557776e
5ff70cd
39c5c20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,10 @@ | |
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import { uniqBy } from 'lodash'; | ||
import { uniqBy, get } from 'lodash'; | ||
import { first, map } from 'rxjs/operators'; | ||
import { KibanaRequest, RequestHandlerContext } from 'kibana/server'; | ||
|
||
// @ts-ignore | ||
import { getIndexPatternObject } from './vis_data/helpers/get_index_pattern'; | ||
import { indexPatterns } from '../../../data/server'; | ||
import { Framework } from '../plugin'; | ||
import { IndexPatternFieldDescriptor, IndexPatternsFetcher } from '../../../data/server'; | ||
|
@@ -73,7 +71,13 @@ export async function getFields( | |
.toPromise(); | ||
}, | ||
}; | ||
const { indexPatternString } = await getIndexPatternObject(reqFacade, indexPattern); | ||
let indexPatternString = indexPattern; | ||
|
||
if (!indexPatternString) { | ||
const index = await reqFacade.getUiSettingsService().get('defaultIndex'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will return a default index id, e.x. You could literally go with
or you could use the data plugin |
||
indexPatternString = get(index, 'title', ''); | ||
} | ||
|
||
const { | ||
searchStrategy, | ||
capabilities, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to use translations here:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, updated the PR and its description