mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: improve types (#78126)
* fix some types * more type updates * some more fixes * more changes * string instead of unknown * more like original logic * remove outdated comment * update betterer
This commit is contained in:
parent
b0448b92e5
commit
2c0c51a0df
@ -17,10 +17,7 @@ exports[`better eslint`] = {
|
|||||||
],
|
],
|
||||||
"packages/grafana-data/src/dataframe/DataFrameJSON.ts:5381": [
|
"packages/grafana-data/src/dataframe/DataFrameJSON.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.", "3"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/dataframe/DataFrameView.test.ts:5381": [
|
"packages/grafana-data/src/dataframe/DataFrameView.test.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@ -30,12 +27,7 @@ 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, "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, "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.", "6"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "7"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "8"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/dataframe/MutableDataFrame.ts:5381": [
|
"packages/grafana-data/src/dataframe/MutableDataFrame.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@ -63,9 +55,8 @@ 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"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
[0, 0, 0, "Do not use any type assertions.", "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, "Do not use any type assertions.", "6"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "7"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/dataframe/dimensions.ts:5381": [
|
"packages/grafana-data/src/dataframe/dimensions.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
@ -80,24 +71,23 @@ 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, "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"],
|
[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, "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.", "9"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "10"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "10"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "11"],
|
[0, 0, 0, "Do not use any type assertions.", "11"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "12"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "12"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "13"],
|
[0, 0, 0, "Do not use any type assertions.", "13"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "14"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "14"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "15"],
|
[0, 0, 0, "Do not use any type assertions.", "15"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "16"],
|
[0, 0, 0, "Do not use any type assertions.", "16"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "17"],
|
[0, 0, 0, "Do not use any type assertions.", "17"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "18"],
|
[0, 0, 0, "Do not use any type assertions.", "18"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "19"],
|
[0, 0, 0, "Do not use any type assertions.", "19"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "20"],
|
[0, 0, 0, "Do not use any type assertions.", "20"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "21"],
|
[0, 0, 0, "Do not use any type assertions.", "21"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "22"],
|
[0, 0, 0, "Do not use any type assertions.", "22"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "23"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/datetime/datemath.ts:5381": [
|
"packages/grafana-data/src/datetime/datemath.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@ -153,26 +143,20 @@ exports[`better eslint`] = {
|
|||||||
"packages/grafana-data/src/field/displayProcessor.ts:5381": [
|
"packages/grafana-data/src/field/displayProcessor.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"]
|
|
||||||
],
|
|
||||||
"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.", "1"]
|
|
||||||
],
|
],
|
||||||
"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"],
|
||||||
[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, "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, "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, "Do not use any type assertions.", "10"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "11"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/field/scale.ts:5381": [
|
"packages/grafana-data/src/field/scale.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
@ -191,8 +175,7 @@ exports[`better eslint`] = {
|
|||||||
],
|
],
|
||||||
"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"],
|
||||||
[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"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/panel/PanelPlugin.ts:5381": [
|
"packages/grafana-data/src/panel/PanelPlugin.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@ -205,15 +188,10 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Do not use any type assertions.", "7"]
|
[0, 0, 0, "Do not use any type assertions.", "7"]
|
||||||
],
|
],
|
||||||
"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.", "2"]
|
|
||||||
],
|
],
|
||||||
"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"]
|
||||||
[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"]
|
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/themes/colorManipulator.ts:5381": [
|
"packages/grafana-data/src/themes/colorManipulator.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@ -223,9 +201,6 @@ exports[`better eslint`] = {
|
|||||||
"packages/grafana-data/src/themes/createColors.ts:5381": [
|
"packages/grafana-data/src/themes/createColors.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
],
|
],
|
||||||
"packages/grafana-data/src/transformations/fieldReducer.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"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"]
|
||||||
@ -2989,9 +2964,6 @@ exports[`better eslint`] = {
|
|||||||
"public/app/features/dashboard/components/DeleteDashboard/DeleteDashboardModal.tsx:5381": [
|
"public/app/features/dashboard/components/DeleteDashboard/DeleteDashboardModal.tsx:5381": [
|
||||||
[0, 0, 0, "Styles should be written using objects.", "0"]
|
[0, 0, 0, "Styles should be written using objects.", "0"]
|
||||||
],
|
],
|
||||||
"public/app/features/dashboard/components/GenAI/utils.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx:5381": [
|
"public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx:5381": [
|
||||||
[0, 0, 0, "Styles should be written using objects.", "0"],
|
[0, 0, 0, "Styles should be written using objects.", "0"],
|
||||||
[0, 0, 0, "Styles should be written using objects.", "1"],
|
[0, 0, 0, "Styles should be written using objects.", "1"],
|
||||||
@ -3099,9 +3071,6 @@ 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"]
|
||||||
],
|
],
|
||||||
"public/app/features/dashboard/components/PanelEditor/types.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/dashboard/components/PanelEditor/utils.ts:5381": [
|
"public/app/features/dashboard/components/PanelEditor/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"],
|
||||||
@ -3270,13 +3239,8 @@ 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, "Use data-testid for E2E selectors instead of aria-label", "4"]
|
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "4"]
|
||||||
],
|
],
|
||||||
"public/app/features/dashboard/dashgrid/DashboardPanel.tsx:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx:5381": [
|
"public/app/features/dashboard/dashgrid/PanelStateWrapper.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.", "2"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/dashboard/dashgrid/SeriesVisibilityConfigFactory.ts:5381": [
|
"public/app/features/dashboard/dashgrid/SeriesVisibilityConfigFactory.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
@ -3328,20 +3292,17 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "17"],
|
[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.", "18"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "19"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "19"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "20"],
|
[0, 0, 0, "Do not use any type assertions.", "20"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "21"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "21"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "22"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "22"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "23"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "23"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "24"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "24"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "25"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "25"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "26"],
|
[0, 0, 0, "Do not use any type assertions.", "26"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "27"],
|
[0, 0, 0, "Do not use any type assertions.", "27"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "28"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "28"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "29"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "29"],
|
||||||
[0, 0, 0, "Do not use any type assertions.", "30"],
|
[0, 0, 0, "Do not use any type assertions.", "30"]
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "31"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "32"],
|
|
||||||
[0, 0, 0, "Do not use any type assertions.", "33"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/dashboard/state/DashboardModel.repeat.test.ts:5381": [
|
"public/app/features/dashboard/state/DashboardModel.repeat.test.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@ -3378,10 +3339,8 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "19"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "19"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "20"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "20"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "21"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "21"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "22"],
|
[0, 0, 0, "Do not use any type assertions.", "22"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "23"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "23"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "24"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "25"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/dashboard/state/PanelModel.test.ts:5381": [
|
"public/app/features/dashboard/state/PanelModel.test.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
@ -3439,9 +3398,6 @@ exports[`better eslint`] = {
|
|||||||
"public/app/features/dashboard/state/initDashboard.ts:5381": [
|
"public/app/features/dashboard/state/initDashboard.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/dashboard/state/reducers.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/dashboard/utils/getPanelMenu.test.ts:5381": [
|
"public/app/features/dashboard/utils/getPanelMenu.test.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
],
|
],
|
||||||
@ -3619,8 +3575,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/features/dimensions/utils.ts:5381": [
|
"public/app/features/dimensions/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, "Unexpected any. Specify a different type.", "1"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/explore/ContentOutline/ContentOutline.tsx:5381": [
|
"public/app/features/explore/ContentOutline/ContentOutline.tsx:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
@ -4137,9 +4092,8 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Do not use any type assertions.", "5"]
|
[0, 0, 0, "Do not use any type assertions.", "5"]
|
||||||
],
|
],
|
||||||
"public/app/features/expressions/ExpressionDatasource.ts:5381": [
|
"public/app/features/expressions/ExpressionDatasource.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "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"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/expressions/components/Condition.tsx:5381": [
|
"public/app/features/expressions/components/Condition.tsx:5381": [
|
||||||
[0, 0, 0, "Styles should be written using objects.", "0"],
|
[0, 0, 0, "Styles should be written using objects.", "0"],
|
||||||
@ -4169,12 +4123,6 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Styles should be written using objects.", "0"],
|
[0, 0, 0, "Styles should be written using objects.", "0"],
|
||||||
[0, 0, 0, "Styles should be written using objects.", "1"]
|
[0, 0, 0, "Styles should be written using objects.", "1"]
|
||||||
],
|
],
|
||||||
"public/app/features/geo/format/geohash.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/geo/format/geojson.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/geo/gazetteer/gazetteer.ts:5381": [
|
"public/app/features/geo/gazetteer/gazetteer.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, "Do not use any type assertions.", "1"]
|
||||||
@ -4195,9 +4143,6 @@ exports[`better eslint`] = {
|
|||||||
"public/app/features/inspector/InspectDataTab.tsx:5381": [
|
"public/app/features/inspector/InspectDataTab.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/inspector/InspectErrorTab.tsx:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/inspector/InspectJSONTab.tsx:5381": [
|
"public/app/features/inspector/InspectJSONTab.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"]
|
||||||
],
|
],
|
||||||
@ -4215,11 +4160,9 @@ exports[`better eslint`] = {
|
|||||||
],
|
],
|
||||||
"public/app/features/inspector/QueryInspector.tsx:5381": [
|
"public/app/features/inspector/QueryInspector.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, "Styles should be written using objects.", "1"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "2"],
|
||||||
[0, 0, 0, "Styles should be written using objects.", "3"],
|
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "3"]
|
||||||
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "4"],
|
|
||||||
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "5"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/inspector/styles.ts:5381": [
|
"public/app/features/inspector/styles.ts:5381": [
|
||||||
[0, 0, 0, "Styles should be written using objects.", "0"],
|
[0, 0, 0, "Styles should be written using objects.", "0"],
|
||||||
@ -4234,9 +4177,6 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Styles should be written using objects.", "9"],
|
[0, 0, 0, "Styles should be written using objects.", "9"],
|
||||||
[0, 0, 0, "Styles should be written using objects.", "10"]
|
[0, 0, 0, "Styles should be written using objects.", "10"]
|
||||||
],
|
],
|
||||||
"public/app/features/invites/state/selectors.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/library-panels/components/LibraryPanelCard/LibraryPanelCard.tsx:5381": [
|
"public/app/features/library-panels/components/LibraryPanelCard/LibraryPanelCard.tsx:5381": [
|
||||||
[0, 0, 0, "Styles should be written using objects.", "0"]
|
[0, 0, 0, "Styles should be written using objects.", "0"]
|
||||||
],
|
],
|
||||||
@ -4288,11 +4228,6 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Styles should be written using objects.", "0"],
|
[0, 0, 0, "Styles should be written using objects.", "0"],
|
||||||
[0, 0, 0, "Styles should be written using objects.", "1"]
|
[0, 0, 0, "Styles should be written using objects.", "1"]
|
||||||
],
|
],
|
||||||
"public/app/features/live/centrifuge/LiveDataStream.test.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"]
|
|
||||||
],
|
|
||||||
"public/app/features/live/centrifuge/LiveDataStream.ts:5381": [
|
"public/app/features/live/centrifuge/LiveDataStream.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
],
|
],
|
||||||
@ -4302,9 +4237,6 @@ exports[`better eslint`] = {
|
|||||||
"public/app/features/live/centrifuge/serviceWorkerProxy.ts:5381": [
|
"public/app/features/live/centrifuge/serviceWorkerProxy.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/live/centrifuge/transferHandlers.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/live/data/amendTimeSeries.ts:5381": [
|
"public/app/features/live/data/amendTimeSeries.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, "Do not use any type assertions.", "1"],
|
||||||
@ -4460,11 +4392,7 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "4"]
|
||||||
],
|
],
|
||||||
"public/app/features/org/state/actions.ts:5381": [
|
"public/app/features/org/state/actions.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"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/org/state/reducers.ts:5381": [
|
"public/app/features/org/state/reducers.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
@ -4492,9 +4420,6 @@ exports[`better eslint`] = {
|
|||||||
"public/app/features/panel/components/VizTypePicker/VizTypePicker.tsx:5381": [
|
"public/app/features/panel/components/VizTypePicker/VizTypePicker.tsx:5381": [
|
||||||
[0, 0, 0, "Styles should be written using objects.", "0"]
|
[0, 0, 0, "Styles should be written using objects.", "0"]
|
||||||
],
|
],
|
||||||
"public/app/features/panel/components/VizTypePicker/types.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/panel/panellinks/linkSuppliers.ts:5381": [
|
"public/app/features/panel/panellinks/linkSuppliers.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
],
|
],
|
||||||
@ -4504,13 +4429,6 @@ exports[`better eslint`] = {
|
|||||||
[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"]
|
||||||
],
|
],
|
||||||
"public/app/features/panel/state/actions.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/panel/state/reducers.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
|
||||||
],
|
|
||||||
"public/app/features/playlist/EmptyQueryListBanner.tsx:5381": [
|
"public/app/features/playlist/EmptyQueryListBanner.tsx:5381": [
|
||||||
[0, 0, 0, "Styles should be written using objects.", "0"]
|
[0, 0, 0, "Styles should be written using objects.", "0"]
|
||||||
],
|
],
|
||||||
@ -4588,9 +4506,6 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Styles should be written using objects.", "0"],
|
[0, 0, 0, "Styles should be written using objects.", "0"],
|
||||||
[0, 0, 0, "Styles should be written using objects.", "1"]
|
[0, 0, 0, "Styles should be written using objects.", "1"]
|
||||||
],
|
],
|
||||||
"public/app/features/plugins/admin/components/SearchField.tsx:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
|
||||||
],
|
|
||||||
"public/app/features/plugins/admin/components/VersionList.tsx:5381": [
|
"public/app/features/plugins/admin/components/VersionList.tsx:5381": [
|
||||||
[0, 0, 0, "Styles should be written using objects.", "0"],
|
[0, 0, 0, "Styles should be written using objects.", "0"],
|
||||||
[0, 0, 0, "Styles should be written using objects.", "1"],
|
[0, 0, 0, "Styles should be written using objects.", "1"],
|
||||||
@ -4632,12 +4547,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, "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, "Do not use any type assertions.", "12"]
|
||||||
[0, 0, 0, "Do not use any type assertions.", "13"]
|
|
||||||
],
|
|
||||||
"public/app/features/plugins/pluginSettings.ts:5381": [
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/plugins/sandbox/distortion_map.ts:5381": [
|
"public/app/features/plugins/sandbox/distortion_map.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
@ -4673,9 +4583,7 @@ 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, "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.", "5"]
|
|
||||||
],
|
],
|
||||||
"public/app/features/plugins/utils.ts:5381": [
|
"public/app/features/plugins/utils.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
@ -7417,11 +7325,6 @@ exports[`better eslint`] = {
|
|||||||
"public/test/lib/common.ts:5381": [
|
"public/test/lib/common.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||||
],
|
],
|
||||||
"public/test/matchers/toEmitValuesWith.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"]
|
|
||||||
],
|
|
||||||
"public/test/specs/helpers.ts:5381": [
|
"public/test/specs/helpers.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"],
|
||||||
@ -7434,9 +7337,7 @@ exports[`better eslint`] = {
|
|||||||
[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.", "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.", "13"]
|
|
||||||
]
|
]
|
||||||
}`
|
}`
|
||||||
};
|
};
|
||||||
|
@ -143,7 +143,7 @@ export function decodeFieldValueEntities(lookup: FieldValueEntityLookup, values:
|
|||||||
*/
|
*/
|
||||||
export function decodeFieldValueEnums(lookup: string[], values: FieldValues) {
|
export function decodeFieldValueEnums(lookup: string[], values: FieldValues) {
|
||||||
for (let i = 0; i < values.length; i++) {
|
for (let i = 0; i < values.length; i++) {
|
||||||
values[i] = lookup[values[i] as number];
|
values[i] = lookup[Number(values[i])];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +240,9 @@ export function dataFrameToJSON(frame: DataFrame): DataFrameJSON {
|
|||||||
name: frame.name,
|
name: frame.name,
|
||||||
fields: frame.fields.map((f) => {
|
fields: frame.fields.map((f) => {
|
||||||
const { values, nanos, state, display, ...sfield } = f;
|
const { values, nanos, state, display, ...sfield } = f;
|
||||||
delete (sfield as any).entities;
|
if ('entities' in sfield) {
|
||||||
|
delete sfield.entities;
|
||||||
|
}
|
||||||
data.values.push(values);
|
data.values.push(values);
|
||||||
|
|
||||||
if (nanos != null) {
|
if (nanos != null) {
|
||||||
|
@ -13,7 +13,7 @@ import { FunctionalVector } from '../vector/FunctionalVector';
|
|||||||
* @typeParam T - Type of object stored in the DataFrame.
|
* @typeParam T - Type of object stored in the DataFrame.
|
||||||
* @beta
|
* @beta
|
||||||
*/
|
*/
|
||||||
export class DataFrameView<T = any> extends FunctionalVector<T> {
|
export class DataFrameView<T extends object = any> extends FunctionalVector<T> {
|
||||||
private index = 0;
|
private index = 0;
|
||||||
private obj: T;
|
private obj: T;
|
||||||
readonly fields: {
|
readonly fields: {
|
||||||
@ -22,7 +22,7 @@ export class DataFrameView<T = any> extends FunctionalVector<T> {
|
|||||||
|
|
||||||
constructor(private data: DataFrame) {
|
constructor(private data: DataFrame) {
|
||||||
super();
|
super();
|
||||||
const obj = {} as unknown as T;
|
const obj = {} as T;
|
||||||
const fields = {} as any;
|
const fields = {} as any;
|
||||||
|
|
||||||
for (let i = 0; i < data.fields.length; i++) {
|
for (let i = 0; i < data.fields.length; i++) {
|
||||||
@ -34,14 +34,14 @@ export class DataFrameView<T = any> extends FunctionalVector<T> {
|
|||||||
fields[field.name] = field;
|
fields[field.name] = field;
|
||||||
const getter = () => field.values.get(this.index); // .get() to support all Vector types
|
const getter = () => field.values.get(this.index); // .get() to support all Vector types
|
||||||
|
|
||||||
if (!(obj as any).hasOwnProperty(field.name)) {
|
if (!obj.hasOwnProperty(field.name)) {
|
||||||
Object.defineProperty(obj, field.name, {
|
Object.defineProperty(obj, field.name, {
|
||||||
enumerable: true, // Shows up as enumerable property
|
enumerable: true, // Shows up as enumerable property
|
||||||
get: getter,
|
get: getter,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(obj as any).hasOwnProperty(i.toString())) {
|
if (!obj.hasOwnProperty(i.toString())) {
|
||||||
Object.defineProperty(obj, i, {
|
Object.defineProperty(obj, i, {
|
||||||
enumerable: false, // Don't enumerate array index
|
enumerable: false, // Don't enumerate array index
|
||||||
get: getter,
|
get: getter,
|
||||||
|
@ -488,7 +488,7 @@ export function getStreamingFrameOptions(opts?: Partial<StreamingFrameOptions>):
|
|||||||
|
|
||||||
// converts vertical insertion records with table keys in [0] and column values in [1...N]
|
// converts vertical insertion records with table keys in [0] and column values in [1...N]
|
||||||
// to join()-able tables with column arrays
|
// to join()-able tables with column arrays
|
||||||
export function transpose(vrecs: any[][]) {
|
export function transpose(vrecs: unknown[][]) {
|
||||||
let tableKeys = new Set(vrecs[0]);
|
let tableKeys = new Set(vrecs[0]);
|
||||||
let tables = new Map();
|
let tables = new Map();
|
||||||
|
|
||||||
|
@ -33,10 +33,11 @@ function convertTableToDataFrame(table: TableData): DataFrame {
|
|||||||
const fields = table.columns.map((c) => {
|
const fields = table.columns.map((c) => {
|
||||||
// TODO: should be Column but type does not exists there so not sure whats up here.
|
// TODO: should be Column but type does not exists there so not sure whats up here.
|
||||||
const { text, type, ...disp } = c as any;
|
const { text, type, ...disp } = c as any;
|
||||||
|
const values: unknown[] = [];
|
||||||
return {
|
return {
|
||||||
name: text?.length ? text : c, // rename 'text' to the 'name' field
|
name: text?.length ? text : c, // rename 'text' to the 'name' field
|
||||||
config: (disp || {}) as FieldConfig,
|
config: (disp || {}) as FieldConfig,
|
||||||
values: [] as unknown[],
|
values,
|
||||||
type: type && Object.values(FieldType).includes(type as FieldType) ? (type as FieldType) : FieldType.other,
|
type: type && Object.values(FieldType).includes(type as FieldType) ? (type as FieldType) : FieldType.other,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -222,7 +222,7 @@ export function getRawDisplayProcessor(): DisplayProcessor {
|
|||||||
|
|
||||||
const getCircularReplacer = () => {
|
const getCircularReplacer = () => {
|
||||||
const seen = new WeakSet();
|
const seen = new WeakSet();
|
||||||
return (_key: any, value: object | null) => {
|
return (_key: string, value: object | null) => {
|
||||||
if (typeof value === 'object' && value !== null) {
|
if (typeof value === 'object' && value !== null) {
|
||||||
if (seen.has(value)) {
|
if (seen.has(value)) {
|
||||||
return;
|
return;
|
||||||
|
@ -238,7 +238,7 @@ export function applyFieldOverrides(options: ApplyFieldOverrideOptions): DataFra
|
|||||||
}
|
}
|
||||||
|
|
||||||
function calculateRange(
|
function calculateRange(
|
||||||
config: FieldConfig<any>,
|
config: FieldConfig,
|
||||||
field: Field,
|
field: Field,
|
||||||
globalRange: NumericRange | undefined,
|
globalRange: NumericRange | undefined,
|
||||||
data: DataFrame[]
|
data: DataFrame[]
|
||||||
@ -269,7 +269,7 @@ function calculateRange(
|
|||||||
// 2. have the ability to selectively get display color or text (but not always both, which are each quite expensive)
|
// 2. have the ability to selectively get display color or text (but not always both, which are each quite expensive)
|
||||||
// 3. sufficently optimize text formatting and threshold color determinitation
|
// 3. sufficently optimize text formatting and threshold color determinitation
|
||||||
function cachingDisplayProcessor(disp: DisplayProcessor, maxCacheSize = 2500): DisplayProcessor {
|
function cachingDisplayProcessor(disp: DisplayProcessor, maxCacheSize = 2500): DisplayProcessor {
|
||||||
type dispCache = Map<any, DisplayValue>;
|
type dispCache = Map<unknown, DisplayValue>;
|
||||||
// decimals -> cache mapping, -1 is unspecified decimals
|
// decimals -> cache mapping, -1 is unspecified decimals
|
||||||
const caches = new Map<number, dispCache>();
|
const caches = new Map<number, dispCache>();
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
ValueMapping,
|
ValueMapping,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
export const identityOverrideProcessor = <T>(value: T, _context: FieldOverrideContext, _settings: any) => {
|
export const identityOverrideProcessor = <T>(value: T) => {
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ export interface MapLayerHandler<TConfig = any> {
|
|||||||
*/
|
*/
|
||||||
registerOptionsUI?: (
|
registerOptionsUI?: (
|
||||||
builder: PanelOptionsEditorBuilder<MapLayerOptions<TConfig>>,
|
builder: PanelOptionsEditorBuilder<MapLayerOptions<TConfig>>,
|
||||||
context: StandardEditorContext<any, any>
|
context: StandardEditorContext<any>
|
||||||
) => void;
|
) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,12 +17,12 @@ import { PanelPlugin } from './PanelPlugin';
|
|||||||
export interface Props {
|
export interface Props {
|
||||||
plugin: PanelPlugin;
|
plugin: PanelPlugin;
|
||||||
currentFieldConfig: FieldConfigSource;
|
currentFieldConfig: FieldConfigSource;
|
||||||
currentOptions: Record<string, any>;
|
currentOptions: Record<string, unknown>;
|
||||||
isAfterPluginChange: boolean;
|
isAfterPluginChange: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OptionDefaults {
|
export interface OptionDefaults {
|
||||||
options: any;
|
options: Record<string, unknown>;
|
||||||
fieldConfig: FieldConfigSource;
|
fieldConfig: FieldConfigSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,17 +43,17 @@ export function createFieldConfigRegistry<TFieldConfigOptions>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (let fieldConfigProp of standardConfigs) {
|
for (let fieldConfigProp of standardConfigs) {
|
||||||
|
const id = fieldConfigProp.id as FieldConfigProperty;
|
||||||
if (config.disableStandardOptions) {
|
if (config.disableStandardOptions) {
|
||||||
const isDisabled = config.disableStandardOptions.indexOf(fieldConfigProp.id as FieldConfigProperty) > -1;
|
const isDisabled = config.disableStandardOptions.indexOf(id) > -1;
|
||||||
if (isDisabled) {
|
if (isDisabled) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (config.standardOptions) {
|
if (config.standardOptions) {
|
||||||
const customHideFromDefaults =
|
const customHideFromDefaults = config.standardOptions[id]?.hideFromDefaults;
|
||||||
config.standardOptions[fieldConfigProp.id as FieldConfigProperty]?.hideFromDefaults;
|
const customDefault = config.standardOptions[id]?.defaultValue;
|
||||||
const customDefault = config.standardOptions[fieldConfigProp.id as FieldConfigProperty]?.defaultValue;
|
const customSettings = config.standardOptions[id]?.settings;
|
||||||
const customSettings = config.standardOptions[fieldConfigProp.id as FieldConfigProperty]?.settings;
|
|
||||||
|
|
||||||
if (customHideFromDefaults) {
|
if (customHideFromDefaults) {
|
||||||
fieldConfigProp = {
|
fieldConfigProp = {
|
||||||
|
@ -39,7 +39,7 @@ type FieldReducer = (field: Field, ignoreNulls: boolean, nullAsZero: boolean) =>
|
|||||||
|
|
||||||
export interface FieldReducerInfo extends RegistryItem {
|
export interface FieldReducerInfo extends RegistryItem {
|
||||||
// Internal details
|
// Internal details
|
||||||
emptyInputResult?: any; // typically null, but some things like 'count' & 'sum' should be zero
|
emptyInputResult?: unknown; // typically null, but some things like 'count' & 'sum' should be zero
|
||||||
standard: boolean; // The most common stats can all be calculated in a single pass
|
standard: boolean; // The most common stats can all be calculated in a single pass
|
||||||
reduce?: FieldReducer;
|
reduce?: FieldReducer;
|
||||||
}
|
}
|
||||||
|
@ -135,8 +135,7 @@ export function getFilteredPanelString(panel: PanelModel): string {
|
|||||||
'yaxes',
|
'yaxes',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// This cannot avoid the use of any because the type of panelObj is any
|
const panelObjFiltered = Object.keys(panelObj).reduce((obj: { [key: string]: unknown }, key) => {
|
||||||
const panelObjFiltered = Object.keys(panelObj).reduce((obj: { [key: string]: any }, key) => {
|
|
||||||
if (keysToKeep.has(key)) {
|
if (keysToKeep.has(key)) {
|
||||||
obj[key] = panelObj[key];
|
obj[key] = panelObj[key];
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ export interface OptionPaneRenderProps {
|
|||||||
plugin: PanelPlugin;
|
plugin: PanelPlugin;
|
||||||
data?: PanelData;
|
data?: PanelData;
|
||||||
dashboard: DashboardModel;
|
dashboard: DashboardModel;
|
||||||
instanceState: any;
|
instanceState: unknown;
|
||||||
onPanelConfigChange: (configKey: keyof PanelModel, value: unknown) => void;
|
onPanelConfigChange: (configKey: keyof PanelModel, value: unknown) => void;
|
||||||
onPanelOptionsChanged: (options: PanelModel['options']) => void;
|
onPanelOptionsChanged: (options: PanelModel['options']) => void;
|
||||||
onFieldConfigsChange: (config: FieldConfigSource) => void;
|
onFieldConfigsChange: (config: FieldConfigSource) => void;
|
||||||
|
@ -28,7 +28,7 @@ export interface OwnProps {
|
|||||||
const mapStateToProps = (state: StoreState, props: OwnProps) => {
|
const mapStateToProps = (state: StoreState, props: OwnProps) => {
|
||||||
const panelState = state.panels[props.stateKey];
|
const panelState = state.panels[props.stateKey];
|
||||||
if (!panelState) {
|
if (!panelState) {
|
||||||
return { plugin: null };
|
return { plugin: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -58,7 +58,7 @@ export class DashboardPanelUnconnected extends PureComponent<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onInstanceStateChange = (value: any) => {
|
onInstanceStateChange = (value: unknown) => {
|
||||||
this.props.setPanelInstanceState({ key: this.props.stateKey, value });
|
this.props.setPanelInstanceState({ key: this.props.stateKey, value });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ export interface Props {
|
|||||||
isDraggable?: boolean;
|
isDraggable?: boolean;
|
||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
onInstanceStateChange: (value: any) => void;
|
onInstanceStateChange: (value: unknown) => void;
|
||||||
timezone?: string;
|
timezone?: string;
|
||||||
hideMenu?: boolean;
|
hideMenu?: boolean;
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ export class PanelStateWrapper extends PureComponent<Props, State> {
|
|||||||
// Due to a mutable panel model we get the sync settings via function that proactively reads from the model
|
// Due to a mutable panel model we get the sync settings via function that proactively reads from the model
|
||||||
getSync = () => (this.props.isEditing ? DashboardCursorSync.Off : this.props.dashboard.graphTooltip);
|
getSync = () => (this.props.isEditing ? DashboardCursorSync.Off : this.props.dashboard.graphTooltip);
|
||||||
|
|
||||||
onInstanceStateChange = (value: any) => {
|
onInstanceStateChange = (value: unknown) => {
|
||||||
this.props.onInstanceStateChange(value);
|
this.props.onInstanceStateChange(value);
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -187,7 +187,7 @@ export class DashboardMigrator {
|
|||||||
|
|
||||||
if (oldVersion < 6) {
|
if (oldVersion < 6) {
|
||||||
// move drop-downs to new schema
|
// move drop-downs to new schema
|
||||||
const annotations: any = find(old.pulldowns, { type: 'annotations' });
|
const annotations = find(old.pulldowns, { type: 'annotations' });
|
||||||
|
|
||||||
if (annotations) {
|
if (annotations) {
|
||||||
this.dashboard.annotations = {
|
this.dashboard.annotations = {
|
||||||
@ -318,16 +318,18 @@ export class DashboardMigrator {
|
|||||||
|
|
||||||
if (oldVersion < 12) {
|
if (oldVersion < 12) {
|
||||||
// update template variables
|
// update template variables
|
||||||
each(this.dashboard.getVariables(), (templateVariable: any) => {
|
each(this.dashboard.getVariables(), (templateVariable) => {
|
||||||
if (templateVariable.refresh) {
|
if ('refresh' in templateVariable) {
|
||||||
templateVariable.refresh = 1;
|
if (templateVariable.refresh) {
|
||||||
|
templateVariable.refresh = 1;
|
||||||
|
}
|
||||||
|
if (!templateVariable.refresh) {
|
||||||
|
templateVariable.refresh = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!templateVariable.refresh) {
|
if ('hideVariable' in templateVariable && templateVariable.hideVariable) {
|
||||||
templateVariable.refresh = 0;
|
|
||||||
}
|
|
||||||
if (templateVariable.hideVariable) {
|
|
||||||
templateVariable.hide = 2;
|
templateVariable.hide = 2;
|
||||||
} else if (templateVariable.hideLabel) {
|
} else if ('hideLabel' in templateVariable && templateVariable.hideLabel) {
|
||||||
templateVariable.hide = 1;
|
templateVariable.hide = 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -993,7 +995,7 @@ export class DashboardMigrator {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const height: any = row.height || DEFAULT_ROW_HEIGHT;
|
const height = row.height || DEFAULT_ROW_HEIGHT;
|
||||||
const rowGridHeight = getGridHeight(height);
|
const rowGridHeight = getGridHeight(height);
|
||||||
|
|
||||||
const rowPanel: any = {};
|
const rowPanel: any = {};
|
||||||
|
@ -157,7 +157,7 @@ export class DashboardModel implements TimeModel {
|
|||||||
this.version = data.version ?? 0;
|
this.version = data.version ?? 0;
|
||||||
this.links = data.links ?? [];
|
this.links = data.links ?? [];
|
||||||
this.gnetId = data.gnetId || null;
|
this.gnetId = data.gnetId || null;
|
||||||
this.panels = map(data.panels ?? [], (panelData: any) => new PanelModel(panelData));
|
this.panels = map(data.panels ?? [], (panelData) => new PanelModel(panelData));
|
||||||
// Deep clone original dashboard to avoid mutations by object reference
|
// Deep clone original dashboard to avoid mutations by object reference
|
||||||
this.originalDashboard = cloneDeep(data);
|
this.originalDashboard = cloneDeep(data);
|
||||||
this.originalTemplating = cloneDeep(this.templating);
|
this.originalTemplating = cloneDeep(this.templating);
|
||||||
@ -331,7 +331,7 @@ export class DashboardModel implements TimeModel {
|
|||||||
|
|
||||||
return panel.getSaveModel();
|
return panel.getSaveModel();
|
||||||
})
|
})
|
||||||
.map((model: any) => {
|
.map((model) => {
|
||||||
if (this.isSnapshotTruthy()) {
|
if (this.isSnapshotTruthy()) {
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ export interface SetPanelAngularComponentPayload {
|
|||||||
|
|
||||||
export interface SetPanelInstanceStatePayload {
|
export interface SetPanelInstanceStatePayload {
|
||||||
panelId: number;
|
panelId: number;
|
||||||
value: any;
|
value: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const {
|
export const {
|
||||||
|
@ -132,5 +132,5 @@ export function getLastNotNullFieldValue<T>(field: Field): T {
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return undefined as any;
|
return undefined as T;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ export class ExpressionDatasourceApi extends DataSourceWithBackend<ExpressionQue
|
|||||||
super(instanceSettings);
|
super(instanceSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
applyTemplateVariables(query: ExpressionQuery, scopedVars: ScopedVars): Record<string, any> {
|
applyTemplateVariables(query: ExpressionQuery, scopedVars: ScopedVars) {
|
||||||
const templateSrv = getTemplateSrv();
|
const templateSrv = getTemplateSrv();
|
||||||
return {
|
return {
|
||||||
...query,
|
...query,
|
||||||
|
@ -33,7 +33,7 @@ export function decodeGeohash(geohash: string): [number, number] | undefined {
|
|||||||
return [lonCenter, latCenter];
|
return [lonCenter, latCenter];
|
||||||
}
|
}
|
||||||
|
|
||||||
function refineInterval(interval: any[], base32Decoded: number, mask: number) {
|
function refineInterval(interval: number[], base32Decoded: number, mask: number) {
|
||||||
/* tslint:disable no-bitwise*/
|
/* tslint:disable no-bitwise*/
|
||||||
if (base32Decoded & mask) {
|
if (base32Decoded & mask) {
|
||||||
interval[0] = (interval[0] + interval[1]) / 2;
|
interval[0] = (interval[0] + interval[1]) / 2;
|
||||||
|
@ -4,7 +4,7 @@ import { Geometry } from 'ol/geom';
|
|||||||
import { DataFrame, Field, FieldType, getFieldTypeFromValue } from '@grafana/data';
|
import { DataFrame, Field, FieldType, getFieldTypeFromValue } from '@grafana/data';
|
||||||
|
|
||||||
interface FieldInfo {
|
interface FieldInfo {
|
||||||
values: any[];
|
values: Array<string | number | null | undefined>;
|
||||||
types: Set<FieldType>;
|
types: Set<FieldType>;
|
||||||
count: number;
|
count: number;
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ interface InspectErrorTabProps {
|
|||||||
errors?: DataQueryError[];
|
errors?: DataQueryError[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const parseErrorMessage = (message: string): { msg: string; json?: any } => {
|
const parseErrorMessage = (message: string) => {
|
||||||
try {
|
try {
|
||||||
const [msg, json] = message.split(/(\{.+)/);
|
const [msg, json] = message.split(/(\{.+)/);
|
||||||
const jsonError = JSON.parse(json);
|
const jsonError = JSON.parse(json);
|
||||||
|
@ -32,7 +32,7 @@ interface State {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class QueryInspector extends PureComponent<Props, State> {
|
export class QueryInspector extends PureComponent<Props, State> {
|
||||||
private formattedJson: any;
|
private formattedJson?: {};
|
||||||
private subs = new Subscription();
|
private subs = new Subscription();
|
||||||
|
|
||||||
constructor(props: Props) {
|
constructor(props: Props) {
|
||||||
@ -146,7 +146,7 @@ export class QueryInspector extends PureComponent<Props, State> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setFormattedJson = (formattedJson: any) => {
|
setFormattedJson = (formattedJson: {}) => {
|
||||||
this.formattedJson = formattedJson;
|
this.formattedJson = formattedJson;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { EntityState, createSelector } from '@reduxjs/toolkit';
|
||||||
|
|
||||||
|
import { Invitee } from 'app/types';
|
||||||
|
|
||||||
import { selectors } from './reducers';
|
import { selectors } from './reducers';
|
||||||
|
|
||||||
export const { selectAll, selectById, selectTotal } = selectors;
|
export const { selectAll, selectById, selectTotal } = selectors;
|
||||||
|
|
||||||
const selectQuery = (_: any, query: string) => query;
|
const selectQuery = (_state: EntityState<Invitee>, query: string) => query;
|
||||||
export const selectInvitesMatchingQuery = createSelector([selectAll, selectQuery], (invites, searchQuery) => {
|
export const selectInvitesMatchingQuery = createSelector([selectAll, selectQuery], (invites, searchQuery) => {
|
||||||
const regex = new RegExp(searchQuery, 'i');
|
const regex = new RegExp(searchQuery, 'i');
|
||||||
const matches = invites.filter((invite) => regex.test(invite.name) || regex.test(invite.email));
|
const matches = invites.filter((invite) => regex.test(invite.name) || regex.test(invite.email));
|
||||||
|
@ -25,9 +25,9 @@ type SubjectsInsteadOfObservables<T> = {
|
|||||||
[key in keyof T]: T[key] extends Observable<infer U> ? Subject<U> : T[key];
|
[key in keyof T]: T[key] extends Observable<infer U> ? Subject<U> : T[key];
|
||||||
};
|
};
|
||||||
|
|
||||||
type DepsWithSubjectsInsteadOfObservables<T = any> = SubjectsInsteadOfObservables<DataStreamHandlerDeps<T>>;
|
type DepsWithSubjectsInsteadOfObservables<T = unknown> = SubjectsInsteadOfObservables<DataStreamHandlerDeps<T>>;
|
||||||
|
|
||||||
const createDeps = <T = any>(
|
const createDeps = <T = unknown>(
|
||||||
overrides?: Partial<DepsWithSubjectsInsteadOfObservables<T>>
|
overrides?: Partial<DepsWithSubjectsInsteadOfObservables<T>>
|
||||||
): DepsWithSubjectsInsteadOfObservables<T> => {
|
): DepsWithSubjectsInsteadOfObservables<T> => {
|
||||||
return {
|
return {
|
||||||
@ -43,7 +43,7 @@ const createDeps = <T = any>(
|
|||||||
|
|
||||||
class ValuesCollection<T> implements Unsubscribable {
|
class ValuesCollection<T> implements Unsubscribable {
|
||||||
values: T[] = [];
|
values: T[] = [];
|
||||||
errors: any[] = [];
|
errors: unknown[] = [];
|
||||||
receivedComplete = false;
|
receivedComplete = false;
|
||||||
subscription: Subscription | undefined;
|
subscription: Subscription | undefined;
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ import { Subscriber } from 'rxjs';
|
|||||||
|
|
||||||
// Observers, ie. functions passed to `observable.subscribe(...)`, are converted to a subclass of `Subscriber` before they are sent to the source Observable.
|
// Observers, ie. functions passed to `observable.subscribe(...)`, are converted to a subclass of `Subscriber` before they are sent to the source Observable.
|
||||||
// The conversion happens internally in the RxJS library - this transfer handler is catches them and wraps them with a proxy
|
// The conversion happens internally in the RxJS library - this transfer handler is catches them and wraps them with a proxy
|
||||||
const subscriberTransferHandler: any = {
|
const subscriberTransferHandler = {
|
||||||
canHandle(value: unknown): boolean {
|
canHandle(value: unknown): value is Subscriber<unknown> {
|
||||||
return Boolean(value && value instanceof Subscriber);
|
return Boolean(value && value instanceof Subscriber);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,26 +1,19 @@
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { ConnectedProps, connect } from 'react-redux';
|
||||||
|
|
||||||
import { NavModel } from '@grafana/data';
|
|
||||||
import { VerticalGroup } from '@grafana/ui';
|
import { VerticalGroup } from '@grafana/ui';
|
||||||
import { Page } from 'app/core/components/Page/Page';
|
import { Page } from 'app/core/components/Page/Page';
|
||||||
import SharedPreferences from 'app/core/components/SharedPreferences/SharedPreferences';
|
import SharedPreferences from 'app/core/components/SharedPreferences/SharedPreferences';
|
||||||
import { appEvents, contextSrv } from 'app/core/core';
|
import { appEvents, contextSrv } from 'app/core/core';
|
||||||
import { getNavModel } from 'app/core/selectors/navModel';
|
import { getNavModel } from 'app/core/selectors/navModel';
|
||||||
import { AccessControlAction, Organization, StoreState } from 'app/types';
|
import { AccessControlAction, StoreState } from 'app/types';
|
||||||
import { ShowConfirmModalEvent } from 'app/types/events';
|
import { ShowConfirmModalEvent } from 'app/types/events';
|
||||||
|
|
||||||
import OrgProfile from './OrgProfile';
|
import OrgProfile from './OrgProfile';
|
||||||
import { loadOrganization, updateOrganization } from './state/actions';
|
import { loadOrganization, updateOrganization } from './state/actions';
|
||||||
import { setOrganizationName } from './state/reducers';
|
import { setOrganizationName } from './state/reducers';
|
||||||
|
|
||||||
export interface Props {
|
interface OwnProps {}
|
||||||
navModel: NavModel;
|
|
||||||
organization: Organization;
|
|
||||||
loadOrganization: typeof loadOrganization;
|
|
||||||
setOrganizationName: typeof setOrganizationName;
|
|
||||||
updateOrganization: typeof updateOrganization;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class OrgDetailsPage extends PureComponent<Props> {
|
export class OrgDetailsPage extends PureComponent<Props> {
|
||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
@ -89,4 +82,7 @@ const mapDispatchToProps = {
|
|||||||
updateOrganization,
|
updateOrganization,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(OrgDetailsPage);
|
const connector = connect(mapStateToProps, mapDispatchToProps);
|
||||||
|
export type Props = OwnProps & ConnectedProps<typeof connector>;
|
||||||
|
|
||||||
|
export default connector(OrgDetailsPage);
|
||||||
|
@ -8,7 +8,7 @@ type OrganizationDependencies = { getBackendSrv: typeof getBackendSrv };
|
|||||||
|
|
||||||
export function loadOrganization(
|
export function loadOrganization(
|
||||||
dependencies: OrganizationDependencies = { getBackendSrv: getBackendSrv }
|
dependencies: OrganizationDependencies = { getBackendSrv: getBackendSrv }
|
||||||
): ThunkResult<any> {
|
): ThunkResult<void> {
|
||||||
return async (dispatch) => {
|
return async (dispatch) => {
|
||||||
const organizationResponse = await dependencies.getBackendSrv().get('/api/org');
|
const organizationResponse = await dependencies.getBackendSrv().get('/api/org');
|
||||||
dispatch(organizationLoaded(organizationResponse));
|
dispatch(organizationLoaded(organizationResponse));
|
||||||
@ -19,7 +19,7 @@ export function loadOrganization(
|
|||||||
|
|
||||||
export function updateOrganization(
|
export function updateOrganization(
|
||||||
dependencies: OrganizationDependencies = { getBackendSrv: getBackendSrv }
|
dependencies: OrganizationDependencies = { getBackendSrv: getBackendSrv }
|
||||||
): ThunkResult<any> {
|
): ThunkResult<void> {
|
||||||
return async (dispatch, getStore) => {
|
return async (dispatch, getStore) => {
|
||||||
const organization = getStore().organization.organization;
|
const organization = getStore().organization.organization;
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ export function updateOrganization(
|
|||||||
export function setUserOrganization(
|
export function setUserOrganization(
|
||||||
orgId: number,
|
orgId: number,
|
||||||
dependencies: OrganizationDependencies = { getBackendSrv: getBackendSrv }
|
dependencies: OrganizationDependencies = { getBackendSrv: getBackendSrv }
|
||||||
): ThunkResult<any> {
|
): ThunkResult<void> {
|
||||||
return async (dispatch) => {
|
return async (dispatch) => {
|
||||||
const organizationResponse = await dependencies.getBackendSrv().post('/api/user/using/' + orgId);
|
const organizationResponse = await dependencies.getBackendSrv().post('/api/user/using/' + orgId);
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ export function setUserOrganization(
|
|||||||
export function createOrganization(
|
export function createOrganization(
|
||||||
newOrg: { name: string },
|
newOrg: { name: string },
|
||||||
dependencies: OrganizationDependencies = { getBackendSrv: getBackendSrv }
|
dependencies: OrganizationDependencies = { getBackendSrv: getBackendSrv }
|
||||||
): ThunkResult<any> {
|
): ThunkResult<void> {
|
||||||
return async (dispatch) => {
|
return async (dispatch) => {
|
||||||
const result = await dependencies.getBackendSrv().post('/api/orgs/', newOrg);
|
const result = await dependencies.getBackendSrv().post('/api/orgs/', newOrg);
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ export function PanelRenderer<P extends object = {}, F extends object = {}>(prop
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function useOptionDefaults<P extends object = {}, F extends object = {}>(
|
function useOptionDefaults<P extends Record<string, unknown> = {}, F extends object = {}>(
|
||||||
plugin: PanelPlugin | undefined,
|
plugin: PanelPlugin | undefined,
|
||||||
options: P,
|
options: P,
|
||||||
fieldConfig: FieldConfigSource<F>
|
fieldConfig: FieldConfigSource<F>
|
||||||
|
@ -2,7 +2,7 @@ import { FieldConfigSource } from '@grafana/data';
|
|||||||
|
|
||||||
export interface VizTypeChangeDetails {
|
export interface VizTypeChangeDetails {
|
||||||
pluginId: string;
|
pluginId: string;
|
||||||
options?: any;
|
options?: Record<string, unknown>;
|
||||||
fieldConfig?: FieldConfigSource;
|
fieldConfig?: FieldConfigSource;
|
||||||
withModKey?: boolean;
|
withModKey?: boolean;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ export function cleanUpPanelState(panelKey: string): ThunkResult<void> {
|
|||||||
export interface ChangePanelPluginAndOptionsArgs {
|
export interface ChangePanelPluginAndOptionsArgs {
|
||||||
panel: PanelModel;
|
panel: PanelModel;
|
||||||
pluginId: string;
|
pluginId: string;
|
||||||
options?: any;
|
options?: Record<string, unknown>;
|
||||||
fieldConfig?: FieldConfigSource;
|
fieldConfig?: FieldConfigSource;
|
||||||
transformations?: DataTransformerConfig[];
|
transformations?: DataTransformerConfig[];
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ export type RootPanelsState = Record<string, PanelState>;
|
|||||||
export interface PanelState {
|
export interface PanelState {
|
||||||
plugin?: PanelPlugin;
|
plugin?: PanelPlugin;
|
||||||
angularComponent?: AngularComponent;
|
angularComponent?: AngularComponent;
|
||||||
instanceState?: any | null;
|
instanceState?: unknown | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const initialState: RootPanelsState = {};
|
export const initialState: RootPanelsState = {};
|
||||||
@ -54,7 +54,7 @@ export interface SetPanelAngularComponentPayload {
|
|||||||
|
|
||||||
export interface SetPanelInstanceStatePayload {
|
export interface SetPanelInstanceStatePayload {
|
||||||
key: string;
|
key: string;
|
||||||
value: any;
|
value: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const {
|
export const {
|
||||||
|
@ -10,7 +10,7 @@ interface Props {
|
|||||||
|
|
||||||
// useDebounce has a bug which causes it to fire on first render. This wrapper prevents that.
|
// useDebounce has a bug which causes it to fire on first render. This wrapper prevents that.
|
||||||
// https://github.com/streamich/react-use/issues/759
|
// https://github.com/streamich/react-use/issues/759
|
||||||
const useDebounceWithoutFirstRender = (callBack: () => any, delay = 0, deps: React.DependencyList = []) => {
|
const useDebounceWithoutFirstRender = (callBack: () => void, delay = 0, deps: React.DependencyList = []) => {
|
||||||
const isFirstRender = useRef(true);
|
const isFirstRender = useRef(true);
|
||||||
const debounceDeps = [...deps, isFirstRender];
|
const debounceDeps = [...deps, isFirstRender];
|
||||||
|
|
||||||
|
@ -356,7 +356,7 @@ export function getNameOrUid(ref?: string | DataSourceRef | null): string | unde
|
|||||||
return isString ? ref : ref?.uid;
|
return isString ? ref : ref?.uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function variableInterpolation(value: any[]) {
|
export function variableInterpolation<T>(value: T | T[]) {
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
return value[0];
|
return value[0];
|
||||||
}
|
}
|
||||||
|
@ -14,11 +14,11 @@ export function getPluginSettings(pluginId: string, options?: Partial<BackendSrv
|
|||||||
}
|
}
|
||||||
return getBackendSrv()
|
return getBackendSrv()
|
||||||
.get(`/api/plugins/${pluginId}/settings`, undefined, undefined, options)
|
.get(`/api/plugins/${pluginId}/settings`, undefined, undefined, options)
|
||||||
.then((settings: any) => {
|
.then((settings) => {
|
||||||
pluginInfoCache[pluginId] = settings;
|
pluginInfoCache[pluginId] = settings;
|
||||||
return settings;
|
return settings;
|
||||||
})
|
})
|
||||||
.catch((err: any) => {
|
.catch(() => {
|
||||||
return Promise.reject(new Error('Unknown Plugin'));
|
return Promise.reject(new Error('Unknown Plugin'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,6 @@ const enum Op {
|
|||||||
NOT_IN = 'select_not_any_in',
|
NOT_IN = 'select_not_any_in',
|
||||||
MACROS = 'macros',
|
MACROS = 'macros',
|
||||||
}
|
}
|
||||||
// eslint-ignore
|
|
||||||
const customOperators = getCustomOperators(BasicConfig);
|
const customOperators = getCustomOperators(BasicConfig);
|
||||||
const textWidget = BasicConfig.types.text.widgets.text;
|
const textWidget = BasicConfig.types.text.widgets.text;
|
||||||
const opers = [...(textWidget.operators || []), Op.IN, Op.NOT_IN];
|
const opers = [...(textWidget.operators || []), Op.IN, Op.NOT_IN];
|
||||||
@ -317,7 +316,6 @@ function getCustomOperators(config: BasicConfig) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// value: string | List<string> but AQB uses a different version of Immutable
|
// value: string | List<string> but AQB uses a different version of Immutable
|
||||||
// eslint-ignore
|
|
||||||
function splitIfString(value: any) {
|
function splitIfString(value: any) {
|
||||||
if (isString(value)) {
|
if (isString(value)) {
|
||||||
return value.split(',');
|
return value.split(',');
|
||||||
|
@ -217,7 +217,7 @@ export abstract class SqlDatasource extends DataSourceWithBackend<SQLQuery, SQLO
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: this always runs with the `@grafana/data/getDefaultTimeRange` time range
|
// NOTE: this always runs with the `@grafana/data/getDefaultTimeRange` time range
|
||||||
async runSql<T>(query: string, options?: RunSQLOptions) {
|
async runSql<T extends object>(query: string, options?: RunSQLOptions) {
|
||||||
const range = getDefaultTimeRange();
|
const range = getDefaultTimeRange();
|
||||||
const frame = await this.runMetaQuery({ rawSql: query, format: QueryFormat.Table, refId: options?.refId }, range);
|
const frame = await this.runMetaQuery({ rawSql: query, format: QueryFormat.Table, refId: options?.refId }, range);
|
||||||
return new DataFrameView<T>(frame);
|
return new DataFrameView<T>(frame);
|
||||||
|
@ -75,7 +75,7 @@ describe('datasource_srv', () => {
|
|||||||
type: 'test-db',
|
type: 'test-db',
|
||||||
name: 'mmm',
|
name: 'mmm',
|
||||||
uid: 'uid-code-mmm',
|
uid: 'uid-code-mmm',
|
||||||
meta: { metrics: true, annotations: true } as any,
|
meta: { metrics: true, annotations: true },
|
||||||
},
|
},
|
||||||
'-- Grafana --': {
|
'-- Grafana --': {
|
||||||
type: 'grafana',
|
type: 'grafana',
|
||||||
@ -169,7 +169,7 @@ describe('datasource_srv', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Can get by variable', async () => {
|
it('Can get by variable', async () => {
|
||||||
const ds = (await dataSourceSrv.get('${datasource}')) as any;
|
const ds = await dataSourceSrv.get('${datasource}');
|
||||||
expect(ds.meta).toBe(dataSourceInit.BBB.meta);
|
expect(ds.meta).toBe(dataSourceInit.BBB.meta);
|
||||||
|
|
||||||
const ds2 = await dataSourceSrv.get('${datasource}', { datasource: { text: 'Prom', value: 'uid-code-aaa' } });
|
const ds2 = await dataSourceSrv.get('${datasource}', { datasource: { text: 'Prom', value: 'uid-code-aaa' } });
|
||||||
|
@ -3,7 +3,7 @@ import { Observable, Subscription } from 'rxjs';
|
|||||||
|
|
||||||
import { expectObservable, forceObservableCompletion } from './utils';
|
import { expectObservable, forceObservableCompletion } from './utils';
|
||||||
|
|
||||||
function tryExpectations(received: unknown[], expectations: (received: unknown[]) => void): jest.CustomMatcherResult {
|
function tryExpectations<T = unknown>(received: T[], expectations: (received: T[]) => void): jest.CustomMatcherResult {
|
||||||
try {
|
try {
|
||||||
expectations(received);
|
expectations(received);
|
||||||
return {
|
return {
|
||||||
@ -27,9 +27,9 @@ function tryExpectations(received: unknown[], expectations: (received: unknown[]
|
|||||||
* the observable ended (or emitted error). If Observable does not complete within OBSERVABLE_TEST_TIMEOUT_IN_MS the
|
* the observable ended (or emitted error). If Observable does not complete within OBSERVABLE_TEST_TIMEOUT_IN_MS the
|
||||||
* test fails.
|
* test fails.
|
||||||
*/
|
*/
|
||||||
export function toEmitValuesWith(
|
export function toEmitValuesWith<T = unknown>(
|
||||||
received: Observable<any>,
|
received: Observable<T>,
|
||||||
expectations: (actual: any[]) => void
|
expectations: (actual: T[]) => void
|
||||||
): Promise<jest.CustomMatcherResult> {
|
): Promise<jest.CustomMatcherResult> {
|
||||||
const failsChecks = expectObservable(received);
|
const failsChecks = expectObservable(received);
|
||||||
if (failsChecks) {
|
if (failsChecks) {
|
||||||
@ -37,7 +37,7 @@ export function toEmitValuesWith(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
const receivedValues: any[] = [];
|
const receivedValues: T[] = [];
|
||||||
const subscription = new Subscription();
|
const subscription = new Subscription();
|
||||||
|
|
||||||
subscription.add(
|
subscription.add(
|
||||||
|
@ -2,12 +2,10 @@ import { Observable } from 'rxjs';
|
|||||||
|
|
||||||
export const OBSERVABLE_TEST_TIMEOUT_IN_MS = 1000;
|
export const OBSERVABLE_TEST_TIMEOUT_IN_MS = 1000;
|
||||||
|
|
||||||
export type ObservableType<T> = T extends Observable<infer V> ? V : never;
|
|
||||||
|
|
||||||
export interface ObservableMatchers<R, T = {}> extends jest.ExpectExtendMap {
|
export interface ObservableMatchers<R, T = {}> extends jest.ExpectExtendMap {
|
||||||
toEmitValues<E = ObservableType<T>>(received: T, expected: E[]): Promise<jest.CustomMatcherResult>;
|
toEmitValues<T>(received: Observable<T>, expected: T[]): Promise<jest.CustomMatcherResult>;
|
||||||
toEmitValuesWith<E = ObservableType<T>>(
|
toEmitValuesWith<T>(
|
||||||
received: T,
|
received: Observable<T>,
|
||||||
expectations: (received: E[]) => void
|
expectations: (received: T[]) => void
|
||||||
): Promise<jest.CustomMatcherResult>;
|
): Promise<jest.CustomMatcherResult>;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ export function ControllerTestContext(this: any) {
|
|||||||
$provide.value('templateSrv', self.templateSrv);
|
$provide.value('templateSrv', self.templateSrv);
|
||||||
$provide.value('$element', self.$element);
|
$provide.value('$element', self.$element);
|
||||||
$provide.value('$sanitize', self.$sanitize);
|
$provide.value('$sanitize', self.$sanitize);
|
||||||
each(mocks, (value: any, key: any) => {
|
each(mocks, (value, key) => {
|
||||||
$provide.value(key, value);
|
$provide.value(key, value);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user