mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CloudMonitoring: Prevent resource type variable function from crashing (#30901)
* check if label response has resource type prop * use nullish coalescing operator
This commit is contained in:
@@ -150,7 +150,7 @@ export class CloudMonitoringVariableQueryEditor extends PureComponent<Props, Var
|
||||
selectedMetricType,
|
||||
...(await this.getLabels(selectedMetricType, this.state.projectName)),
|
||||
};
|
||||
this.setState(state);
|
||||
this.setState(state, () => this.onPropsChange());
|
||||
}
|
||||
|
||||
async onMetricTypeChange(metricType: string) {
|
||||
@@ -158,7 +158,7 @@ export class CloudMonitoringVariableQueryEditor extends PureComponent<Props, Var
|
||||
selectedMetricType: metricType,
|
||||
...(await this.getLabels(metricType, this.state.projectName)),
|
||||
};
|
||||
this.setState(state);
|
||||
this.setState(state, () => this.onPropsChange());
|
||||
}
|
||||
|
||||
onLabelKeyChange(labelKey: string) {
|
||||
|
||||
Reference in New Issue
Block a user