grafana/public/app/features/explore/QueryRows.tsx
Andreas Opferkuch 827f99f0cb
Prometheus: Refresh query field metrics on data source change (#24116)
... 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
2020-05-04 10:17:57 +02:00

30 lines
739 B
TypeScript

// Libraries
import React, { PureComponent } from 'react';
// Components
import QueryRow from './QueryRow';
// Types
import { Emitter } from 'app/core/utils/emitter';
import { ExploreId } from 'app/types/explore';
interface QueryRowsProps {
className?: string;
exploreEvents: Emitter;
exploreId: ExploreId;
queryKeys: string[];
}
export default class QueryRows extends PureComponent<QueryRowsProps> {
render() {
const { className = '', exploreEvents, exploreId, queryKeys } = this.props;
return (
<div className={className}>
{queryKeys.map((_, index) => {
return <QueryRow key={index} exploreEvents={exploreEvents} exploreId={exploreId} index={index} />;
})}
</div>
);
}
}