[ES|QL] [Controls] Fixes fields values not available after editing#268102
[ES|QL] [Controls] Fixes fields values not available after editing#268102stratoula wants to merge 5 commits into
Conversation
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
|
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
| source_esql_query: schema.maybe( | ||
| schema.string({ | ||
| meta: { | ||
| description: | ||
| 'The ES|QL query the control was created from. Not evaluated at runtime; persisted only so the available identifiers list (e.g. fields) can be repopulated when the control is edited.', | ||
| }, | ||
| }) | ||
| ), | ||
| }, |
There was a problem hiding this comment.
I'm not sure this is the right approach. By adding it to the user-facing API schema like this, it is up to the user who makes the control to copy paste the query from some other ES|QL query into this and then we somehow have to keep these values up-to-date... Not good!
Instead, I wonder if we could use the related panels logic once that merges in order to determine which query to use at runtime? Especially with my suggested approach - if we move the related panels logic into the ES|QL control like I suggested, we could pretty easily know which ES|QL query is using the field control variable at runtime, which we could then use to populate the suggested options dropdown. What do you think @stratoula?
cc @Zacqary here, too
There was a problem hiding this comment.
yeah I see what you say and I hear it. I am fine with fixing it the way you suggest Hannah. I am going to close this PR but can you please handle it? It is a bad regression and I dont like it 🙏
Summary
This PR #259670 created a regression. When now you try to edit a fields control, the dropdown doesnt depict the available values.
BEFORE
The FIELDS controls have a legitimate need to remember the source query, and add it back deliberately. This PR is fixing it.
NOW
Note: Existing fields controls with the problem will still not show the list.
Checklist