@grafana/async-query-data
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -23,6 +23,7 @@ import React, { useState, useEffect } from 'react'; | ||
}; | ||
const onCancelQuery = () => { | ||
props.onCancelQuery(lastQuery); | ||
const onCancelQuery = props.onCancelQuery ? () => { | ||
var _a; | ||
(_a = props.onCancelQuery) == null ? void 0 : _a.call(props, lastQuery); | ||
setStopping(true); | ||
}; | ||
} : void 0; | ||
const isQueryValid = props.isQueryValid(props.query); | ||
@@ -33,3 +34,3 @@ return /* @__PURE__ */ React.createElement(HorizontalGroup, null, /* @__PURE__ */ React.createElement(Button, { | ||
onClick: onRunQuery | ||
}, running && !stopping ? /* @__PURE__ */ React.createElement(HorizontalGroup, null, /* @__PURE__ */ React.createElement(Spinner, null), " Running") : "Run"), /* @__PURE__ */ React.createElement(Button, { | ||
}, running && !stopping ? /* @__PURE__ */ React.createElement(HorizontalGroup, null, /* @__PURE__ */ React.createElement(Spinner, null), " Running") : "Run"), onCancelQuery && /* @__PURE__ */ React.createElement(Button, { | ||
icon: running ? void 0 : "square-shape", | ||
@@ -36,0 +37,0 @@ disabled: !running || stopping, |
@@ -24,3 +24,3 @@ import { DataQuery, DataSourceJsonData, DataSourceInstanceSettings, DataQueryRequest, DataQueryResponse, LoadingState } from '@grafana/data'; | ||
onRunQuery: () => void; | ||
onCancelQuery: (query: TQuery) => void; | ||
onCancelQuery?: (query: TQuery) => void; | ||
isQueryValid: (query: TQuery) => boolean; | ||
@@ -27,0 +27,0 @@ query: TQuery; |
@@ -672,6 +672,7 @@ 'use strict'; | ||
}; | ||
const onCancelQuery = () => { | ||
props.onCancelQuery(lastQuery); | ||
const onCancelQuery = props.onCancelQuery ? () => { | ||
var _a; | ||
(_a = props.onCancelQuery) == null ? void 0 : _a.call(props, lastQuery); | ||
setStopping(true); | ||
}; | ||
} : void 0; | ||
const isQueryValid = props.isQueryValid(props.query); | ||
@@ -682,3 +683,3 @@ return /* @__PURE__ */ React__default["default"].createElement(ui.HorizontalGroup, null, /* @__PURE__ */ React__default["default"].createElement(ui.Button, { | ||
onClick: onRunQuery | ||
}, running && !stopping ? /* @__PURE__ */ React__default["default"].createElement(ui.HorizontalGroup, null, /* @__PURE__ */ React__default["default"].createElement(ui.Spinner, null), " Running") : "Run"), /* @__PURE__ */ React__default["default"].createElement(ui.Button, { | ||
}, running && !stopping ? /* @__PURE__ */ React__default["default"].createElement(ui.HorizontalGroup, null, /* @__PURE__ */ React__default["default"].createElement(ui.Spinner, null), " Running") : "Run"), onCancelQuery && /* @__PURE__ */ React__default["default"].createElement(ui.Button, { | ||
icon: running ? void 0 : "square-shape", | ||
@@ -685,0 +686,0 @@ disabled: !running || stopping, |
{ | ||
"name": "@grafana/async-query-data", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Async query support for Grafana", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
173311
1418