mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* add create and add buttons that will be linked to enterprise * wip * wip * clean up * Co-authored-by: Travis Patterson <masslessparticle@gmail.com> Added Query Modal that can be accessed from enterprise. * reset docs * reset docs * docs changing * docs * docs * unexporting props * added generic ways to add more query actions and create actions * cleanup * adding internal tag * adding onAddQuery to props so actions can add queries * created a single query action component * adding partial to query * casting dataquery Co-authored-by: Travis Patterson <travis.patterson@grafana.com>
33 lines
801 B
TypeScript
33 lines
801 B
TypeScript
import { DataQuery, TimeRange } from '@grafana/data';
|
|
|
|
interface ActionComponentProps {
|
|
query?: DataQuery;
|
|
queries?: Array<Partial<DataQuery>>;
|
|
onAddQuery?: (q: DataQuery) => void;
|
|
timeRange?: TimeRange;
|
|
}
|
|
|
|
type QueryActionComponent = React.ComponentType<ActionComponentProps>;
|
|
|
|
class QueryActionComponents {
|
|
extraRenderActions: QueryActionComponent[] = [];
|
|
|
|
addExtraRenderAction(extra: QueryActionComponent) {
|
|
this.extraRenderActions = this.extraRenderActions.concat(extra);
|
|
}
|
|
|
|
getAllExtraRenderAction(): QueryActionComponent[] {
|
|
return this.extraRenderActions;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @internal and experimental
|
|
*/
|
|
export const GroupActionComponents = new QueryActionComponents();
|
|
|
|
/**
|
|
* @internal and experimental
|
|
*/
|
|
export const RowActionComponents = new QueryActionComponents();
|