mirror of
https://github.com/grafana/grafana.git
synced 2025-09-27 21:53:41 +08:00
Explore: fix metric selector for additional rows
- race condition in language provider leads to only one row getting selector options - fixed by always returning the start task promise
This commit is contained in:
@ -95,9 +95,9 @@ class LoggingQueryField extends React.PureComponent<LoggingQueryFieldProps, Logg
|
||||
this.languageProvider
|
||||
.start()
|
||||
.then(remaining => {
|
||||
remaining.map(task => task.then(this.onReceiveMetrics).catch(() => {}));
|
||||
remaining.map(task => task.then(this.onUpdateLanguage).catch(() => {}));
|
||||
})
|
||||
.then(() => this.onReceiveMetrics());
|
||||
.then(() => this.onUpdateLanguage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ class LoggingQueryField extends React.PureComponent<LoggingQueryFieldProps, Logg
|
||||
|
||||
this.languageProvider
|
||||
.fetchLabelValues(targetOption.value)
|
||||
.then(this.onReceiveMetrics)
|
||||
.then(this.onUpdateLanguage)
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
@ -147,7 +147,7 @@ class LoggingQueryField extends React.PureComponent<LoggingQueryFieldProps, Logg
|
||||
}
|
||||
};
|
||||
|
||||
onReceiveMetrics = () => {
|
||||
onUpdateLanguage = () => {
|
||||
Prism.languages[PRISM_SYNTAX] = this.languageProvider.getSyntax();
|
||||
const { logLabelOptions } = this.languageProvider;
|
||||
this.setState({
|
||||
|
Reference in New Issue
Block a user