mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: adds QueryRowErrors component, moves error display to QueryRow (#22438)
* Explore: adds QueryRowErrors component * Explore: updates QueryRow to use QueryRowErrors component * Explore: updates PromQueryField to remove error render * Explore: updates Elastic query field to remove error render * Explore: updates LokiQueryFieldForm to remove error render * Explore: updates QueryRow component - brings back passing errors down * Explore: removes QueryRowErrors component * Explore: updates ErrorContainer component - moves out data filtering * Explore: updates QueryRow component - changes QueryRowErrors to ErrorContainer * Explore: updates Explore component - adds error filtering for ErrorContainer * Explore: updates ErrorContainer and adds a basic test for it * Explore: updates Explore component props name and adds a basic render test * Explore: adds snapshots for Explore and ErrorContainer * Explore: adds a test for error render * Explore: adds a comment to Explore component explaining the way we filter non-query-row-specific errors * Explore: adds getFirstNonQueryRowSpecificError method to explore utilities * Explore: extracts getFirstNonQueryRowSpecificError method and slightly refactors Explore component * Explore: updates Explore component tests to cover non-query-row-specific errors
This commit is contained in:
@@ -292,12 +292,11 @@ class PromQueryField extends React.PureComponent<PromQueryFieldProps, PromQueryF
|
||||
};
|
||||
|
||||
render() {
|
||||
const { data, query, ExtraFieldElement } = this.props;
|
||||
const { query, ExtraFieldElement } = this.props;
|
||||
const { metricsOptions, syntaxLoaded, hint } = this.state;
|
||||
const cleanText = this.languageProvider ? this.languageProvider.cleanText : undefined;
|
||||
const chooserText = getChooserText(syntaxLoaded, metricsOptions);
|
||||
const buttonDisabled = !(syntaxLoaded && metricsOptions && metricsOptions.length > 0);
|
||||
const showError = data && data.error && data.error.refId === query.refId;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -324,11 +323,6 @@ class PromQueryField extends React.PureComponent<PromQueryFieldProps, PromQueryF
|
||||
</div>
|
||||
{ExtraFieldElement}
|
||||
</div>
|
||||
{showError ? (
|
||||
<div className="query-row-break">
|
||||
<div className="prom-query-field-info text-error">{data.error.message}</div>
|
||||
</div>
|
||||
) : null}
|
||||
{hint ? (
|
||||
<div className="query-row-break">
|
||||
<div className="prom-query-field-info text-warning">
|
||||
|
||||
Reference in New Issue
Block a user