[TSVB] Fields dropdowns are not populated if one of the indices is missing#77363
[TSVB] Fields dropdowns are not populated if one of the indices is missing#77363DianaDerevyankina merged 10 commits intoelastic:masterfrom
Conversation
| let indexPatternString = indexPattern; | ||
|
|
||
| if (!indexPatternString) { | ||
| const index = await reqFacade.getUiSettingsService().get('defaultIndex'); |
There was a problem hiding this comment.
This will return a default index id, e.x. ff959d40-b880-11e8-a6d9-e546fe2bba5f.
To receive an index title, you should get an actual index via saveObjectsClient service as in getIndexPatternObject helper
You could literally go with
if (!indexPatternString) {
const object = await getIndexPatternObject(reqFacade, indexPattern);
indexPatternString = object.indexPatternString;
}
or you could use the data plugin indexPatternsService, where there are getDefaut function to retrieve the default index directly. I think this is a better variant.
sulemanof
left a comment
There was a problem hiding this comment.
Tested and works well! LGTM
Left a comment about translation.
Could you please add more PR description ?
| const error = _.get(visData, `${model.id}.error`); | ||
| if (_.get(error, 'error.type') === 'index_not_found_exception') { | ||
| const index = _.get(error, 'error.index'); | ||
| error.message = `Index "${index}" is missing`; |
There was a problem hiding this comment.
Would be great to use translations here:
| error.message = `Index "${index}" is missing`; | |
| error.message = i18n.translate('visTypeTimeseries.error.missingIndexErrorMessage', { | |
| defaultMessage: 'Index {index} is missing', | |
| values: { index } | |
| }); |
There was a problem hiding this comment.
Sure, updated the PR and its description
stratoula
left a comment
There was a problem hiding this comment.
LGTM, tested in chrome
# Conflicts: # src/plugins/vis_type_timeseries/server/plugin.ts
sulemanof
left a comment
There was a problem hiding this comment.
Tested again after resolving the merge conflict. LGTM 👍
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
|
@elasticmachine merge upstream |
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
lizozom
left a comment
There was a problem hiding this comment.
LGTM
Linking the docs on allow_no_indices for reference on what this parameter does.
…ssing (elastic#77363) * Fields dropdowns are not populated if one of the indices is missing * Fix tests and accept api changes * Add indexPatternsService to get default index pattern * Replace simple error message string with i18n translation * Remove unnecessary displaying error code Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…ssing (#77363) (#78123) * Fields dropdowns are not populated if one of the indices is missing * Fix tests and accept api changes * Add indexPatternsService to get default index pattern * Replace simple error message string with i18n translation * Remove unnecessary displaying error code Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* master: (45 commits) [CSM] Use stacked chart for page views (elastic#78042) [Enterprise Search] Fix various plugin states when app has error connecting to Enterprise Search (elastic#78091) Remove service map beta badge (elastic#78039) [Enterprise Search] Rename "telemetry" to "stats" (elastic#78124) [Alerting] optimize calculation of unmuted alert instances (elastic#78021) call .destroy on ace when react component unmounts (elastic#78132) [Ingest Manager] Fix agent action acknowledgement (elastic#78089) [Upgrade Assistant] Rename "telemetry" to "stats" (elastic#78127) [Security Solution] Refactor Hosts Kpi to use Search Strategy (elastic#77606) Bump backport to 5.6.0 (elastic#78097) [Actions] adds a Test Connector tab in the Connectors list (elastic#77365) [Uptime] Improve ping chart axis (elastic#77992) [TSVB] Fields dropdowns are not populated if one of the indices is missing (elastic#77363) [UiActions] Remove duplicate apply filter action (elastic#77485) [APM] Use transaction metrics for transaction error rate (elastic#78009) [ES-ARCHIVER] Fix bug when query flag is empty (elastic#77983) Edit UI text strings in Integrations and Fleet tabs (elastic#75837) [baseline capture] switch to large workers (elastic#78109) [SECURITY_SOLUTION] list UI is backwards compatible (elastic#77956) [Mappings editor] Add support for point field type (elastic#77543) ...
Closes #73987
Summary
It's a fix for the issue of not populated dropdown fields when comma-separated index patterns contain a missing index
If one or some of the index patterns are missing, the time field dropdown shows fields for the other existent index patterns
Visualization with the time field chosen:
Checklist
Delete any items that are not applicable to this PR.
For maintainers