mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Cloudwatch: Fixed crash when switching from cloudwatch data source (#21376)
This commit is contained in:
parent
b4fa27b8a4
commit
f774c4a076
@ -28,8 +28,8 @@ const idValidationEvents: ValidationEvents = {
|
||||
export class QueryEditor extends PureComponent<Props, State> {
|
||||
state: State = { regions: [], namespaces: [], metricNames: [], variableOptionGroup: {}, showMeta: false };
|
||||
|
||||
componentWillMount() {
|
||||
const { query } = this.props;
|
||||
static getDerivedStateFromProps(props: Props, state: State) {
|
||||
const { query } = props;
|
||||
|
||||
if (!query.namespace) {
|
||||
query.namespace = '';
|
||||
@ -66,6 +66,8 @@ export class QueryEditor extends PureComponent<Props, State> {
|
||||
if (!query.hasOwnProperty('matchExact')) {
|
||||
query.matchExact = true;
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
Loading…
Reference in New Issue
Block a user