-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Technical debt - remove default_index_pattern and default_timefield from model #95925
Conversation
74daefb
to
e2c3d3b
Compare
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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
Pinging @elastic/kibana-app (Team:KibanaApp) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
const visFields = await fetchFields(indexPatterns); | ||
|
||
this.setState((state) => ({ | ||
defaultIndex: index, | ||
model: { | ||
...state.model, |
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.
I think that now can be simplifed to:
this.setState({
defaultIndex: index,
visFields,
});
You don't change something to model, so no need to update it, if I understand the code correctly
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.
good point! thank you
41dd230
to
809841d
Compare
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 it locally and it seems that everything works fine
@elasticmachine run elasticsearch-ci/docs |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @alexwizp |
…field from model (elastic#95925) * [TSVB] Technical debt - remove default_index_pattern and default_timefield from model * Update vis_editor.tsx Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…field from model (#95925) (#96385) * [TSVB] Technical debt - remove default_index_pattern and default_timefield from model * Update vis_editor.tsx Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
After saving TSVB rendering, two extra properties appear in the model:
default_index_pattern
,default_timefield
This is due to the fact that we get the default index in the parent component and then pass it through the model. It's wrong and this PR fix that.