-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[TSVB] Fields dropdowns are not populated if one of the indices is missing #77363
Conversation
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 comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Tested and works well! LGTM
Left a comment about translation.
Could you please add more PR description ?
@@ -43,6 +43,10 @@ export function Visualization(props) { | |||
const { visData, model } = props; | |||
// Show the error panel | |||
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.
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:
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.
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
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.
LGTM, tested in chrome
# Conflicts: # src/plugins/vis_type_timeseries/server/plugin.ts
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.
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: |
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.
Reviewed again, LGTM
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.
LGTM! Thank you
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.
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