mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Improve typings 🧹 (#74599)
* various type fixes * candlestick panel type fixes * few more fixes * some fixes * more :) * moar! * undo change to SilencesFilter * undo change to configureStore
This commit is contained in:
@@ -188,17 +188,12 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Do not use any type assertions.", "8"]
|
[0, 0, 0, "Do not use any type assertions.", "8"]
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/datetime/rangeutil.ts:5381": [
|
"packages/grafana-data/src/datetime/rangeutil.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/datetime/timezones.ts:5381": [
|
"packages/grafana-data/src/datetime/timezones.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/events/EventBus.test.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"packages/grafana-data/src/events/EventBus.ts:5381": [
|
"packages/grafana-data/src/events/EventBus.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||||
@@ -224,10 +219,7 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/field/fieldOverrides.ts:5381": [
|
"packages/grafana-data/src/field/fieldOverrides.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/field/overrides/processors.ts:5381": [
|
"packages/grafana-data/src/field/overrides/processors.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@@ -256,8 +248,7 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "6"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "7"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/geo/layer.ts:5381": [
|
"packages/grafana-data/src/geo/layer.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@@ -277,15 +268,7 @@ exports[`better eslint`] = {
|
|||||||
"packages/grafana-data/src/panel/getPanelOptionsWithDefaults.ts:5381": [
|
"packages/grafana-data/src/panel/getPanelOptionsWithDefaults.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "7"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "8"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "9"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "10"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/panel/registryFactories.ts:5381": [
|
"packages/grafana-data/src/panel/registryFactories.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
@@ -307,16 +290,6 @@ exports[`better eslint`] = {
|
|||||||
"packages/grafana-data/src/transformations/fieldReducer.ts:5381": [
|
"packages/grafana-data/src/transformations/fieldReducer.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/transformations/matchers/predicates.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "7"]
|
|
||||||
],
|
|
||||||
"packages/grafana-data/src/transformations/matchers/valueMatchers/types.ts:5381": [
|
"packages/grafana-data/src/transformations/matchers/valueMatchers/types.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
@@ -334,9 +307,6 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
[0, 0, 0, "Do not use any type assertions.", "3"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "4"]
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/transformations/transformers/ensureColumns.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"packages/grafana-data/src/transformations/transformers/groupBy.ts:5381": [
|
"packages/grafana-data/src/transformations/transformers/groupBy.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
@@ -346,9 +316,7 @@ exports[`better eslint`] = {
|
|||||||
],
|
],
|
||||||
"packages/grafana-data/src/transformations/transformers/histogram.ts:5381": [
|
"packages/grafana-data/src/transformations/transformers/histogram.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/transformations/transformers/joinDataFrames.ts:5381": [
|
"packages/grafana-data/src/transformations/transformers/joinDataFrames.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
@@ -691,12 +659,7 @@ exports[`better eslint`] = {
|
|||||||
"packages/grafana-data/src/utils/location.ts:5381": [
|
"packages/grafana-data/src/utils/location.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
|
||||||
],
|
|
||||||
"packages/grafana-data/src/utils/testdata/testTheme.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/utils/url.ts:5381": [
|
"packages/grafana-data/src/utils/url.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@@ -715,13 +678,10 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
[0, 0, 0, "Do not use any type assertions.", "3"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
[0, 0, 0, "Do not use any type assertions.", "4"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "5"],
|
[0, 0, 0, "Do not use any type assertions.", "5"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "7"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "7"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "8"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "9"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "10"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/vector/AppendedVectors.ts:5381": [
|
"packages/grafana-data/src/vector/AppendedVectors.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@@ -733,23 +693,15 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/vector/AsNumberVector.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
|
||||||
],
|
|
||||||
"packages/grafana-data/src/vector/BinaryOperationVector.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
|
||||||
],
|
|
||||||
"packages/grafana-data/src/vector/CircularVector.ts:5381": [
|
"packages/grafana-data/src/vector/CircularVector.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/vector/ConstantVector.ts:5381": [
|
"packages/grafana-data/src/vector/ConstantVector.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/vector/FormattedVector.ts:5381": [
|
"packages/grafana-data/src/vector/FormattedVector.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/vector/FunctionalVector.ts:5381": [
|
"packages/grafana-data/src/vector/FunctionalVector.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@@ -764,9 +716,6 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "9"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "9"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "10"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "10"]
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/vector/IndexVector.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
|
||||||
],
|
|
||||||
"packages/grafana-data/src/vector/SortedVector.ts:5381": [
|
"packages/grafana-data/src/vector/SortedVector.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
],
|
],
|
||||||
@@ -814,12 +763,7 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "9"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "9"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "10"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "10"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "11"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "11"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "12"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "12"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "13"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "14"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "15"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "16"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "17"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-runtime/src/services/live.ts:5381": [
|
"packages/grafana-runtime/src/services/live.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
@@ -1422,9 +1366,7 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "4"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"]
|
|
||||||
],
|
],
|
||||||
"public/app/core/components/TagFilter/TagOption.tsx:5381": [
|
"public/app/core/components/TagFilter/TagOption.tsx:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
@@ -1456,15 +1398,7 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "7"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "7"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "8"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "8"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "9"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "9"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "10"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "11"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "12"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "13"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "14"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "15"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "16"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "17"]
|
|
||||||
],
|
],
|
||||||
"public/app/core/services/context_srv.ts:5381": [
|
"public/app/core/services/context_srv.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
@@ -1484,9 +1418,7 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
],
|
],
|
||||||
"public/app/core/specs/time_series.test.ts:5381": [
|
"public/app/core/specs/time_series.test.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
|
||||||
],
|
],
|
||||||
"public/app/core/time_series2.ts:5381": [
|
"public/app/core/time_series2.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@@ -1557,9 +1489,6 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
[0, 0, 0, "Do not use any type assertions.", "3"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "4"]
|
||||||
],
|
],
|
||||||
"public/app/core/utils/query.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/core/utils/richHistory.test.ts:5381": [
|
"public/app/core/utils/richHistory.test.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
],
|
],
|
||||||
@@ -1679,12 +1608,6 @@ exports[`better eslint`] = {
|
|||||||
"public/app/features/alerting/unified/AlertsFolderView.test.tsx:5381": [
|
"public/app/features/alerting/unified/AlertsFolderView.test.tsx:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
],
|
],
|
||||||
"public/app/features/alerting/unified/PanelAlertTabContent.test.tsx:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
|
||||||
],
|
|
||||||
"public/app/features/alerting/unified/PanelAlertTabContent.tsx:5381": [
|
"public/app/features/alerting/unified/PanelAlertTabContent.tsx:5381": [
|
||||||
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"]
|
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"]
|
||||||
],
|
],
|
||||||
@@ -1708,10 +1631,6 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||||
],
|
],
|
||||||
"public/app/features/alerting/unified/components/Expression.tsx:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
|
||||||
],
|
|
||||||
"public/app/features/alerting/unified/components/alert-groups/AlertGroupFilter.tsx:5381": [
|
"public/app/features/alerting/unified/components/alert-groups/AlertGroupFilter.tsx:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
],
|
],
|
||||||
@@ -1725,10 +1644,6 @@ exports[`better eslint`] = {
|
|||||||
"public/app/features/alerting/unified/components/contact-points/ContactPoints.v2.tsx:5381": [
|
"public/app/features/alerting/unified/components/contact-points/ContactPoints.v2.tsx:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
],
|
],
|
||||||
"public/app/features/alerting/unified/components/receivers/TemplateForm.tsx:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
|
||||||
],
|
|
||||||
"public/app/features/alerting/unified/components/receivers/form/ChannelOptions.tsx:5381": [
|
"public/app/features/alerting/unified/components/receivers/form/ChannelOptions.tsx:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||||
@@ -1740,10 +1655,6 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "3"]
|
[0, 0, 0, "Do not use any type assertions.", "3"]
|
||||||
],
|
],
|
||||||
"public/app/features/alerting/unified/components/receivers/form/TestContactPointModal.tsx:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
|
||||||
],
|
|
||||||
"public/app/features/alerting/unified/components/receivers/form/fields/OptionField.tsx:5381": [
|
"public/app/features/alerting/unified/components/receivers/form/fields/OptionField.tsx:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||||
@@ -1762,9 +1673,6 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
],
|
],
|
||||||
"public/app/features/alerting/unified/components/rule-editor/AlertRuleForm.tsx:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/alerting/unified/components/rule-editor/AnnotationKeyInput.tsx:5381": [
|
"public/app/features/alerting/unified/components/rule-editor/AnnotationKeyInput.tsx:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
],
|
],
|
||||||
@@ -1780,9 +1688,6 @@ exports[`better eslint`] = {
|
|||||||
"public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx:5381": [
|
"public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx:5381": [
|
||||||
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"]
|
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"]
|
||||||
],
|
],
|
||||||
"public/app/features/alerting/unified/components/rules/RuleDetailsDataSources.tsx:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/alerting/unified/components/silences/SilencesEditor.tsx:5381": [
|
"public/app/features/alerting/unified/components/silences/SilencesEditor.tsx:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
],
|
],
|
||||||
@@ -1795,15 +1700,6 @@ exports[`better eslint`] = {
|
|||||||
"public/app/features/alerting/unified/hooks/useControlledFieldArray.ts:5381": [
|
"public/app/features/alerting/unified/hooks/useControlledFieldArray.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
],
|
],
|
||||||
"public/app/features/alerting/unified/hooks/useFilteredRules.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
|
||||||
],
|
|
||||||
"public/app/features/alerting/unified/hooks/useGroupedAlerts.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "2"]
|
|
||||||
],
|
|
||||||
"public/app/features/alerting/unified/mocks.ts:5381": [
|
"public/app/features/alerting/unified/mocks.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||||
@@ -1825,10 +1721,6 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
],
|
],
|
||||||
"public/app/features/alerting/unified/utils/amroutes.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
|
||||||
],
|
|
||||||
"public/app/features/alerting/unified/utils/misc.test.ts:5381": [
|
"public/app/features/alerting/unified/utils/misc.test.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||||
@@ -1838,9 +1730,7 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/alerting/unified/utils/redux.ts:5381": [
|
"public/app/features/alerting/unified/utils/redux.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@@ -1861,8 +1751,7 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
[0, 0, 0, "Do not use any type assertions.", "3"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
[0, 0, 0, "Do not use any type assertions.", "4"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "5"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/annotations/events_processing.ts:5381": [
|
"public/app/features/annotations/events_processing.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
@@ -1882,19 +1771,16 @@ exports[`better eslint`] = {
|
|||||||
"public/app/features/canvas/runtime/element.tsx:5381": [
|
"public/app/features/canvas/runtime/element.tsx:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
[0, 0, 0, "Do not use any type assertions.", "3"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
[0, 0, 0, "Do not use any type assertions.", "5"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "6"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "7"],
|
[0, 0, 0, "Do not use any type assertions.", "7"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "8"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "8"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "9"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "10"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/canvas/runtime/frame.tsx:5381": [
|
"public/app/features/canvas/runtime/frame.tsx:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/canvas/runtime/root.tsx:5381": [
|
"public/app/features/canvas/runtime/root.tsx:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
@@ -1920,9 +1806,7 @@ exports[`better eslint`] = {
|
|||||||
"public/app/features/dashboard-scene/utils/test-utils.ts:5381": [
|
"public/app/features/dashboard-scene/utils/test-utils.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
[0, 0, 0, "Do not use any type assertions.", "2"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "4"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.test.tsx:5381": [
|
"public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.test.tsx:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
@@ -2078,9 +1962,7 @@ exports[`better eslint`] = {
|
|||||||
],
|
],
|
||||||
"public/app/features/dashboard/components/VersionHistory/utils.ts:5381": [
|
"public/app/features/dashboard/components/VersionHistory/utils.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/dashboard/containers/DashboardPage.tsx:5381": [
|
"public/app/features/dashboard/containers/DashboardPage.tsx:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
@@ -2291,10 +2173,9 @@ exports[`better eslint`] = {
|
|||||||
],
|
],
|
||||||
"public/app/features/dashboard/utils/panelMerge.ts:5381": [
|
"public/app/features/dashboard/utils/panelMerge.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/datasources/components/BasicSettings.tsx:5381": [
|
"public/app/features/datasources/components/BasicSettings.tsx:5381": [
|
||||||
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"]
|
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"]
|
||||||
@@ -2728,9 +2609,6 @@ exports[`better eslint`] = {
|
|||||||
"public/app/features/query/state/DashboardQueryRunner/PublicAnnotationsDataSource.ts:5381": [
|
"public/app/features/query/state/DashboardQueryRunner/PublicAnnotationsDataSource.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
],
|
],
|
||||||
"public/app/features/query/state/DashboardQueryRunner/SnapshotWorker.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/query/state/DashboardQueryRunner/testHelpers.ts:5381": [
|
"public/app/features/query/state/DashboardQueryRunner/testHelpers.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||||
@@ -3076,18 +2954,13 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "5"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
|
[0, 0, 0, "Do not use any type assertions.", "6"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "7"],
|
[0, 0, 0, "Do not use any type assertions.", "7"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "8"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "8"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "9"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "9"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "10"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "11"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "12"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "13"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "14"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/variables/interval/reducer.ts:5381": [
|
"public/app/features/variables/interval/reducer.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
@@ -3109,8 +2982,7 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "9"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "9"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "10"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "10"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "11"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "11"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "12"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "12"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "13"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/variables/pickers/shared/VariableInput.tsx:5381": [
|
"public/app/features/variables/pickers/shared/VariableInput.tsx:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
@@ -3144,8 +3016,7 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "4"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/variables/query/operators.ts:5381": [
|
"public/app/features/variables/query/operators.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@@ -3217,9 +3088,8 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Do not use any type assertions.", "10"],
|
[0, 0, 0, "Do not use any type assertions.", "10"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "11"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "11"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "12"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "12"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "13"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "13"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "14"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "14"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "15"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/variables/state/keyedVariablesReducer.ts:5381": [
|
"public/app/features/variables/state/keyedVariablesReducer.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@@ -3996,9 +3866,7 @@ exports[`better eslint`] = {
|
|||||||
"public/app/plugins/datasource/prometheus/components/PromQueryField.tsx:5381": [
|
"public/app/plugins/datasource/prometheus/components/PromQueryField.tsx:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
[0, 0, 0, "Do not use any type assertions.", "2"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "4"]
|
|
||||||
],
|
],
|
||||||
"public/app/plugins/datasource/prometheus/components/PrometheusMetricsBrowser.tsx:5381": [
|
"public/app/plugins/datasource/prometheus/components/PrometheusMetricsBrowser.tsx:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
@@ -4129,8 +3997,7 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Do not use any type assertions.", "4"]
|
[0, 0, 0, "Do not use any type assertions.", "4"]
|
||||||
],
|
],
|
||||||
"public/app/plugins/datasource/prometheus/querybuilder/binaryScalarOperations.ts:5381": [
|
"public/app/plugins/datasource/prometheus/querybuilder/binaryScalarOperations.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
|
||||||
],
|
],
|
||||||
"public/app/plugins/datasource/prometheus/querybuilder/components/LabelFilterItem.tsx:5381": [
|
"public/app/plugins/datasource/prometheus/querybuilder/components/LabelFilterItem.tsx:5381": [
|
||||||
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"],
|
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"],
|
||||||
@@ -4306,16 +4173,6 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Do not use any type assertions.", "8"],
|
[0, 0, 0, "Do not use any type assertions.", "8"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "9"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "9"]
|
||||||
],
|
],
|
||||||
"public/app/plugins/datasource/tempo/testResponse.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
|
||||||
],
|
|
||||||
"public/app/plugins/datasource/tempo/traceql/TraceQLEditor.tsx:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
|
||||||
],
|
|
||||||
"public/app/plugins/datasource/tempo/traceql/autocomplete.test.ts:5381": [
|
"public/app/plugins/datasource/tempo/traceql/autocomplete.test.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
@@ -4351,9 +4208,6 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
],
|
],
|
||||||
"public/app/plugins/datasource/testdata/components/StreamingClientEditor.tsx:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/plugins/datasource/testdata/datasource.ts:5381": [
|
"public/app/plugins/datasource/testdata/datasource.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
@@ -4366,10 +4220,6 @@ exports[`better eslint`] = {
|
|||||||
"public/app/plugins/datasource/testdata/runStreams.ts:5381": [
|
"public/app/plugins/datasource/testdata/runStreams.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
],
|
],
|
||||||
"public/app/plugins/datasource/testdata/testData/serviceMapResponse.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
|
||||||
],
|
|
||||||
"public/app/plugins/datasource/zipkin/QueryField.tsx:5381": [
|
"public/app/plugins/datasource/zipkin/QueryField.tsx:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||||
@@ -4433,29 +4283,7 @@ exports[`better eslint`] = {
|
|||||||
],
|
],
|
||||||
"public/app/plugins/panel/candlestick/CandlestickPanel.tsx:5381": [
|
"public/app/plugins/panel/candlestick/CandlestickPanel.tsx:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
|
||||||
],
|
|
||||||
"public/app/plugins/panel/candlestick/module.tsx:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "3"]
|
|
||||||
],
|
|
||||||
"public/app/plugins/panel/candlestick/utils.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "5"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "6"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "7"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "8"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "9"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "10"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "11"]
|
|
||||||
],
|
],
|
||||||
"public/app/plugins/panel/canvas/editor/connectionEditor.tsx:5381": [
|
"public/app/plugins/panel/canvas/editor/connectionEditor.tsx:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
@@ -5026,24 +4854,13 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
],
|
],
|
||||||
"public/app/plugins/panel/piechart/suggestions.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
|
||||||
],
|
|
||||||
"public/app/plugins/panel/stat/StatMigrations.ts:5381": [
|
"public/app/plugins/panel/stat/StatMigrations.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "2"]
|
|
||||||
],
|
],
|
||||||
"public/app/plugins/panel/state-timeline/migrations.ts:5381": [
|
"public/app/plugins/panel/state-timeline/migrations.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "5"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "6"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "7"]
|
|
||||||
],
|
],
|
||||||
"public/app/plugins/panel/table-old/column_options.ts:5381": [
|
"public/app/plugins/panel/table-old/column_options.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@@ -5165,24 +4982,15 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "7"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "7"]
|
||||||
],
|
],
|
||||||
"public/app/plugins/panel/table/module.tsx:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
|
||||||
],
|
|
||||||
"public/app/plugins/panel/text/TextPanelEditor.tsx:5381": [
|
"public/app/plugins/panel/text/TextPanelEditor.tsx:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
],
|
],
|
||||||
"public/app/plugins/panel/text/textPanelMigrationHandler.ts:5381": [
|
"public/app/plugins/panel/text/textPanelMigrationHandler.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "3"]
|
|
||||||
],
|
],
|
||||||
"public/app/plugins/panel/timeseries/migrations.ts:5381": [
|
"public/app/plugins/panel/timeseries/migrations.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
[0, 0, 0, "Do not use any type assertions.", "4"],
|
||||||
@@ -5190,17 +4998,13 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Do not use any type assertions.", "6"],
|
[0, 0, 0, "Do not use any type assertions.", "6"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "7"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "7"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "8"],
|
[0, 0, 0, "Do not use any type assertions.", "8"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "9"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "9"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "10"],
|
[0, 0, 0, "Do not use any type assertions.", "10"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "11"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "11"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "12"],
|
[0, 0, 0, "Do not use any type assertions.", "12"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "13"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "13"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "14"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "14"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "15"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "15"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "16"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "17"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "18"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "19"]
|
|
||||||
],
|
],
|
||||||
"public/app/plugins/panel/timeseries/plugins/ExemplarMarker.tsx:5381": [
|
"public/app/plugins/panel/timeseries/plugins/ExemplarMarker.tsx:5381": [
|
||||||
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"]
|
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"]
|
||||||
@@ -5208,12 +5012,6 @@ exports[`better eslint`] = {
|
|||||||
"public/app/plugins/panel/timeseries/plugins/annotations/AnnotationEditor.tsx:5381": [
|
"public/app/plugins/panel/timeseries/plugins/annotations/AnnotationEditor.tsx:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
],
|
],
|
||||||
"public/app/plugins/panel/timeseries/suggestions.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/plugins/panel/trend/suggestions.ts:5381": [
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/plugins/panel/xychart/AutoEditor.tsx:5381": [
|
"public/app/plugins/panel/xychart/AutoEditor.tsx:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ export function describeInterval(str: string) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
sec: (intervals_in_seconds as any)[matches[2]] as number,
|
sec: intervals_in_seconds[matches[2] as keyof typeof intervals_in_seconds],
|
||||||
type: matches[2],
|
type: matches[2],
|
||||||
count: parseInt(matches[1], 10),
|
count: parseInt(matches[1], 10),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ describe('EventBus', () => {
|
|||||||
it('can add sources to the source path', () => {
|
it('can add sources to the source path', () => {
|
||||||
const bus = new EventBusSrv();
|
const bus = new EventBusSrv();
|
||||||
const busWithSource = bus.newScopedBus('foo');
|
const busWithSource = bus.newScopedBus('foo');
|
||||||
expect((busWithSource as any).path).toEqual(['foo']);
|
expect(busWithSource.path).toEqual(['foo']);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adds the source to the event payload', () => {
|
it('adds the source to the event payload', () => {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export class EventBusSrv implements EventBus, LegacyEmitter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
newScopedBus(key: string, filter?: EventFilterOptions): EventBus {
|
newScopedBus(key: string, filter?: EventFilterOptions): ScopedEventBus {
|
||||||
return new ScopedEventBus([key], this, filter);
|
return new ScopedEventBus([key], this, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ function cachingDisplayProcessor(disp: DisplayProcessor, maxCacheSize = 2500): D
|
|||||||
caches.set(i, new Map());
|
caches.set(i, new Map());
|
||||||
}
|
}
|
||||||
|
|
||||||
return (value: any, decimals?: DecimalCount) => {
|
return (value: unknown, decimals?: DecimalCount) => {
|
||||||
let cache = caches.get(decimals ?? -1)!;
|
let cache = caches.get(decimals ?? -1)!;
|
||||||
|
|
||||||
let v = cache.get(value);
|
let v = cache.get(value);
|
||||||
@@ -342,8 +342,8 @@ export function setFieldConfigDefaults(config: FieldConfig, defaults: FieldConfi
|
|||||||
}
|
}
|
||||||
|
|
||||||
function processFieldConfigValue(
|
function processFieldConfigValue(
|
||||||
destination: Record<string, any>, // it's mutable
|
destination: Record<string, unknown>, // it's mutable
|
||||||
source: Record<string, any>,
|
source: Record<string, unknown>,
|
||||||
fieldConfigProperty: FieldConfigPropertyItem,
|
fieldConfigProperty: FieldConfigPropertyItem,
|
||||||
context: FieldOverrideEnv
|
context: FieldOverrideEnv
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -29,4 +29,4 @@ export interface StandardEditorsRegistryItem<TValue = any, TSettings = any> exte
|
|||||||
}
|
}
|
||||||
export const standardFieldConfigEditorRegistry = new FieldConfigOptionsRegistry();
|
export const standardFieldConfigEditorRegistry = new FieldConfigOptionsRegistry();
|
||||||
|
|
||||||
export const standardEditorsRegistry = new Registry<StandardEditorsRegistryItem<any>>();
|
export const standardEditorsRegistry = new Registry<StandardEditorsRegistryItem>();
|
||||||
|
|||||||
@@ -37,16 +37,12 @@ export function getPanelOptionsWithDefaults({
|
|||||||
currentFieldConfig,
|
currentFieldConfig,
|
||||||
isAfterPluginChange,
|
isAfterPluginChange,
|
||||||
}: Props): OptionDefaults {
|
}: Props): OptionDefaults {
|
||||||
const optionsWithDefaults = mergeWith(
|
const optionsWithDefaults = mergeWith({}, plugin.defaults, currentOptions || {}, (objValue, srcValue) => {
|
||||||
{},
|
if (isArray(srcValue)) {
|
||||||
plugin.defaults,
|
return srcValue;
|
||||||
currentOptions || {},
|
|
||||||
(objValue: any, srcValue: any): any => {
|
|
||||||
if (isArray(srcValue)) {
|
|
||||||
return srcValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
return;
|
||||||
|
});
|
||||||
|
|
||||||
const fieldConfigWithDefaults = applyFieldConfigDefaults(currentFieldConfig, plugin);
|
const fieldConfigWithDefaults = applyFieldConfigDefaults(currentFieldConfig, plugin);
|
||||||
const fieldConfigWithOptimalColorMode = adaptFieldColorMode(plugin, fieldConfigWithDefaults, isAfterPluginChange);
|
const fieldConfigWithOptimalColorMode = adaptFieldColorMode(plugin, fieldConfigWithDefaults, isAfterPluginChange);
|
||||||
@@ -62,10 +58,11 @@ function applyFieldConfigDefaults(existingFieldConfig: FieldConfigSource, plugin
|
|||||||
{},
|
{},
|
||||||
pluginDefaults.defaults,
|
pluginDefaults.defaults,
|
||||||
existingFieldConfig ? existingFieldConfig.defaults : {},
|
existingFieldConfig ? existingFieldConfig.defaults : {},
|
||||||
(objValue: any, srcValue: any): any => {
|
(objValue, srcValue) => {
|
||||||
if (isArray(srcValue)) {
|
if (isArray(srcValue)) {
|
||||||
return srcValue;
|
return srcValue;
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
overrides: existingFieldConfig?.overrides ?? [],
|
overrides: existingFieldConfig?.overrides ?? [],
|
||||||
@@ -86,7 +83,7 @@ function applyFieldConfigDefaults(existingFieldConfig: FieldConfigSource, plugin
|
|||||||
for (const override of result.overrides) {
|
for (const override of result.overrides) {
|
||||||
for (const property of override.properties) {
|
for (const property of override.properties) {
|
||||||
if (property.id === 'thresholds') {
|
if (property.id === 'thresholds') {
|
||||||
fixThresholds(property.value as ThresholdsConfig);
|
fixThresholds(property.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,7 +154,7 @@ function adaptFieldColorMode(
|
|||||||
const color = plugin.fieldConfigRegistry.getIfExists(FieldConfigProperty.Color);
|
const color = plugin.fieldConfigRegistry.getIfExists(FieldConfigProperty.Color);
|
||||||
|
|
||||||
if (color && color.settings) {
|
if (color && color.settings) {
|
||||||
const colorSettings = color.settings as FieldColorConfigSettings;
|
const colorSettings: FieldColorConfigSettings = color.settings;
|
||||||
const mode = fieldColorModeRegistry.getIfExists(fieldConfig.defaults.color?.mode);
|
const mode = fieldColorModeRegistry.getIfExists(fieldConfig.defaults.color?.mode);
|
||||||
|
|
||||||
// When no support fo value colors, use classic palette
|
// When no support fo value colors, use classic palette
|
||||||
|
|||||||
@@ -205,11 +205,11 @@ const alwaysFieldMatcherInfo: FieldMatcherInfo = {
|
|||||||
name: 'All Fields',
|
name: 'All Fields',
|
||||||
description: 'Always Match',
|
description: 'Always Match',
|
||||||
|
|
||||||
get: (option: any) => {
|
get: (_option) => {
|
||||||
return alwaysFieldMatcher;
|
return alwaysFieldMatcher;
|
||||||
},
|
},
|
||||||
|
|
||||||
getOptionsDisplayText: (options: any) => {
|
getOptionsDisplayText: (_options) => {
|
||||||
return 'Always';
|
return 'Always';
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -219,11 +219,11 @@ const alwaysFrameMatcherInfo: FrameMatcherInfo = {
|
|||||||
name: 'All Frames',
|
name: 'All Frames',
|
||||||
description: 'Always Match',
|
description: 'Always Match',
|
||||||
|
|
||||||
get: (option: any) => {
|
get: (_option) => {
|
||||||
return alwaysFrameMatcher;
|
return alwaysFrameMatcher;
|
||||||
},
|
},
|
||||||
|
|
||||||
getOptionsDisplayText: (options: any) => {
|
getOptionsDisplayText: (_options) => {
|
||||||
return 'Always';
|
return 'Always';
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -234,11 +234,11 @@ const neverFieldMatcherInfo: FieldMatcherInfo = {
|
|||||||
description: 'Never Match',
|
description: 'Never Match',
|
||||||
excludeFromPicker: true,
|
excludeFromPicker: true,
|
||||||
|
|
||||||
get: (option: any) => {
|
get: (_option) => {
|
||||||
return neverFieldMatcher;
|
return neverFieldMatcher;
|
||||||
},
|
},
|
||||||
|
|
||||||
getOptionsDisplayText: (options: any) => {
|
getOptionsDisplayText: (_options) => {
|
||||||
return 'Never';
|
return 'Never';
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -248,11 +248,11 @@ const neverFrameMatcherInfo: FrameMatcherInfo = {
|
|||||||
name: 'No Frames',
|
name: 'No Frames',
|
||||||
description: 'Never Match',
|
description: 'Never Match',
|
||||||
|
|
||||||
get: (option: any) => {
|
get: (_option) => {
|
||||||
return neverFrameMatcher;
|
return neverFrameMatcher;
|
||||||
},
|
},
|
||||||
|
|
||||||
getOptionsDisplayText: (options: any) => {
|
getOptionsDisplayText: (_options) => {
|
||||||
return 'Never';
|
return 'Never';
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const ensureColumnsTransformer: SynchronousDataTransformerInfo = {
|
|||||||
operator: (options, ctx) => (source) =>
|
operator: (options, ctx) => (source) =>
|
||||||
source.pipe(map((data) => ensureColumnsTransformer.transformer(options, ctx)(data))),
|
source.pipe(map((data) => ensureColumnsTransformer.transformer(options, ctx)(data))),
|
||||||
|
|
||||||
transformer: (_options: any, ctx) => (frames: DataFrame[]) => {
|
transformer: (_options, ctx) => (frames: DataFrame[]) => {
|
||||||
// Assume timeseries should first be joined by time
|
// Assume timeseries should first be joined by time
|
||||||
const timeFieldName = findConsistentTimeFieldName(frames);
|
const timeFieldName = findConsistentTimeFieldName(frames);
|
||||||
|
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ function histogram(
|
|||||||
vals: number[],
|
vals: number[],
|
||||||
getBucket: (v: number) => number,
|
getBucket: (v: number) => number,
|
||||||
filterOut?: any[] | null,
|
filterOut?: any[] | null,
|
||||||
sort?: ((a: any, b: any) => number) | null
|
sort?: ((a: number, b: number) => number) | null
|
||||||
) {
|
) {
|
||||||
let hist = new Map();
|
let hist = new Map();
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { GrafanaConfig, RawTimeRange, ScopedVars } from '../types';
|
|||||||
|
|
||||||
import { UrlQueryMap, urlUtil } from './url';
|
import { UrlQueryMap, urlUtil } from './url';
|
||||||
|
|
||||||
let grafanaConfig: GrafanaConfig = { appSubUrl: '' } as any;
|
let grafanaConfig = { appSubUrl: '' } as GrafanaConfig;
|
||||||
let getTimeRangeUrlParams: () => RawTimeRange;
|
let getTimeRangeUrlParams: () => RawTimeRange;
|
||||||
let getVariablesUrlParams: (scopedVars?: ScopedVars) => UrlQueryMap;
|
let getVariablesUrlParams: (scopedVars?: ScopedVars) => UrlQueryMap;
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
import { GrafanaTheme, GrafanaThemeType } from '../../types/theme';
|
|
||||||
|
|
||||||
export function getTestTheme(type: GrafanaThemeType = GrafanaThemeType.Dark): GrafanaTheme {
|
|
||||||
return {
|
|
||||||
type,
|
|
||||||
isDark: type === GrafanaThemeType.Dark,
|
|
||||||
isLight: type === GrafanaThemeType.Light,
|
|
||||||
colors: {
|
|
||||||
panelBg: 'white',
|
|
||||||
},
|
|
||||||
} as unknown as GrafanaTheme;
|
|
||||||
}
|
|
||||||
@@ -76,13 +76,13 @@ export function getValueMappingResult(valueMappings: ValueMapping[], value: any)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SpecialValueMatch.NaN: {
|
case SpecialValueMatch.NaN: {
|
||||||
if (isNaN(value as any)) {
|
if (isNaN(value as number)) {
|
||||||
return vm.options.result;
|
return vm.options.result;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SpecialValueMatch.NullAndNaN: {
|
case SpecialValueMatch.NullAndNaN: {
|
||||||
if (isNaN(value as any) || value == null) {
|
if (isNaN(value as number) || value == null) {
|
||||||
return vm.options.result;
|
return vm.options.result;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -113,7 +113,7 @@ export function getValueMappingResult(valueMappings: ValueMapping[], value: any)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ref https://stackoverflow.com/a/58550111
|
// Ref https://stackoverflow.com/a/58550111
|
||||||
export function isNumeric(num: any) {
|
export function isNumeric(num: unknown) {
|
||||||
return (typeof num === 'number' || (typeof num === 'string' && num.trim() !== '')) && !isNaN(num as number);
|
return (typeof num === 'number' || (typeof num === 'string' && num.trim() !== '')) && !isNaN(num as number);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ import { Vector } from '../types';
|
|||||||
export class AsNumberVector extends Array<number> {
|
export class AsNumberVector extends Array<number> {
|
||||||
constructor(field: Vector) {
|
constructor(field: Vector) {
|
||||||
super();
|
super();
|
||||||
return field.map((v) => +v) as AsNumberVector;
|
return field.map((v) => +v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ export class BinaryOperationVector extends Array<number> {
|
|||||||
for (let i = 0; i < arr.length; i++) {
|
for (let i = 0; i < arr.length; i++) {
|
||||||
arr[i] = operation(left[i], right[i]);
|
arr[i] = operation(left[i], right[i]);
|
||||||
}
|
}
|
||||||
return arr as BinaryOperationVector;
|
return arr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
export class ConstantVector<T = any> extends Array<T> {
|
export class ConstantVector<T = any> extends Array<T> {
|
||||||
constructor(value: T, len: number) {
|
constructor(value: T, len: number) {
|
||||||
super();
|
super();
|
||||||
return new Array<T>(len).fill(value) as ConstantVector<T>;
|
return new Array<T>(len).fill(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ import { formattedValueToString } from '../valueFormats';
|
|||||||
export class FormattedVector<T = any> extends Array<string> {
|
export class FormattedVector<T = any> extends Array<string> {
|
||||||
constructor(source: Vector<T>, formatter: DisplayProcessor) {
|
constructor(source: Vector<T>, formatter: DisplayProcessor) {
|
||||||
super();
|
super();
|
||||||
return source.map((v) => formattedValueToString(formatter(v))) as FormattedVector<T>;
|
return source.map((v) => formattedValueToString(formatter(v)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export class IndexVector extends Array<number> {
|
|||||||
for (let i = 0; i < len; i++) {
|
for (let i = 0; i < len; i++) {
|
||||||
arr[i] = i;
|
arr[i] = i;
|
||||||
}
|
}
|
||||||
return arr as IndexVector;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -147,10 +147,10 @@ export function isFetchError(e: unknown): e is FetchError {
|
|||||||
*/
|
*/
|
||||||
export interface BackendSrv {
|
export interface BackendSrv {
|
||||||
get<T = any>(url: string, params?: any, requestId?: string, options?: Partial<BackendSrvRequest>): Promise<T>;
|
get<T = any>(url: string, params?: any, requestId?: string, options?: Partial<BackendSrvRequest>): Promise<T>;
|
||||||
delete<T = any>(url: string, data?: any, options?: Partial<BackendSrvRequest>): Promise<T>;
|
delete<T = unknown>(url: string, data?: unknown, options?: Partial<BackendSrvRequest>): Promise<T>;
|
||||||
post<T = any>(url: string, data?: any, options?: Partial<BackendSrvRequest>): Promise<T>;
|
post<T = any>(url: string, data?: unknown, options?: Partial<BackendSrvRequest>): Promise<T>;
|
||||||
patch<T = any>(url: string, data?: any, options?: Partial<BackendSrvRequest>): Promise<T>;
|
patch<T = any>(url: string, data?: unknown, options?: Partial<BackendSrvRequest>): Promise<T>;
|
||||||
put<T = any>(url: string, data?: any, options?: Partial<BackendSrvRequest>): Promise<T>;
|
put<T = any>(url: string, data?: unknown, options?: Partial<BackendSrvRequest>): Promise<T>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use the `.fetch()` function instead. If you prefer to work with a promise
|
* @deprecated Use the `.fetch()` function instead. If you prefer to work with a promise
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ export const TagFilter = ({
|
|||||||
width,
|
width,
|
||||||
components: {
|
components: {
|
||||||
Option: TagOption,
|
Option: TagOption,
|
||||||
MultiValueLabel: (): any => {
|
MultiValueLabel: () => {
|
||||||
return null; // We want the whole tag to be clickable so we use MultiValueRemove instead
|
return null; // We want the whole tag to be clickable so we use MultiValueRemove instead
|
||||||
},
|
},
|
||||||
MultiValueRemove(props: any) {
|
MultiValueRemove(props: any) {
|
||||||
@@ -155,7 +155,7 @@ export const TagFilter = ({
|
|||||||
</components.MultiValueRemove>
|
</components.MultiValueRemove>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
MultiValueContainer: hideValues ? (): any => null : components.MultiValueContainer,
|
MultiValueContainer: hideValues ? () => null : components.MultiValueContainer,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ export class BackendSrv implements BackendService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleStreamCancellation(options: BackendSrvRequest): MonoTypeOperatorFunction<FetchResponse<any>> {
|
private handleStreamCancellation(options: BackendSrvRequest): MonoTypeOperatorFunction<FetchResponse> {
|
||||||
return (inputStream) =>
|
return (inputStream) =>
|
||||||
inputStream.pipe(
|
inputStream.pipe(
|
||||||
takeUntil(
|
takeUntil(
|
||||||
@@ -452,7 +452,7 @@ export class BackendSrv implements BackendService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getInspectorStream(): Observable<FetchResponse<any> | FetchError> {
|
getInspectorStream(): Observable<FetchResponse | FetchError> {
|
||||||
return this.inspectorStream;
|
return this.inspectorStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -465,23 +465,23 @@ export class BackendSrv implements BackendService {
|
|||||||
return this.request<T>({ ...options, method: 'GET', url, params, requestId });
|
return this.request<T>({ ...options, method: 'GET', url, params, requestId });
|
||||||
}
|
}
|
||||||
|
|
||||||
async delete<T = any>(url: string, data?: any, options?: Partial<BackendSrvRequest>) {
|
async delete<T = unknown>(url: string, data?: unknown, options?: Partial<BackendSrvRequest>) {
|
||||||
return this.request<T>({ ...options, method: 'DELETE', url, data });
|
return this.request<T>({ ...options, method: 'DELETE', url, data });
|
||||||
}
|
}
|
||||||
|
|
||||||
async post<T = any>(url: string, data?: any, options?: Partial<BackendSrvRequest>) {
|
async post<T = any>(url: string, data?: unknown, options?: Partial<BackendSrvRequest>) {
|
||||||
return this.request<T>({ ...options, method: 'POST', url, data });
|
return this.request<T>({ ...options, method: 'POST', url, data });
|
||||||
}
|
}
|
||||||
|
|
||||||
async patch<T = any>(url: string, data: any, options?: Partial<BackendSrvRequest>) {
|
async patch<T = any>(url: string, data: unknown, options?: Partial<BackendSrvRequest>) {
|
||||||
return this.request<T>({ ...options, method: 'PATCH', url, data });
|
return this.request<T>({ ...options, method: 'PATCH', url, data });
|
||||||
}
|
}
|
||||||
|
|
||||||
async put<T = any>(url: string, data: any, options?: Partial<BackendSrvRequest>): Promise<T> {
|
async put<T = any>(url: string, data: unknown, options?: Partial<BackendSrvRequest>): Promise<T> {
|
||||||
return this.request<T>({ ...options, method: 'PUT', url, data });
|
return this.request<T>({ ...options, method: 'PUT', url, data });
|
||||||
}
|
}
|
||||||
|
|
||||||
withNoBackendCache(callback: any) {
|
withNoBackendCache(callback: () => Promise<void>) {
|
||||||
this.noBackendCache = true;
|
this.noBackendCache = true;
|
||||||
return callback().finally(() => {
|
return callback().finally(() => {
|
||||||
this.noBackendCache = false;
|
this.noBackendCache = false;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import TimeSeries, { updateLegendValues } from 'app/core/time_series2';
|
import TimeSeries, { updateLegendValues } from 'app/core/time_series2';
|
||||||
|
|
||||||
describe('TimeSeries', () => {
|
describe('TimeSeries', () => {
|
||||||
let points: any[][];
|
let points: ReturnType<TimeSeries['getFlotPairs']>;
|
||||||
let series: TimeSeries;
|
let series: TimeSeries;
|
||||||
let testData: { alias?: string; datapoints: any };
|
let testData: { alias?: string; datapoints: Array<[number | null, number | null]> };
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
testData = {
|
testData = {
|
||||||
|
|||||||
@@ -27,15 +27,17 @@ export function queryIsEmpty(query: DataQuery): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function addQuery(queries: DataQuery[], query?: Partial<DataQuery>, datasource?: DataSourceRef): DataQuery[] {
|
export function addQuery(queries: DataQuery[], query?: Partial<DataQuery>, datasource?: DataSourceRef): DataQuery[] {
|
||||||
const q = query || {};
|
const q: DataQuery = {
|
||||||
q.refId = getNextRefIdChar(queries);
|
...query,
|
||||||
q.hide = false;
|
refId: getNextRefIdChar(queries),
|
||||||
|
hide: false,
|
||||||
|
};
|
||||||
|
|
||||||
if (!q.datasource && datasource) {
|
if (!q.datasource && datasource) {
|
||||||
q.datasource = datasource;
|
q.datasource = datasource;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [...queries, q as DataQuery];
|
return [...queries, q];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isDataQuery(url: string): boolean {
|
export function isDataQuery(url: string): boolean {
|
||||||
|
|||||||
@@ -184,11 +184,8 @@ describe('PanelAlertTabContent', () => {
|
|||||||
const dsService = new MockDataSourceSrv(dataSources);
|
const dsService = new MockDataSourceSrv(dataSources);
|
||||||
dsService.datasources[dataSources.prometheus.uid] = new PrometheusDatasource(
|
dsService.datasources[dataSources.prometheus.uid] = new PrometheusDatasource(
|
||||||
dataSources.prometheus
|
dataSources.prometheus
|
||||||
) as DataSourceApi<any, any>;
|
) as DataSourceApi;
|
||||||
dsService.datasources[dataSources.default.uid] = new PrometheusDatasource(dataSources.default) as DataSourceApi<
|
dsService.datasources[dataSources.default.uid] = new PrometheusDatasource(dataSources.default) as DataSourceApi;
|
||||||
any,
|
|
||||||
any
|
|
||||||
>;
|
|
||||||
setDataSourceSrv(dsService);
|
setDataSourceSrv(dsService);
|
||||||
disableRBAC();
|
disableRBAC();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { css, cx } from '@emotion/css';
|
import { css, cx } from '@emotion/css';
|
||||||
import { LanguageMap, languages as prismLanguages } from 'prismjs';
|
import { languages as prismLanguages } from 'prismjs';
|
||||||
import React, { FC, useMemo } from 'react';
|
import React, { FC, useMemo } from 'react';
|
||||||
import { Editor } from 'slate-react';
|
import { Editor } from 'slate-react';
|
||||||
|
|
||||||
@@ -23,10 +23,10 @@ export const HighlightedQuery: FC<{ language: 'promql' | 'logql'; expr: string }
|
|||||||
() => [
|
() => [
|
||||||
SlatePrism(
|
SlatePrism(
|
||||||
{
|
{
|
||||||
onlyIn: (node: any) => node.type === 'code_block',
|
onlyIn: (node) => 'type' in node && node.type === 'code_block',
|
||||||
getSyntax: () => language,
|
getSyntax: () => language,
|
||||||
},
|
},
|
||||||
{ ...(prismLanguages as LanguageMap), [language]: language === 'logql' ? LogqlSyntax : PromqlSyntax }
|
{ ...prismLanguages, [language]: language === 'logql' ? LogqlSyntax : PromqlSyntax }
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
[language]
|
[language]
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import AutoSizer from 'react-virtualized-auto-sizer';
|
|||||||
|
|
||||||
import { GrafanaTheme2 } from '@grafana/data';
|
import { GrafanaTheme2 } from '@grafana/data';
|
||||||
import { Stack } from '@grafana/experimental';
|
import { Stack } from '@grafana/experimental';
|
||||||
|
import { isFetchError } from '@grafana/runtime';
|
||||||
import {
|
import {
|
||||||
Alert,
|
Alert,
|
||||||
Button,
|
Button,
|
||||||
@@ -159,7 +160,7 @@ export const TemplateForm = ({ existing, alertManagerSourceName, config, provena
|
|||||||
<h4>{existing && !isduplicating ? 'Edit notification template' : 'Create notification template'}</h4>
|
<h4>{existing && !isduplicating ? 'Edit notification template' : 'Create notification template'}</h4>
|
||||||
{error && (
|
{error && (
|
||||||
<Alert severity="error" title="Error saving template">
|
<Alert severity="error" title="Error saving template">
|
||||||
{error.message || (error as any)?.data?.message || String(error)}
|
{error.message || (isFetchError(error) && error.data?.message) || String(error)}
|
||||||
</Alert>
|
</Alert>
|
||||||
)}
|
)}
|
||||||
{provenance && <ProvisioningAlert resource={ProvisionedResource.Template} />}
|
{provenance && <ProvisioningAlert resource={ProvisionedResource.Template} />}
|
||||||
|
|||||||
@@ -49,14 +49,14 @@ export const TestContactPointModal = ({ isOpen, onDismiss, onTest }: Props) => {
|
|||||||
const alert = {
|
const alert = {
|
||||||
annotations: data.annotations
|
annotations: data.annotations
|
||||||
.filter(({ key, value }) => !!key && !!value)
|
.filter(({ key, value }) => !!key && !!value)
|
||||||
.reduce((acc, { key, value }) => {
|
.reduce<Annotations>((acc, { key, value }) => {
|
||||||
return { ...acc, [key]: value };
|
return { ...acc, [key]: value };
|
||||||
}, {} as Annotations),
|
}, {}),
|
||||||
labels: data.labels
|
labels: data.labels
|
||||||
.filter(({ key, value }) => !!key && !!value)
|
.filter(({ key, value }) => !!key && !!value)
|
||||||
.reduce((acc, { key, value }) => {
|
.reduce<Labels>((acc, { key, value }) => {
|
||||||
return { ...acc, [key]: value };
|
return { ...acc, [key]: value };
|
||||||
}, {} as Labels),
|
}, {}),
|
||||||
};
|
};
|
||||||
onTest(alert);
|
onTest(alert);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ export const AlertRuleForm = ({ existing, prefill }: Props) => {
|
|||||||
const ruleType = translateRouteParamToRuleType(routeParams.type);
|
const ruleType = translateRouteParamToRuleType(routeParams.type);
|
||||||
const uidFromParams = routeParams.id;
|
const uidFromParams = routeParams.id;
|
||||||
|
|
||||||
const returnTo: string = (queryParams['returnTo'] as string | undefined) ?? '/alerting/list';
|
const returnTo = String(queryParams['returnTo']) ?? '/alerting/list';
|
||||||
const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);
|
const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);
|
||||||
|
|
||||||
const defaultValues: RuleFormValues = useMemo(() => {
|
const defaultValues: RuleFormValues = useMemo(() => {
|
||||||
|
|||||||
@@ -27,19 +27,16 @@ export function RuleDetailsDataSources(props: Props): JSX.Element | null {
|
|||||||
|
|
||||||
if (isGrafanaRulerRule(rule.rulerRule)) {
|
if (isGrafanaRulerRule(rule.rulerRule)) {
|
||||||
const { data } = rule.rulerRule.grafana_alert;
|
const { data } = rule.rulerRule.grafana_alert;
|
||||||
const unique = data.reduce(
|
const unique = data.reduce<Record<string, { name: string; icon?: string }>>((dataSources, query) => {
|
||||||
(dataSources, query) => {
|
const ds = getDataSourceSrv().getInstanceSettings(query.datasourceUid);
|
||||||
const ds = getDataSourceSrv().getInstanceSettings(query.datasourceUid);
|
|
||||||
|
|
||||||
if (!ds || ds.uid === ExpressionDatasourceUID) {
|
if (!ds || ds.uid === ExpressionDatasourceUID) {
|
||||||
return dataSources;
|
|
||||||
}
|
|
||||||
|
|
||||||
dataSources[ds.name] = { name: ds.name, icon: ds.meta.info.logos.small };
|
|
||||||
return dataSources;
|
return dataSources;
|
||||||
},
|
}
|
||||||
{} as Record<string, { name: string; icon?: string }>
|
|
||||||
);
|
dataSources[ds.name] = { name: ds.name, icon: ds.meta.info.logos.small };
|
||||||
|
return dataSources;
|
||||||
|
}, {});
|
||||||
|
|
||||||
return Object.values(unique);
|
return Object.values(unique);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ export const filterRules = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If a namespace and group have rules that match the rules filters then keep them.
|
// If a namespace and group have rules that match the rules filters then keep them.
|
||||||
return filteredNamespaces.reduce(reduceNamespaces(filterState), [] as CombinedRuleNamespace[]);
|
return filteredNamespaces.reduce<CombinedRuleNamespace[]>(reduceNamespaces(filterState), []);
|
||||||
};
|
};
|
||||||
|
|
||||||
const reduceNamespaces = (filterState: RulesFilter) => {
|
const reduceNamespaces = (filterState: RulesFilter) => {
|
||||||
@@ -154,7 +154,7 @@ const reduceNamespaces = (filterState: RulesFilter) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
filteredGroups = filteredGroups.reduce(reduceGroups(filterState), [] as CombinedRuleGroup[]);
|
filteredGroups = filteredGroups.reduce<CombinedRuleGroup[]>(reduceGroups(filterState), []);
|
||||||
|
|
||||||
if (filteredGroups.length) {
|
if (filteredGroups.length) {
|
||||||
namespaceAcc.push({
|
namespaceAcc.push({
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export const useGroupedAlerts = (groups: AlertmanagerGroup[], groupBy: string[])
|
|||||||
const emptyGroupings = groups.filter((group) => Object.keys(group.labels).length === 0);
|
const emptyGroupings = groups.filter((group) => Object.keys(group.labels).length === 0);
|
||||||
if (emptyGroupings.length > 1) {
|
if (emptyGroupings.length > 1) {
|
||||||
// Merges multiple ungrouped grouping
|
// Merges multiple ungrouped grouping
|
||||||
return groups.reduce((combinedGroups, group) => {
|
return groups.reduce<AlertmanagerGroup[]>((combinedGroups, group) => {
|
||||||
if (Object.keys(group.labels).length === 0) {
|
if (Object.keys(group.labels).length === 0) {
|
||||||
const noGroupingGroup = combinedGroups.find(({ labels }) => Object.keys(labels));
|
const noGroupingGroup = combinedGroups.find(({ labels }) => Object.keys(labels));
|
||||||
if (!noGroupingGroup) {
|
if (!noGroupingGroup) {
|
||||||
@@ -22,13 +22,13 @@ export const useGroupedAlerts = (groups: AlertmanagerGroup[], groupBy: string[])
|
|||||||
combinedGroups.push(group);
|
combinedGroups.push(group);
|
||||||
}
|
}
|
||||||
return combinedGroups;
|
return combinedGroups;
|
||||||
}, [] as AlertmanagerGroup[]);
|
}, []);
|
||||||
} else {
|
} else {
|
||||||
return groups;
|
return groups;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const alerts = groups.flatMap(({ alerts }) => alerts);
|
const alerts = groups.flatMap(({ alerts }) => alerts);
|
||||||
return alerts.reduce((groupings, alert) => {
|
return alerts.reduce<AlertmanagerGroup[]>((groupings, alert) => {
|
||||||
const alertContainsGroupings = groupBy.every((groupByLabel) => Object.keys(alert.labels).includes(groupByLabel));
|
const alertContainsGroupings = groupBy.every((groupByLabel) => Object.keys(alert.labels).includes(groupByLabel));
|
||||||
|
|
||||||
if (alertContainsGroupings) {
|
if (alertContainsGroupings) {
|
||||||
@@ -38,10 +38,10 @@ export const useGroupedAlerts = (groups: AlertmanagerGroup[], groupBy: string[])
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
if (!existingGrouping) {
|
if (!existingGrouping) {
|
||||||
const labels = groupBy.reduce((acc, key) => {
|
const labels = groupBy.reduce<Labels>((acc, key) => {
|
||||||
acc = { ...acc, [key]: alert.labels[key] };
|
acc = { ...acc, [key]: alert.labels[key] };
|
||||||
return acc;
|
return acc;
|
||||||
}, {} as Labels);
|
}, {});
|
||||||
groupings.push({
|
groupings.push({
|
||||||
alerts: [alert],
|
alerts: [alert],
|
||||||
labels,
|
labels,
|
||||||
@@ -62,6 +62,6 @@ export const useGroupedAlerts = (groups: AlertmanagerGroup[], groupBy: string[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
return groupings;
|
return groupings;
|
||||||
}, [] as AlertmanagerGroup[]);
|
}, []);
|
||||||
}, [groups, groupBy]);
|
}, [groups, groupBy]);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const matchersToArrayFieldMatchers = (
|
|||||||
operator: isRegex ? MatcherOperator.regex : MatcherOperator.equal,
|
operator: isRegex ? MatcherOperator.regex : MatcherOperator.equal,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[] as MatcherFieldValue[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
const selectableValueToString = (selectableValue: SelectableValue<string>): string => selectableValue.value!;
|
const selectableValueToString = (selectableValue: SelectableValue<string>): string => selectableValue.value!;
|
||||||
@@ -149,9 +149,9 @@ export const formAmRouteToAmRoute = (
|
|||||||
|
|
||||||
const overrideRepeatInterval = overrideTimings && repeatIntervalValue;
|
const overrideRepeatInterval = overrideTimings && repeatIntervalValue;
|
||||||
const repeat_interval = overrideRepeatInterval ? repeatIntervalValue : INHERIT_FROM_PARENT;
|
const repeat_interval = overrideRepeatInterval ? repeatIntervalValue : INHERIT_FROM_PARENT;
|
||||||
const object_matchers = formAmRoute.object_matchers
|
const object_matchers: ObjectMatcher[] | undefined = formAmRoute.object_matchers
|
||||||
?.filter((route) => route.name && route.value && route.operator)
|
?.filter((route) => route.name && route.value && route.operator)
|
||||||
.map(({ name, operator, value }) => [name, operator, value] as ObjectMatcher);
|
.map(({ name, operator, value }) => [name, operator, value]);
|
||||||
|
|
||||||
const routes = formAmRoute.routes?.map((subRoute) =>
|
const routes = formAmRoute.routes?.map((subRoute) =>
|
||||||
formAmRouteToAmRoute(alertManagerSourceName, subRoute, routeTree)
|
formAmRouteToAmRoute(alertManagerSourceName, subRoute, routeTree)
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export function cloudReceiverToFormValues(
|
|||||||
// map property names to cloud notifier types by removing the `_config` suffix
|
// map property names to cloud notifier types by removing the `_config` suffix
|
||||||
.map(([type, configs]): [CloudNotifierType, CloudChannelConfig[]] => [
|
.map(([type, configs]): [CloudNotifierType, CloudChannelConfig[]] => [
|
||||||
type.replace('_configs', '') as CloudNotifierType,
|
type.replace('_configs', '') as CloudNotifierType,
|
||||||
configs as CloudChannelConfig[],
|
configs,
|
||||||
])
|
])
|
||||||
// convert channel configs to form values
|
// convert channel configs to form values
|
||||||
.map(([type, configs]) =>
|
.map(([type, configs]) =>
|
||||||
@@ -115,7 +115,7 @@ export function formValuesToCloudReceiver(
|
|||||||
if (!(`${type}_configs` in recv)) {
|
if (!(`${type}_configs` in recv)) {
|
||||||
recv[`${type}_configs`] = [channel];
|
recv[`${type}_configs`] = [channel];
|
||||||
} else {
|
} else {
|
||||||
(recv[`${type}_configs`] as unknown[]).push(channel);
|
recv[`${type}_configs`]?.push(channel);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return recv;
|
return recv;
|
||||||
|
|||||||
@@ -169,20 +169,17 @@ export function getFirstActiveAt(promRule?: AlertingRule) {
|
|||||||
if (!promRule?.alerts) {
|
if (!promRule?.alerts) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return promRule.alerts.reduce(
|
return promRule.alerts.reduce<Date | null>((prev, alert) => {
|
||||||
(prev, alert) => {
|
const isNotNormal =
|
||||||
const isNotNormal =
|
mapStateWithReasonToBaseState(alert.state as GrafanaAlertStateWithReason) !== GrafanaAlertState.Normal;
|
||||||
mapStateWithReasonToBaseState(alert.state as GrafanaAlertStateWithReason) !== GrafanaAlertState.Normal;
|
if (alert.activeAt && isNotNormal) {
|
||||||
if (alert.activeAt && isNotNormal) {
|
const activeAt = new Date(alert.activeAt);
|
||||||
const activeAt = new Date(alert.activeAt);
|
if (prev === null || prev.getTime() > activeAt.getTime()) {
|
||||||
if (prev === null || prev.getTime() > activeAt.getTime()) {
|
return activeAt;
|
||||||
return activeAt;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return prev;
|
}
|
||||||
},
|
return prev;
|
||||||
null as Date | null
|
}, null);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ export class ElementState implements LayerElement {
|
|||||||
|
|
||||||
const { constraint } = this.options;
|
const { constraint } = this.options;
|
||||||
const { vertical, horizontal } = constraint ?? {};
|
const { vertical, horizontal } = constraint ?? {};
|
||||||
const placement = this.options.placement ?? ({} as Placement);
|
const placement: Placement = this.options.placement ?? {};
|
||||||
|
|
||||||
const editingEnabled = this.getScene()?.isEditingEnabled;
|
const editingEnabled = this.getScene()?.isEditingEnabled;
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ export class ElementState implements LayerElement {
|
|||||||
? Math.round(parentContainer.right - parentBorderWidth - elementContainer.right)
|
? Math.round(parentContainer.right - parentBorderWidth - elementContainer.right)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
const placement = {} as Placement;
|
const placement: Placement = {};
|
||||||
|
|
||||||
const width = elementContainer?.width ?? 100;
|
const width = elementContainer?.width ?? 100;
|
||||||
const height = elementContainer?.height ?? 100;
|
const height = elementContainer?.height ?? 100;
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ export class FrameState extends ElementState {
|
|||||||
if (shiftItemsOnDuplicate) {
|
if (shiftItemsOnDuplicate) {
|
||||||
const { constraint, placement: oldPlacement } = element.options;
|
const { constraint, placement: oldPlacement } = element.options;
|
||||||
const { vertical, horizontal } = constraint ?? {};
|
const { vertical, horizontal } = constraint ?? {};
|
||||||
const placement = { ...oldPlacement } ?? ({} as Placement);
|
const placement: Placement = { ...oldPlacement } ?? {};
|
||||||
|
|
||||||
switch (vertical) {
|
switch (vertical) {
|
||||||
case VerticalConstraint.Top:
|
case VerticalConstraint.Top:
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export function setupLoadDashboardMock(rsp: DeepPartial<DashboardDTO>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function mockResizeObserver() {
|
export function mockResizeObserver() {
|
||||||
(window as any).ResizeObserver = class ResizeObserver {
|
window.ResizeObserver = class ResizeObserver {
|
||||||
constructor(callback: ResizeObserverCallback) {
|
constructor(callback: ResizeObserverCallback) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
callback(
|
callback(
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { flow, get, isArray, isEmpty, last, sortBy, tail, toNumber, isNaN } from
|
|||||||
|
|
||||||
export type Diff = {
|
export type Diff = {
|
||||||
op: 'add' | 'replace' | 'remove' | 'copy' | 'test' | '_get' | 'move';
|
op: 'add' | 'replace' | 'remove' | 'copy' | 'test' | '_get' | 'move';
|
||||||
value: any;
|
value: unknown;
|
||||||
originalValue: any;
|
originalValue: unknown;
|
||||||
path: string[];
|
path: string[];
|
||||||
startLineNumber: number;
|
startLineNumber: number;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export function mergePanels(current: PanelModel[], data: IPanelModel[]): PanelMe
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const panel of current) {
|
for (const panel of current) {
|
||||||
const target = inputPanels.get(panel.id) as PanelModel;
|
const target = inputPanels.get(panel.id);
|
||||||
if (!target) {
|
if (!target) {
|
||||||
info.changed = true;
|
info.changed = true;
|
||||||
info.actions.remove.push(panel.id);
|
info.actions.remove.push(panel.id);
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ export class SnapshotWorker implements DashboardQueryRunnerWorker {
|
|||||||
private getAnnotationsFromSnapshot(dashboard: DashboardModel): AnnotationEvent[] {
|
private getAnnotationsFromSnapshot(dashboard: DashboardModel): AnnotationEvent[] {
|
||||||
const dashAnnotations = dashboard?.annotations?.list?.filter((a) => a.enable);
|
const dashAnnotations = dashboard?.annotations?.list?.filter((a) => a.enable);
|
||||||
const snapshots = dashAnnotations.filter((a) => Boolean(a.snapshotData));
|
const snapshots = dashAnnotations.filter((a) => Boolean(a.snapshotData));
|
||||||
const annotations = snapshots.reduce(
|
const annotations = snapshots.reduce<AnnotationEvent[]>(
|
||||||
(acc, curr) => acc.concat(translateQueryResult(curr, curr.snapshotData)),
|
(acc, curr) => acc.concat(translateQueryResult(curr, curr.snapshotData)),
|
||||||
[] as AnnotationEvent[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
return annotations;
|
return annotations;
|
||||||
|
|||||||
@@ -118,58 +118,52 @@ const validVariableNames: Record<string, RegExp[]> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getPropsWithVariable = (variableId: string, parent: { key: string; value: any }, result: any) => {
|
export const getPropsWithVariable = (variableId: string, parent: { key: string; value: any }, result: any) => {
|
||||||
const stringValues = Object.keys(parent.value).reduce(
|
const stringValues = Object.keys(parent.value).reduce<Record<string, any>>((all, key) => {
|
||||||
(all, key) => {
|
const value = parent.value[key];
|
||||||
const value = parent.value[key];
|
if (!value || typeof value !== 'string') {
|
||||||
if (!value || typeof value !== 'string') {
|
return all;
|
||||||
return all;
|
}
|
||||||
|
|
||||||
|
const isValidName = validVariableNames[key]
|
||||||
|
? validVariableNames[key].find((regex: RegExp) => regex.test(variableId))
|
||||||
|
: undefined;
|
||||||
|
|
||||||
|
let hasVariable = containsVariable(value, variableId);
|
||||||
|
if (key === 'repeat' && value === variableId) {
|
||||||
|
// repeat stores value without variable format
|
||||||
|
hasVariable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isValidName && hasVariable) {
|
||||||
|
all = {
|
||||||
|
...all,
|
||||||
|
[key]: value,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return all;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
const objectValues = Object.keys(parent.value).reduce<Record<string, any>>((all, key) => {
|
||||||
|
const value = parent.value[key];
|
||||||
|
if (value && typeof value === 'object' && Object.keys(value).length) {
|
||||||
|
let id = value.title || value.name || value.id || key;
|
||||||
|
if (Array.isArray(parent.value) && parent.key === 'panels') {
|
||||||
|
id = `${id}[${value.id}]`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isValidName = validVariableNames[key]
|
const newResult = getPropsWithVariable(variableId, { key, value }, {});
|
||||||
? validVariableNames[key].find((regex: RegExp) => regex.test(variableId))
|
|
||||||
: undefined;
|
|
||||||
|
|
||||||
let hasVariable = containsVariable(value, variableId);
|
if (Object.keys(newResult).length) {
|
||||||
if (key === 'repeat' && value === variableId) {
|
|
||||||
// repeat stores value without variable format
|
|
||||||
hasVariable = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isValidName && hasVariable) {
|
|
||||||
all = {
|
all = {
|
||||||
...all,
|
...all,
|
||||||
[key]: value,
|
[id]: newResult,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return all;
|
return all;
|
||||||
},
|
}, {});
|
||||||
{} as Record<string, any>
|
|
||||||
);
|
|
||||||
|
|
||||||
const objectValues = Object.keys(parent.value).reduce(
|
|
||||||
(all, key) => {
|
|
||||||
const value = parent.value[key];
|
|
||||||
if (value && typeof value === 'object' && Object.keys(value).length) {
|
|
||||||
let id = value.title || value.name || value.id || key;
|
|
||||||
if (Array.isArray(parent.value) && parent.key === 'panels') {
|
|
||||||
id = `${id}[${value.id}]`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const newResult = getPropsWithVariable(variableId, { key, value }, {});
|
|
||||||
|
|
||||||
if (Object.keys(newResult).length) {
|
|
||||||
all = {
|
|
||||||
...all,
|
|
||||||
[id]: newResult,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return all;
|
|
||||||
},
|
|
||||||
{} as Record<string, any>
|
|
||||||
);
|
|
||||||
|
|
||||||
if (Object.keys(stringValues).length || Object.keys(objectValues).length) {
|
if (Object.keys(stringValues).length || Object.keys(objectValues).length) {
|
||||||
result = {
|
result = {
|
||||||
@@ -341,7 +335,7 @@ export const transformUsagesToNetwork = (usages: VariableUsageTree[]): UsagesToN
|
|||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
const countLeaves = (object: any): number => {
|
const countLeaves = (object: object): number => {
|
||||||
const total = Object.values(object).reduce((count: number, value: any) => {
|
const total = Object.values(object).reduce((count: number, value: any) => {
|
||||||
if (typeof value === 'object') {
|
if (typeof value === 'object') {
|
||||||
return count + countLeaves(value);
|
return count + countLeaves(value);
|
||||||
@@ -350,7 +344,7 @@ const countLeaves = (object: any): number => {
|
|||||||
return count + 1;
|
return count + 1;
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
return total as unknown as number;
|
return total;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getVariableUsages = (variableId: string, usages: VariableUsageTree[]): number => {
|
export const getVariableUsages = (variableId: string, usages: VariableUsageTree[]): number => {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ describe('optionsPickerReducer', () => {
|
|||||||
clearOthers: args.clearOthers,
|
clearOthers: args.clearOthers,
|
||||||
option: { text: args.option, value: args.option, selected: true },
|
option: { text: args.option, value: args.option, selected: true },
|
||||||
};
|
};
|
||||||
const expectedAsRecord: any = args.expectSelected.reduce((all: any, current: any) => {
|
const expectedAsRecord = args.expectSelected.reduce((all: any, current: any) => {
|
||||||
all[current] = current;
|
all[current] = current;
|
||||||
return all;
|
return all;
|
||||||
}, {});
|
}, {});
|
||||||
|
|||||||
@@ -184,25 +184,22 @@ export function flattenQuery(query: any): any {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const keys = Object.keys(query);
|
const keys = Object.keys(query);
|
||||||
const flattened = keys.reduce(
|
const flattened = keys.reduce<Record<string, any>>((all, key) => {
|
||||||
(all, key) => {
|
const value = query[key];
|
||||||
const value = query[key];
|
if (typeof value !== 'object' || value === null) {
|
||||||
if (typeof value !== 'object' || value === null) {
|
all[key] = value;
|
||||||
all[key] = value;
|
|
||||||
return all;
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = flattenQuery(value);
|
|
||||||
for (let childProp in result) {
|
|
||||||
if (result.hasOwnProperty(childProp)) {
|
|
||||||
all[`${key}_${childProp}`] = result[childProp];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return all;
|
return all;
|
||||||
},
|
}
|
||||||
{} as Record<string, any>
|
|
||||||
);
|
const result = flattenQuery(value);
|
||||||
|
for (let childProp in result) {
|
||||||
|
if (result.hasOwnProperty(childProp)) {
|
||||||
|
all[`${key}_${childProp}`] = result[childProp];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return all;
|
||||||
|
}, {});
|
||||||
|
|
||||||
return flattened;
|
return flattened;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -877,10 +877,10 @@ const getQueryWithVariables = (key: string, getState: () => StoreState): UrlQuer
|
|||||||
|
|
||||||
const queryParamsNew = Object.keys(queryParams)
|
const queryParamsNew = Object.keys(queryParams)
|
||||||
.filter((key) => key.indexOf(VARIABLE_PREFIX) === -1)
|
.filter((key) => key.indexOf(VARIABLE_PREFIX) === -1)
|
||||||
.reduce((obj, key) => {
|
.reduce<UrlQueryMap>((obj, key) => {
|
||||||
obj[key] = queryParams[key];
|
obj[key] = queryParams[key];
|
||||||
return obj;
|
return obj;
|
||||||
}, {} as UrlQueryMap);
|
}, {});
|
||||||
|
|
||||||
for (const variable of getVariablesByKey(key, getState())) {
|
for (const variable of getVariablesByKey(key, getState())) {
|
||||||
if (variable.skipUrlSync) {
|
if (variable.skipUrlSync) {
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ class PromQueryField extends React.PureComponent<PromQueryFieldProps, PromQueryF
|
|||||||
BracesPlugin(),
|
BracesPlugin(),
|
||||||
SlatePrism(
|
SlatePrism(
|
||||||
{
|
{
|
||||||
onlyIn: (node: any) => node.type === 'code_block',
|
onlyIn: (node) => 'type' in node && node.type === 'code_block',
|
||||||
getSyntax: (node: any) => 'promql',
|
getSyntax: (node) => 'promql',
|
||||||
},
|
},
|
||||||
{ ...(prismLanguages as LanguageMap), promql: this.props.datasource.languageProvider.syntax }
|
{ ...(prismLanguages as LanguageMap), promql: this.props.datasource.languageProvider.syntax }
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -71,16 +71,15 @@ export const binaryScalarDefs = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const binaryScalarOperatorToOperatorName = binaryScalarDefs.reduce(
|
export const binaryScalarOperatorToOperatorName = binaryScalarDefs.reduce<
|
||||||
(acc, def) => {
|
Record<string, { id: string; comparison?: boolean }>
|
||||||
acc[def.sign] = {
|
>((acc, def) => {
|
||||||
id: def.id,
|
acc[def.sign] = {
|
||||||
comparison: def.comparison,
|
id: def.id,
|
||||||
};
|
comparison: def.comparison,
|
||||||
return acc;
|
};
|
||||||
},
|
return acc;
|
||||||
{} as Record<string, { id: string; comparison?: boolean }>
|
}, {});
|
||||||
);
|
|
||||||
|
|
||||||
// Not sure about this one. It could also be a more generic 'Simple math operation' where user specifies
|
// Not sure about this one. It could also be a more generic 'Simple math operation' where user specifies
|
||||||
// both the operator and the operand in a single input
|
// both the operator and the operand in a single input
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { MutableDataFrame } from '@grafana/data';
|
import { FieldType, MutableDataFrame } from '@grafana/data';
|
||||||
|
|
||||||
export const bigResponse = new MutableDataFrame({
|
export const bigResponse = new MutableDataFrame({
|
||||||
fields: [
|
fields: [
|
||||||
@@ -1807,73 +1807,73 @@ export const otlpDataFrameFromResponse = new MutableDataFrame({
|
|||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name: 'traceID',
|
name: 'traceID',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['60ba2abb44f13eae'],
|
values: ['60ba2abb44f13eae'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'spanID',
|
name: 'spanID',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['726b5e30102fc0d0'],
|
values: ['726b5e30102fc0d0'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'parentSpanID',
|
name: 'parentSpanID',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['398f0f21a3db99ae'],
|
values: ['398f0f21a3db99ae'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'operationName',
|
name: 'operationName',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['HTTP GET - root'],
|
values: ['HTTP GET - root'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'serviceName',
|
name: 'serviceName',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['db'],
|
values: ['db'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'kind',
|
name: 'kind',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['client'],
|
values: ['client'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'statusCode',
|
name: 'statusCode',
|
||||||
type: 'number',
|
type: FieldType.number,
|
||||||
config: {},
|
config: {},
|
||||||
values: [2],
|
values: [2],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'statusMessage',
|
name: 'statusMessage',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['message'],
|
values: ['message'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'instrumentationLibraryName',
|
name: 'instrumentationLibraryName',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['libraryName'],
|
values: ['libraryName'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'instrumentationLibraryVersion',
|
name: 'instrumentationLibraryVersion',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['libraryVersion'],
|
values: ['libraryVersion'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'traceState',
|
name: 'traceState',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['traceState'],
|
values: ['traceState'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'serviceTags',
|
name: 'serviceTags',
|
||||||
type: 'other',
|
type: FieldType.other,
|
||||||
config: {},
|
config: {},
|
||||||
values: [
|
values: [
|
||||||
[
|
[
|
||||||
@@ -1906,25 +1906,25 @@ export const otlpDataFrameFromResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'startTime',
|
name: 'startTime',
|
||||||
type: 'number',
|
type: FieldType.number,
|
||||||
config: {},
|
config: {},
|
||||||
values: [1627471657255.809],
|
values: [1627471657255.809],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'duration',
|
name: 'duration',
|
||||||
type: 'number',
|
type: FieldType.number,
|
||||||
config: {},
|
config: {},
|
||||||
values: [0.459008],
|
values: [0.459008],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'logs',
|
name: 'logs',
|
||||||
type: 'other',
|
type: FieldType.other,
|
||||||
config: {},
|
config: {},
|
||||||
values: [[]],
|
values: [[]],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'references',
|
name: 'references',
|
||||||
type: 'other',
|
type: FieldType.other,
|
||||||
config: {},
|
config: {},
|
||||||
values: [
|
values: [
|
||||||
[
|
[
|
||||||
@@ -1946,7 +1946,7 @@ export const otlpDataFrameFromResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'tags',
|
name: 'tags',
|
||||||
type: 'other',
|
type: FieldType.other,
|
||||||
config: {},
|
config: {},
|
||||||
values: [
|
values: [
|
||||||
[
|
[
|
||||||
@@ -1971,7 +1971,7 @@ export const otlpDataFrameFromResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
length: 1,
|
length: 1,
|
||||||
} as any);
|
});
|
||||||
|
|
||||||
export const otlpDataFrameToResponse = new MutableDataFrame({
|
export const otlpDataFrameToResponse = new MutableDataFrame({
|
||||||
meta: {
|
meta: {
|
||||||
@@ -1983,7 +1983,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name: 'traceID',
|
name: 'traceID',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['60ba2abb44f13eae'],
|
values: ['60ba2abb44f13eae'],
|
||||||
state: {
|
state: {
|
||||||
@@ -1992,7 +1992,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'spanID',
|
name: 'spanID',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['726b5e30102fc0d0'],
|
values: ['726b5e30102fc0d0'],
|
||||||
state: {
|
state: {
|
||||||
@@ -2001,7 +2001,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'parentSpanID',
|
name: 'parentSpanID',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['398f0f21a3db99ae'],
|
values: ['398f0f21a3db99ae'],
|
||||||
state: {
|
state: {
|
||||||
@@ -2010,7 +2010,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'operationName',
|
name: 'operationName',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['HTTP GET - root'],
|
values: ['HTTP GET - root'],
|
||||||
state: {
|
state: {
|
||||||
@@ -2019,7 +2019,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'serviceName',
|
name: 'serviceName',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['db'],
|
values: ['db'],
|
||||||
state: {
|
state: {
|
||||||
@@ -2028,7 +2028,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'kind',
|
name: 'kind',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['client'],
|
values: ['client'],
|
||||||
state: {
|
state: {
|
||||||
@@ -2037,7 +2037,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'statusCode',
|
name: 'statusCode',
|
||||||
type: 'number',
|
type: FieldType.number,
|
||||||
config: {},
|
config: {},
|
||||||
values: [2],
|
values: [2],
|
||||||
state: {
|
state: {
|
||||||
@@ -2046,7 +2046,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'statusMessage',
|
name: 'statusMessage',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['message'],
|
values: ['message'],
|
||||||
state: {
|
state: {
|
||||||
@@ -2055,7 +2055,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'instrumentationLibraryName',
|
name: 'instrumentationLibraryName',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['libraryName'],
|
values: ['libraryName'],
|
||||||
state: {
|
state: {
|
||||||
@@ -2064,7 +2064,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'instrumentationLibraryVersion',
|
name: 'instrumentationLibraryVersion',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['libraryVersion'],
|
values: ['libraryVersion'],
|
||||||
state: {
|
state: {
|
||||||
@@ -2073,7 +2073,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'traceState',
|
name: 'traceState',
|
||||||
type: 'string',
|
type: FieldType.string,
|
||||||
config: {},
|
config: {},
|
||||||
values: ['traceState'],
|
values: ['traceState'],
|
||||||
state: {
|
state: {
|
||||||
@@ -2082,7 +2082,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'serviceTags',
|
name: 'serviceTags',
|
||||||
type: 'other',
|
type: FieldType.other,
|
||||||
config: {},
|
config: {},
|
||||||
values: [
|
values: [
|
||||||
[
|
[
|
||||||
@@ -2118,7 +2118,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'startTime',
|
name: 'startTime',
|
||||||
type: 'number',
|
type: FieldType.number,
|
||||||
config: {},
|
config: {},
|
||||||
values: [1627471657255.809],
|
values: [1627471657255.809],
|
||||||
state: {
|
state: {
|
||||||
@@ -2127,7 +2127,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'duration',
|
name: 'duration',
|
||||||
type: 'number',
|
type: FieldType.number,
|
||||||
config: {},
|
config: {},
|
||||||
values: [0.459008],
|
values: [0.459008],
|
||||||
state: {
|
state: {
|
||||||
@@ -2136,7 +2136,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'logs',
|
name: 'logs',
|
||||||
type: 'other',
|
type: FieldType.other,
|
||||||
config: {},
|
config: {},
|
||||||
values: [[]],
|
values: [[]],
|
||||||
state: {
|
state: {
|
||||||
@@ -2145,7 +2145,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'tags',
|
name: 'tags',
|
||||||
type: 'other',
|
type: FieldType.other,
|
||||||
config: {},
|
config: {},
|
||||||
values: [
|
values: [
|
||||||
[
|
[
|
||||||
@@ -2173,7 +2173,7 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'references',
|
name: 'references',
|
||||||
type: 'other',
|
type: FieldType.other,
|
||||||
config: {},
|
config: {},
|
||||||
labels: undefined,
|
labels: undefined,
|
||||||
values: [
|
values: [
|
||||||
@@ -2198,9 +2198,8 @@ export const otlpDataFrameToResponse = new MutableDataFrame({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
first: ['60ba2abb44f13eae'],
|
|
||||||
length: 1,
|
length: 1,
|
||||||
} as any);
|
});
|
||||||
|
|
||||||
export const otlpResponse = {
|
export const otlpResponse = {
|
||||||
batches: [
|
batches: [
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { css } from '@emotion/css';
|
import { css } from '@emotion/css';
|
||||||
import type { languages } from 'monaco-editor';
|
|
||||||
import React, { useEffect, useRef } from 'react';
|
import React, { useEffect, useRef } from 'react';
|
||||||
|
|
||||||
import { GrafanaTheme2 } from '@grafana/data';
|
import { GrafanaTheme2 } from '@grafana/data';
|
||||||
@@ -194,8 +193,8 @@ function ensureTraceQL(monaco: Monaco) {
|
|||||||
traceqlSetupDone = true;
|
traceqlSetupDone = true;
|
||||||
const { aliases, extensions, mimetypes, def } = languageDefinition;
|
const { aliases, extensions, mimetypes, def } = languageDefinition;
|
||||||
monaco.languages.register({ id: langId, aliases, extensions, mimetypes });
|
monaco.languages.register({ id: langId, aliases, extensions, mimetypes });
|
||||||
monaco.languages.setMonarchTokensProvider(langId, def.language as languages.IMonarchLanguage);
|
monaco.languages.setMonarchTokensProvider(langId, def.language);
|
||||||
monaco.languages.setLanguageConfiguration(langId, def.languageConfiguration as languages.LanguageConfiguration);
|
monaco.languages.setLanguageConfiguration(langId, def.languageConfiguration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
import type { languages } from 'monaco-editor';
|
||||||
import { Grammar } from 'prismjs';
|
import { Grammar } from 'prismjs';
|
||||||
|
|
||||||
export const languageConfiguration = {
|
export const languageConfiguration: languages.LanguageConfiguration = {
|
||||||
// the default separators except `@$`
|
// the default separators except `@$`
|
||||||
wordPattern: /(-?\d*\.\d\w*)|([^`~!#%^&*()\-=+\[{\]}\\|;:'",.<>\/?\s]+)/g,
|
wordPattern: /(-?\d*\.\d\w*)|([^`~!#%^&*()\-=+\[{\]}\\|;:'",.<>\/?\s]+)/g,
|
||||||
brackets: [
|
brackets: [
|
||||||
@@ -35,7 +36,7 @@ const keywords = intrinsics.concat(scopes);
|
|||||||
|
|
||||||
const statusValues = ['ok', 'unset', 'error', 'false', 'true'];
|
const statusValues = ['ok', 'unset', 'error', 'false', 'true'];
|
||||||
|
|
||||||
export const language = {
|
export const language: languages.IMonarchLanguage = {
|
||||||
ignoreCase: false,
|
ignoreCase: false,
|
||||||
defaultToken: '',
|
defaultToken: '',
|
||||||
tokenPostfix: '.traceql',
|
tokenPostfix: '.traceql',
|
||||||
|
|||||||
@@ -4,14 +4,13 @@ import { SelectableValue } from '@grafana/data';
|
|||||||
import { InlineField, InlineFieldRow, Input, Select } from '@grafana/ui';
|
import { InlineField, InlineFieldRow, Input, Select } from '@grafana/ui';
|
||||||
|
|
||||||
import { EditorProps } from '../QueryEditor';
|
import { EditorProps } from '../QueryEditor';
|
||||||
import { StreamingQuery } from '../dataquery.gen';
|
|
||||||
|
|
||||||
const streamingClientFields = [
|
const streamingClientFields = [
|
||||||
{ label: 'Speed (ms)', id: 'speed', placeholder: 'value', min: 10, step: 10 },
|
{ label: 'Speed (ms)', id: 'speed', placeholder: 'value', min: 10, step: 10 },
|
||||||
{ label: 'Spread', id: 'spread', placeholder: 'value', min: 0.5, step: 0.1 },
|
{ label: 'Spread', id: 'spread', placeholder: 'value', min: 0.5, step: 0.1 },
|
||||||
{ label: 'Noise', id: 'noise', placeholder: 'value', min: 0, step: 0.1 },
|
{ label: 'Noise', id: 'noise', placeholder: 'value', min: 0, step: 0.1 },
|
||||||
{ label: 'Bands', id: 'bands', placeholder: 'bands', min: 0, step: 1 },
|
{ label: 'Bands', id: 'bands', placeholder: 'bands', min: 0, step: 1 },
|
||||||
];
|
] as const;
|
||||||
|
|
||||||
const types = [
|
const types = [
|
||||||
{ value: 'signal', label: 'Signal' },
|
{ value: 'signal', label: 'Signal' },
|
||||||
@@ -46,7 +45,7 @@ export const StreamingClientEditor = ({ onChange, query }: EditorProps) => {
|
|||||||
name={id}
|
name={id}
|
||||||
min={min}
|
min={min}
|
||||||
step={step}
|
step={step}
|
||||||
value={query.stream?.[id as keyof StreamingQuery]}
|
value={query.stream?.[id]}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
onChange={onInputChange}
|
onChange={onInputChange}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { FieldColorModeId, FieldType, PreferredVisualisationType, NodeGraphDataFrameFieldNames } from '@grafana/data';
|
import { FieldColorModeId, FieldType, NodeGraphDataFrameFieldNames } from '@grafana/data';
|
||||||
|
|
||||||
export const nodes = {
|
export const nodes = {
|
||||||
fields: [
|
fields: [
|
||||||
@@ -157,7 +157,7 @@ export const nodes = {
|
|||||||
values: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
values: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
meta: { preferredVisualisationType: 'nodeGraph' as PreferredVisualisationType },
|
meta: { preferredVisualisationType: 'nodeGraph' as const },
|
||||||
name: 'nodes',
|
name: 'nodes',
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -333,6 +333,6 @@ export const edges = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
meta: { preferredVisualisationType: 'nodeGraph' as PreferredVisualisationType },
|
meta: { preferredVisualisationType: 'nodeGraph' as const },
|
||||||
name: 'edges',
|
name: 'edges',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -110,12 +110,12 @@ export const CandlestickPanel = ({
|
|||||||
if (forField.name === info.volume?.name) {
|
if (forField.name === info.volume?.name) {
|
||||||
let filter = (u: uPlot, splits: number[]) => {
|
let filter = (u: uPlot, splits: number[]) => {
|
||||||
let _splits = [];
|
let _splits = [];
|
||||||
let max = u.series[volumeIdx].max as number;
|
let max = u.series[volumeIdx].max;
|
||||||
|
|
||||||
for (let i = 0; i < splits.length; i++) {
|
for (let i = 0; i < splits.length; i++) {
|
||||||
_splits.push(splits[i]);
|
_splits.push(splits[i]);
|
||||||
|
|
||||||
if (splits[i] > max) {
|
if (max && splits[i] > max) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -214,7 +214,7 @@ export const CandlestickPanel = ({
|
|||||||
if (shouldRenderPrice) {
|
if (shouldRenderPrice) {
|
||||||
// hide series from legend that are rendered as composite markers
|
// hide series from legend that are rendered as composite markers
|
||||||
for (let key in renderers[0].fieldMap) {
|
for (let key in renderers[0].fieldMap) {
|
||||||
let field = (info as any)[key] as Field;
|
let field: Field = (info as any)[key];
|
||||||
field.config = {
|
field.config = {
|
||||||
...field.config,
|
...field.config,
|
||||||
custom: {
|
custom: {
|
||||||
|
|||||||
@@ -17,21 +17,21 @@ import { CandlestickData, candlestickFieldsInfo, FieldPickerInfo, prepareCandles
|
|||||||
import { CandlestickSuggestionsSupplier } from './suggestions';
|
import { CandlestickSuggestionsSupplier } from './suggestions';
|
||||||
import { defaultCandlestickColors, defaultOptions, Options, VizDisplayMode, ColorStrategy, CandleStyle } from './types';
|
import { defaultCandlestickColors, defaultOptions, Options, VizDisplayMode, ColorStrategy, CandleStyle } from './types';
|
||||||
|
|
||||||
const modeOptions = [
|
const modeOptions: Array<SelectableValue<VizDisplayMode>> = [
|
||||||
{ label: 'Candles', value: VizDisplayMode.Candles },
|
{ label: 'Candles', value: VizDisplayMode.Candles },
|
||||||
{ label: 'Volume', value: VizDisplayMode.Volume },
|
{ label: 'Volume', value: VizDisplayMode.Volume },
|
||||||
{ label: 'Both', value: VizDisplayMode.CandlesVolume },
|
{ label: 'Both', value: VizDisplayMode.CandlesVolume },
|
||||||
] as Array<SelectableValue<VizDisplayMode>>;
|
];
|
||||||
|
|
||||||
const candleStyles = [
|
const candleStyles: Array<SelectableValue<CandleStyle>> = [
|
||||||
{ label: 'Candles', value: CandleStyle.Candles },
|
{ label: 'Candles', value: CandleStyle.Candles },
|
||||||
{ label: 'OHLC Bars', value: CandleStyle.OHLCBars },
|
{ label: 'OHLC Bars', value: CandleStyle.OHLCBars },
|
||||||
] as Array<SelectableValue<CandleStyle>>;
|
];
|
||||||
|
|
||||||
const colorStrategies = [
|
const colorStrategies: Array<SelectableValue<ColorStrategy>> = [
|
||||||
{ label: 'Since Open', value: ColorStrategy.OpenClose },
|
{ label: 'Since Open', value: ColorStrategy.OpenClose },
|
||||||
{ label: 'Since Prior Close', value: ColorStrategy.CloseClose },
|
{ label: 'Since Prior Close', value: ColorStrategy.CloseClose },
|
||||||
] as Array<SelectableValue<ColorStrategy>>;
|
];
|
||||||
|
|
||||||
const numericFieldFilter = (f: Field) => f.type === FieldType.number;
|
const numericFieldFilter = (f: Field) => f.type === FieldType.number;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ function addFieldPicker(
|
|||||||
let placeholderText = 'Auto ';
|
let placeholderText = 'Auto ';
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
const current = data[info.key] as Field;
|
const current = data[info.key];
|
||||||
|
|
||||||
if (current?.config) {
|
if (current?.config) {
|
||||||
placeholderText += '= ' + getFieldDisplayName(current);
|
placeholderText += '= ' + getFieldDisplayName(current);
|
||||||
|
|||||||
@@ -120,12 +120,12 @@ export function drawMarkers(opts: RendererOpts) {
|
|||||||
let intraDir = Math.sign(cData[i]! - oData[i]!);
|
let intraDir = Math.sign(cData[i]! - oData[i]!);
|
||||||
|
|
||||||
// volume
|
// volume
|
||||||
if (drawVolume) {
|
if (drawVolume && flatPathVol && upPathVol && downPathVol) {
|
||||||
let outerPath = selectPath(
|
let outerPath = selectPath(
|
||||||
colorStrategy === ColorStrategy.CloseClose ? interDir : intraDir,
|
colorStrategy === ColorStrategy.CloseClose ? interDir : intraDir,
|
||||||
flatPathVol as Path2D,
|
flatPathVol,
|
||||||
upPathVol as Path2D,
|
upPathVol,
|
||||||
downPathVol as Path2D,
|
downPathVol,
|
||||||
i === idx0 && ColorStrategy.CloseClose ? false : flatAsUp
|
i === idx0 && ColorStrategy.CloseClose ? false : flatAsUp
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -133,12 +133,12 @@ export function drawMarkers(opts: RendererOpts) {
|
|||||||
outerPath.rect(tPx - halfWidth, vPx, barWidth, zeroPx! - vPx);
|
outerPath.rect(tPx - halfWidth, vPx, barWidth, zeroPx! - vPx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drawPrice) {
|
if (drawPrice && flatPath && upPath && downPath) {
|
||||||
let outerPath = selectPath(
|
let outerPath = selectPath(
|
||||||
colorStrategy === ColorStrategy.CloseClose ? interDir : intraDir,
|
colorStrategy === ColorStrategy.CloseClose ? interDir : intraDir,
|
||||||
flatPath as Path2D,
|
flatPath,
|
||||||
upPath as Path2D,
|
upPath,
|
||||||
downPath as Path2D,
|
downPath,
|
||||||
i === idx0 && ColorStrategy.CloseClose ? false : flatAsUp
|
i === idx0 && ColorStrategy.CloseClose ? false : flatAsUp
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -179,26 +179,26 @@ export function drawMarkers(opts: RendererOpts) {
|
|||||||
ctx.rect(u.bbox.left, u.bbox.top, u.bbox.width, u.bbox.height);
|
ctx.rect(u.bbox.left, u.bbox.top, u.bbox.width, u.bbox.height);
|
||||||
ctx.clip();
|
ctx.clip();
|
||||||
|
|
||||||
if (drawVolume) {
|
if (drawVolume && flatPathVol && upPathVol && downPathVol) {
|
||||||
ctx.fillStyle = alpha(upColor, volumeAlpha);
|
ctx.fillStyle = alpha(upColor, volumeAlpha);
|
||||||
ctx.fill(upPathVol as Path2D);
|
ctx.fill(upPathVol);
|
||||||
|
|
||||||
ctx.fillStyle = alpha(downColor, volumeAlpha);
|
ctx.fillStyle = alpha(downColor, volumeAlpha);
|
||||||
ctx.fill(downPathVol as Path2D);
|
ctx.fill(downPathVol);
|
||||||
|
|
||||||
ctx.fillStyle = alpha(flatColor, volumeAlpha);
|
ctx.fillStyle = alpha(flatColor, volumeAlpha);
|
||||||
ctx.fill(flatPathVol as Path2D);
|
ctx.fill(flatPathVol);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drawPrice) {
|
if (drawPrice && flatPath && upPath && downPath) {
|
||||||
ctx.fillStyle = upColor;
|
ctx.fillStyle = upColor;
|
||||||
ctx.fill(upPath as Path2D);
|
ctx.fill(upPath);
|
||||||
|
|
||||||
ctx.fillStyle = downColor;
|
ctx.fillStyle = downColor;
|
||||||
ctx.fill(downPath as Path2D);
|
ctx.fill(downPath);
|
||||||
|
|
||||||
ctx.fillStyle = flatColor;
|
ctx.fillStyle = flatColor;
|
||||||
ctx.fill(flatPath as Path2D);
|
ctx.fill(flatPath);
|
||||||
|
|
||||||
ctx.globalCompositeOperation = 'destination-out';
|
ctx.globalCompositeOperation = 'destination-out';
|
||||||
ctx.fill(hollowPath);
|
ctx.fill(hollowPath);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { VisualizationSuggestionsBuilder } from '@grafana/data';
|
import { VisualizationSuggestionsBuilder } from '@grafana/data';
|
||||||
|
import { LegendDisplayMode } from '@grafana/schema';
|
||||||
import { SuggestionName } from 'app/types/suggestions';
|
import { SuggestionName } from 'app/types/suggestions';
|
||||||
|
|
||||||
import { PieChartLabels, Options, PieChartType } from './panelcfg.gen';
|
import { PieChartLabels, Options, PieChartType } from './panelcfg.gen';
|
||||||
@@ -15,14 +16,11 @@ export class PieChartSuggestionsSupplier {
|
|||||||
},
|
},
|
||||||
displayLabels: [PieChartLabels.Percent],
|
displayLabels: [PieChartLabels.Percent],
|
||||||
legend: {
|
legend: {
|
||||||
|
calcs: [],
|
||||||
|
displayMode: LegendDisplayMode.Hidden,
|
||||||
placement: 'right',
|
placement: 'right',
|
||||||
values: [],
|
values: [],
|
||||||
} as any,
|
showLegend: false,
|
||||||
},
|
|
||||||
cardOptions: {
|
|
||||||
previewModifier: (s) => {
|
|
||||||
// Hide labels in preview
|
|
||||||
s.options!.legend.showLegend = false;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export const statPanelChangedHandler = (
|
|||||||
prevOptions: any
|
prevOptions: any
|
||||||
) => {
|
) => {
|
||||||
// This handles most config changes
|
// This handles most config changes
|
||||||
const options = sharedSingleStatPanelChangedHandler(panel, prevPluginId, prevOptions) as Options;
|
const options: Options = sharedSingleStatPanelChangedHandler(panel, prevPluginId, prevOptions);
|
||||||
|
|
||||||
// Changing from angular singlestat
|
// Changing from angular singlestat
|
||||||
if (prevOptions.angular && (prevPluginId === 'singlestat' || prevPluginId === 'grafana-singlestat-panel')) {
|
if (prevOptions.angular && (prevPluginId === 'singlestat' || prevPluginId === 'grafana-singlestat-panel')) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export const timelinePanelChangedHandler = (
|
|||||||
prevPluginId: string,
|
prevPluginId: string,
|
||||||
prevOptions: any
|
prevOptions: any
|
||||||
) => {
|
) => {
|
||||||
let options = (panel.options ?? {}) as Options;
|
let options: Options = panel.options ?? {};
|
||||||
|
|
||||||
// Changing from angular singlestat
|
// Changing from angular singlestat
|
||||||
if (prevPluginId === 'natel-discrete-panel' && prevOptions.angular) {
|
if (prevPluginId === 'natel-discrete-panel' && prevOptions.angular) {
|
||||||
@@ -34,17 +34,17 @@ export const timelinePanelChangedHandler = (
|
|||||||
|
|
||||||
if (isArray(oldOptions.colorMaps)) {
|
if (isArray(oldOptions.colorMaps)) {
|
||||||
for (const p of oldOptions.colorMaps) {
|
for (const p of oldOptions.colorMaps) {
|
||||||
const color = p.color as string;
|
const color: string = p.color;
|
||||||
if (color) {
|
if (color) {
|
||||||
valuemap.options[p.text as string] = { color };
|
valuemap.options[p.text] = { color };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isArray(oldOptions.valueMaps)) {
|
if (isArray(oldOptions.valueMaps)) {
|
||||||
for (const p of oldOptions.valueMaps) {
|
for (const p of oldOptions.valueMaps) {
|
||||||
const text = p.text as string;
|
const text: string = p.text;
|
||||||
const value = p.value as string;
|
const value: string = p.value;
|
||||||
if (text && value) {
|
if (text && value) {
|
||||||
let old = valuemap.options[value];
|
let old = valuemap.options[value];
|
||||||
if (old) {
|
if (old) {
|
||||||
@@ -60,7 +60,7 @@ export const timelinePanelChangedHandler = (
|
|||||||
for (const p of oldOptions.rangeMaps) {
|
for (const p of oldOptions.rangeMaps) {
|
||||||
let from = +p.from;
|
let from = +p.from;
|
||||||
let to = +p.to;
|
let to = +p.to;
|
||||||
const text = p.text as string;
|
const text: string = p.text;
|
||||||
if (text) {
|
if (text) {
|
||||||
fieldConfig.defaults.mappings.push({
|
fieldConfig.defaults.mappings.push({
|
||||||
type: MappingType.RangeToText,
|
type: MappingType.RangeToText,
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ export const plugin = new PanelPlugin<Options, TableFieldOptions>(TablePanel)
|
|||||||
path: 'footer.reducer',
|
path: 'footer.reducer',
|
||||||
name: 'Calculation',
|
name: 'Calculation',
|
||||||
description: 'Choose a reducer function / calculation',
|
description: 'Choose a reducer function / calculation',
|
||||||
editor: standardEditorsRegistry.get('stats-picker').editor as any,
|
editor: standardEditorsRegistry.get('stats-picker').editor,
|
||||||
defaultValue: [ReducerID.sum],
|
defaultValue: [ReducerID.sum],
|
||||||
showIf: (cfg) => cfg.footer?.show,
|
showIf: (cfg) => cfg.footer?.show,
|
||||||
})
|
})
|
||||||
@@ -167,7 +167,7 @@ export const plugin = new PanelPlugin<Options, TableFieldOptions>(TablePanel)
|
|||||||
if (field.type === FieldType.number) {
|
if (field.type === FieldType.number) {
|
||||||
const name = getFieldDisplayName(field, frame, context.data);
|
const name = getFieldDisplayName(field, frame, context.data);
|
||||||
const value = field.name;
|
const value = field.name;
|
||||||
options.push({ value, label: name } as any);
|
options.push({ value, label: name });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ export const textPanelMigrationHandler = (panel: PanelModel<Options>): Partial<O
|
|||||||
|
|
||||||
// Migrates old Angular based text panel props to new props
|
// Migrates old Angular based text panel props to new props
|
||||||
if (panel.hasOwnProperty('content') && panel.hasOwnProperty('mode')) {
|
if (panel.hasOwnProperty('content') && panel.hasOwnProperty('mode')) {
|
||||||
const oldTextPanel: any = panel as any;
|
const oldTextPanel: any = panel;
|
||||||
const content = oldTextPanel.content;
|
const content = oldTextPanel.content;
|
||||||
const mode = oldTextPanel.mode as TextMode;
|
const mode: TextMode = oldTextPanel.mode;
|
||||||
|
|
||||||
delete oldTextPanel.content;
|
delete oldTextPanel.content;
|
||||||
delete oldTextPanel.mode;
|
delete oldTextPanel.mode;
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ export function graphToTimeseriesOptions(angular: any): {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const graph = y1.custom ?? ({} as GraphFieldConfig);
|
const graph: GraphFieldConfig = y1.custom ?? {};
|
||||||
graph.drawStyle = angular.bars ? GraphDrawStyle.Bars : angular.lines ? GraphDrawStyle.Line : GraphDrawStyle.Points;
|
graph.drawStyle = angular.bars ? GraphDrawStyle.Bars : angular.lines ? GraphDrawStyle.Line : GraphDrawStyle.Points;
|
||||||
|
|
||||||
if (angular.points) {
|
if (angular.points) {
|
||||||
@@ -344,7 +344,7 @@ export function graphToTimeseriesOptions(angular: any): {
|
|||||||
}
|
}
|
||||||
|
|
||||||
y1.custom = omitBy(graph, isNil);
|
y1.custom = omitBy(graph, isNil);
|
||||||
y1.nullValueMode = angular.nullPointMode as NullValueMode;
|
y1.nullValueMode = angular.nullPointMode;
|
||||||
|
|
||||||
const options: Options = {
|
const options: Options = {
|
||||||
legend: {
|
legend: {
|
||||||
@@ -616,7 +616,7 @@ function getFieldConfigFromOldAxis(obj: any): FieldConfig<GraphFieldConfig> {
|
|||||||
graph.axisLabel = obj.label;
|
graph.axisLabel = obj.label;
|
||||||
}
|
}
|
||||||
if (obj.logBase) {
|
if (obj.logBase) {
|
||||||
const log = obj.logBase as number;
|
const log: number = obj.logBase;
|
||||||
if (log === 2 || log === 10) {
|
if (log === 2 || log === 10) {
|
||||||
graph.scaleDistribution = {
|
graph.scaleDistribution = {
|
||||||
type: ScaleDistribution.Log,
|
type: ScaleDistribution.Log,
|
||||||
@@ -666,7 +666,7 @@ function fillY2DynamicValues(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function validNumber(val: any): number | undefined {
|
function validNumber(val: unknown): number | undefined {
|
||||||
if (isNumber(val)) {
|
if (isNumber(val)) {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import {
|
|||||||
GraphDrawStyle,
|
GraphDrawStyle,
|
||||||
GraphFieldConfig,
|
GraphFieldConfig,
|
||||||
GraphGradientMode,
|
GraphGradientMode,
|
||||||
|
LegendDisplayMode,
|
||||||
LineInterpolation,
|
LineInterpolation,
|
||||||
StackingMode,
|
StackingMode,
|
||||||
VizLegendOptions,
|
|
||||||
} from '@grafana/schema';
|
} from '@grafana/schema';
|
||||||
import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
|
import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
|
||||||
import { SuggestionName } from 'app/types/suggestions';
|
import { SuggestionName } from 'app/types/suggestions';
|
||||||
@@ -29,7 +29,12 @@ export class TimeSeriesSuggestionsSupplier {
|
|||||||
name: SuggestionName.LineChart,
|
name: SuggestionName.LineChart,
|
||||||
pluginId: 'timeseries',
|
pluginId: 'timeseries',
|
||||||
options: {
|
options: {
|
||||||
legend: {} as VizLegendOptions,
|
legend: {
|
||||||
|
calcs: [],
|
||||||
|
displayMode: LegendDisplayMode.Hidden,
|
||||||
|
placement: 'right',
|
||||||
|
showLegend: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
fieldConfig: {
|
fieldConfig: {
|
||||||
defaults: {
|
defaults: {
|
||||||
@@ -39,8 +44,6 @@ export class TimeSeriesSuggestionsSupplier {
|
|||||||
},
|
},
|
||||||
cardOptions: {
|
cardOptions: {
|
||||||
previewModifier: (s) => {
|
previewModifier: (s) => {
|
||||||
s.options!.legend.showLegend = false;
|
|
||||||
|
|
||||||
if (s.fieldConfig?.defaults.custom?.drawStyle !== GraphDrawStyle.Bars) {
|
if (s.fieldConfig?.defaults.custom?.drawStyle !== GraphDrawStyle.Bars) {
|
||||||
s.fieldConfig!.defaults.custom!.lineWidth = Math.max(s.fieldConfig!.defaults.custom!.lineWidth ?? 1, 2);
|
s.fieldConfig!.defaults.custom!.lineWidth = Math.max(s.fieldConfig!.defaults.custom!.lineWidth ?? 1, 2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { VisualizationSuggestionsBuilder } from '@grafana/data';
|
import { VisualizationSuggestionsBuilder } from '@grafana/data';
|
||||||
import { GraphDrawStyle, GraphFieldConfig, VizLegendOptions } from '@grafana/schema';
|
import { GraphDrawStyle, GraphFieldConfig, LegendDisplayMode } from '@grafana/schema';
|
||||||
import { SuggestionName } from 'app/types/suggestions';
|
import { SuggestionName } from 'app/types/suggestions';
|
||||||
|
|
||||||
import { Options } from './panelcfg.gen';
|
import { Options } from './panelcfg.gen';
|
||||||
@@ -17,7 +17,12 @@ export class TrendSuggestionsSupplier {
|
|||||||
name: SuggestionName.LineChart,
|
name: SuggestionName.LineChart,
|
||||||
pluginId: 'trend',
|
pluginId: 'trend',
|
||||||
options: {
|
options: {
|
||||||
legend: {} as VizLegendOptions,
|
legend: {
|
||||||
|
calcs: [],
|
||||||
|
displayMode: LegendDisplayMode.Hidden,
|
||||||
|
placement: 'right',
|
||||||
|
showLegend: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
fieldConfig: {
|
fieldConfig: {
|
||||||
defaults: {
|
defaults: {
|
||||||
@@ -27,8 +32,6 @@ export class TrendSuggestionsSupplier {
|
|||||||
},
|
},
|
||||||
cardOptions: {
|
cardOptions: {
|
||||||
previewModifier: (s) => {
|
previewModifier: (s) => {
|
||||||
s.options!.legend.showLegend = false;
|
|
||||||
|
|
||||||
if (s.fieldConfig?.defaults.custom?.drawStyle !== GraphDrawStyle.Bars) {
|
if (s.fieldConfig?.defaults.custom?.drawStyle !== GraphDrawStyle.Bars) {
|
||||||
s.fieldConfig!.defaults.custom!.lineWidth = Math.max(s.fieldConfig!.defaults.custom!.lineWidth ?? 1, 2);
|
s.fieldConfig!.defaults.custom!.lineWidth = Math.max(s.fieldConfig!.defaults.custom!.lineWidth ?? 1, 2);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user