While query fields should not rely on getting unmounted when the data source changes (and instead react to that change in e.g. componentDidUpdate()), query fields other than PromQueryField still rely on this.
... in `componentDidUpdate`, not just `componentDidMount`.
Also unify query field behavior of Explore with Dashboard - when the
data source changes, it doesn't unmount but instead refreshes its
metrics.
Fixes#23162
- Queries in Explore have been string based
- This PR introduces the use of the DataQuery type to denote all queries handled in Explore
- Within Explore all handling of DataQueries is transparent
- Modifying DataQueries is left to the datasource
- Using `target` as variable names for DataQueries to be consistent with the rest of Grafana
this is a fix-up PR that cleans up Explore Logging after the recent
restructuring.
- log results need to be merged since query transactions have been
introduced
- logging DS has its own language provider, query field, and start page
(some of them based on prometheus components)
- added loader animation to log viewer
- removed logging logic from prometheus components
- when instantiating a datasource, the datasource service checks if the
plugin module exports Explore components, and if so, attaches them to
the datasource
- Explore component makes all major internal pluggable from a datasource
`exploreComponents` property
- Moved Prometheus query field to promehteus datasource and registered
it as an exported Explore component
- Added new Start page for Explore, also exported from the datasource
Existing querying was grouped together before handed over to the
datasource. This slowed down result display to however long the slowest
query took.
- create one query transaction per result viewer (graph, table, etc.)
and query row
- track latencies for each transaction
- show results as soon as they are being received
- loading indicator on graph and query button to indicate that queries
are still running and that results are incomplete
- properly discard transactions when removing or changing queries
- use react-highlight-words
- add highlighting (color and border) to the matching substring of the
suggested items in the typeahead
- extracted match finding from logging datasource
- created new utils/text.ts class for text-related functions
- added more types
- remove `edited` property of query objects
- query object semantics changes to be initial values only
- resetting or externally modifying a query is done via giving it a new
react key, which replaces the row completely
- query changes while typing are sent up to Explore to be saved in a
local property that is not part of the component state (prevent
control circle)
- all Explore functions using the queries must access the local property
for current values