mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: fix some any
s pt.2 (#53928)
* correctly type some more any's * undo this change for now...
This commit is contained in:
parent
2b17e5354a
commit
3cf95d7eee
@ -71,7 +71,7 @@ exports[`no enzyme tests`] = {
|
||||
"public/app/features/dashboard/components/ShareModal/ShareLink.test.tsx:3716733755": [
|
||||
[0, 35, 13, "RegExp match", "2409514259"]
|
||||
],
|
||||
"public/app/features/dimensions/editors/ThresholdsEditor/ThresholdsEditor.test.tsx:4164297658": [
|
||||
"public/app/features/dimensions/editors/ThresholdsEditor/ThresholdsEditor.test.tsx:145048794": [
|
||||
[0, 17, 13, "RegExp match", "2409514259"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/components/ConfigEditor.test.tsx:4057721851": [
|
||||
@ -1623,8 +1623,7 @@ exports[`better eslint`] = {
|
||||
],
|
||||
"packages/grafana-ui/src/components/Select/SelectMenu.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, "Do not use any type assertions.", "2"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||
],
|
||||
"packages/grafana-ui/src/components/Select/SelectOptionGroup.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
@ -1720,9 +1719,6 @@ exports[`better eslint`] = {
|
||||
"packages/grafana-ui/src/components/Table/FilterPopup.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"packages/grafana-ui/src/components/Table/FooterCell.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"packages/grafana-ui/src/components/Table/FooterRow.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
@ -1830,9 +1826,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"]
|
||||
],
|
||||
"packages/grafana-ui/src/components/Tooltip/PopoverController.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"packages/grafana-ui/src/components/Tooltip/Tooltip.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
@ -2109,9 +2102,6 @@ exports[`better eslint`] = {
|
||||
"packages/jaeger-ui-components/src/TraceTimelineViewer/SpanBar.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"packages/jaeger-ui-components/src/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"packages/jaeger-ui-components/src/TraceTimelineViewer/SpanDetail/index.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
@ -2163,13 +2153,10 @@ exports[`better eslint`] = {
|
||||
[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.", "9"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "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.", "12"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "13"],
|
||||
[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.", "16"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "12"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "13"]
|
||||
],
|
||||
"packages/jaeger-ui-components/src/model/transform-trace-data.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
@ -2750,17 +2737,14 @@ exports[`better eslint`] = {
|
||||
[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.", "3"]
|
||||
],
|
||||
"public/app/core/components/Layers/LayerName.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/core/components/Login/LoginCtrl.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.", "0"]
|
||||
],
|
||||
"public/app/core/components/Login/LoginPage.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
@ -2905,10 +2889,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/core/components/PermissionList/DisabledPermissionListItem.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/core/components/PermissionList/PermissionList.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/core/components/RolePicker/RolePickerMenu.tsx:5381": [
|
||||
@ -2930,12 +2910,6 @@ exports[`better eslint`] = {
|
||||
"public/app/core/components/Select/SortPicker.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/core/components/Select/TeamPicker.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/core/components/Select/UserPicker.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/core/components/SharedPreferences/SharedPreferences.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
@ -3391,8 +3365,7 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/admin/UserProfile.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.", "0"]
|
||||
],
|
||||
"public/app/features/admin/ldap/LdapPage.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
@ -3774,9 +3747,6 @@ exports[`better eslint`] = {
|
||||
"public/app/features/api-keys/ApiKeysForm.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/api-keys/ApiKeysPage.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/api-keys/ApiKeysTable.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
@ -3882,13 +3852,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Do not use any type assertions.", "10"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "11"]
|
||||
],
|
||||
"public/app/features/dashboard/components/DashNav/DashNav.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/DashNav/DashNavTimeControls.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/features/dashboard/components/DashboardPrompt/DashboardPrompt.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
@ -3914,15 +3877,6 @@ exports[`better eslint`] = {
|
||||
"public/app/features/dashboard/components/DashboardRow/DashboardRow.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/DashboardSettings/AnnotationsSettings.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/DashboardSettings/AutoRefreshIntervals.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/dashboard/components/DashboardSettings/DashboardSettings.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
@ -3935,9 +3889,6 @@ exports[`better eslint`] = {
|
||||
"public/app/features/dashboard/components/DashboardSettings/GeneralSettings.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/DashboardSettings/VersionsSettings.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/DashboardSettings/VersionsSettings.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
@ -3956,8 +3907,7 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||
],
|
||||
"public/app/features/dashboard/components/LinksSettings/LinkSettingsEdit.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.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/PanelEditor/AngularPanelOptions.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
@ -4037,13 +3987,9 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/features/dashboard/components/SaveDashboard/SaveDashboardErrorProxy.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx:5381": [
|
||||
"public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.test.tsx:5381": [
|
||||
@ -4057,8 +4003,7 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "7"]
|
||||
],
|
||||
"public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.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.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/SaveDashboard/types.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
@ -4070,17 +4015,10 @@ exports[`better eslint`] = {
|
||||
],
|
||||
"public/app/features/dashboard/components/ShareModal/ShareEmbed.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.", "1"]
|
||||
],
|
||||
"public/app/features/dashboard/components/ShareModal/ShareExport.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"],
|
||||
[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.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/ShareModal/ShareLink.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
@ -4096,8 +4034,7 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/ShareModal/SharePublicDashboard.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.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
@ -4108,9 +4045,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
||||
],
|
||||
"public/app/features/dashboard/components/SubMenu/Annotations.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/SubMenu/DashboardLinks.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
@ -4118,9 +4052,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/features/dashboard/components/SubMenu/SubMenu.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/components/TransformationsEditor/TransformationEditor.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
@ -4165,8 +4096,7 @@ exports[`better eslint`] = {
|
||||
[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.", "4"]
|
||||
],
|
||||
"public/app/features/dashboard/containers/DashboardPage.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
@ -4181,16 +4111,10 @@ exports[`better eslint`] = {
|
||||
[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, "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.", "10"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "11"]
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"]
|
||||
],
|
||||
"public/app/features/dashboard/dashgrid/DashboardGrid.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.", "0"]
|
||||
],
|
||||
"public/app/features/dashboard/dashgrid/DashboardGrid.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
@ -4512,8 +4436,7 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "11"]
|
||||
],
|
||||
"public/app/features/datasources/components/ButtonRow.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.", "0"]
|
||||
],
|
||||
"public/app/features/datasources/passwordHandlers.test.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
@ -4565,8 +4488,7 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||
],
|
||||
"public/app/features/dimensions/editors/ResourcePicker.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.", "0"]
|
||||
],
|
||||
"public/app/features/dimensions/editors/ScalarDimensionEditor.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
@ -4586,8 +4508,7 @@ exports[`better eslint`] = {
|
||||
[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.", "4"]
|
||||
],
|
||||
"public/app/features/dimensions/editors/ThresholdsEditor/ThresholdsEditor.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
@ -4639,17 +4560,13 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/explore/Explore.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, "Do not use any type assertions.", "2"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/explore/ExploreGraph.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/explore/ExplorePaneContainer.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, "Do not use any type assertions.", "2"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/explore/ExploreQueryInspector.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
@ -5134,9 +5051,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
||||
],
|
||||
"public/app/features/playlist/StartModal.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/playlist/usePlaylistItems.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
@ -5180,8 +5094,7 @@ exports[`better eslint`] = {
|
||||
[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, "Unexpected any. Specify a different type.", "4"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "3"]
|
||||
],
|
||||
"public/app/features/plugins/admin/pages/PluginDetails.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
@ -5620,8 +5533,7 @@ exports[`better eslint`] = {
|
||||
"public/app/features/transformers/FilterByValueTransformer/ValueMatchers/BasicMatcherEditor.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"]
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||
],
|
||||
"public/app/features/transformers/FilterByValueTransformer/ValueMatchers/NoopMatcherEditor.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
|
@ -32,7 +32,7 @@ export function ClipboardButton({
|
||||
const [showCopySuccess, setShowCopySuccess] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
let timeoutId: NodeJS.Timeout;
|
||||
let timeoutId: ReturnType<typeof setTimeout>;
|
||||
|
||||
if (showCopySuccess) {
|
||||
timeoutId = setTimeout(() => {
|
||||
|
@ -35,7 +35,7 @@ interface SelectMenuOptionProps<T> {
|
||||
isDisabled: boolean;
|
||||
isFocused: boolean;
|
||||
isSelected: boolean;
|
||||
innerProps: any;
|
||||
innerProps: JSX.IntrinsicElements['div'];
|
||||
innerRef: RefCallback<HTMLDivElement>;
|
||||
renderOptionLabel?: (value: SelectableValue<T>) => JSX.Element;
|
||||
data: SelectableValue<T>;
|
||||
|
@ -43,6 +43,6 @@ export const FooterCell = (props: FooterProps) => {
|
||||
return EmptyCell;
|
||||
};
|
||||
|
||||
export const EmptyCell = (props: any) => {
|
||||
export const EmptyCell = () => {
|
||||
return <span> </span>;
|
||||
};
|
||||
|
@ -26,11 +26,13 @@ interface State {
|
||||
}
|
||||
|
||||
class PopoverController extends Component<Props, State> {
|
||||
private hideTimeout: any;
|
||||
private hideTimeout: ReturnType<typeof setTimeout> | null = null;
|
||||
state = { show: false };
|
||||
|
||||
showPopper = () => {
|
||||
clearTimeout(this.hideTimeout);
|
||||
if (this.hideTimeout) {
|
||||
clearTimeout(this.hideTimeout);
|
||||
}
|
||||
this.setState({ show: true });
|
||||
};
|
||||
|
||||
|
@ -75,7 +75,7 @@ export const getStyles = (theme: GrafanaTheme2) => {
|
||||
|
||||
const jsonObjectOrArrayStartRegex = /^(\[|\{)/;
|
||||
|
||||
function parseIfComplexJson(value: any) {
|
||||
function parseIfComplexJson(value: unknown) {
|
||||
// if the value is a string representing actual json object or array, then use json-markup
|
||||
if (typeof value === 'string' && jsonObjectOrArrayStartRegex.test(value)) {
|
||||
// otherwise just return as is
|
||||
|
@ -56,7 +56,7 @@ function stringSupplant(str: string, encodeFn: (unencoded: any) => string, map:
|
||||
});
|
||||
}
|
||||
|
||||
export function processTemplate(template: any, encodeFn: (unencoded: any) => string): ProcessedTemplate {
|
||||
export function processTemplate(template: unknown, encodeFn: (unencoded: any) => string): ProcessedTemplate {
|
||||
if (typeof template !== 'string') {
|
||||
/*
|
||||
|
||||
@ -76,10 +76,10 @@ export function processTemplate(template: any, encodeFn: (unencoded: any) => str
|
||||
|
||||
export function createTestFunction(entry: any) {
|
||||
if (typeof entry === 'string') {
|
||||
return (arg: any) => arg === entry;
|
||||
return (arg: unknown) => arg === entry;
|
||||
}
|
||||
if (Array.isArray(entry)) {
|
||||
return (arg: any) => entry.indexOf(arg) > -1;
|
||||
return (arg: unknown) => entry.indexOf(arg) > -1;
|
||||
}
|
||||
/*
|
||||
|
||||
|
@ -49,7 +49,7 @@ export const LayerDragDropList = <T extends LayerElement>({
|
||||
<div {...provided.droppableProps} ref={provided.innerRef}>
|
||||
{(() => {
|
||||
// reverse order
|
||||
const rows: any = [];
|
||||
const rows: JSX.Element[] = [];
|
||||
const lastLayerIndex = excludeBaseLayer ? 1 : 0;
|
||||
const shouldRenderDragIconLengthThreshold = excludeBaseLayer ? 2 : 1;
|
||||
for (let i = layers.length - 1; i >= lastLayerIndex; i--) {
|
||||
|
@ -77,7 +77,7 @@ export class LoginCtrl extends PureComponent<Props, State> {
|
||||
.then(() => {
|
||||
this.toGrafana();
|
||||
})
|
||||
.catch((err: any) => console.error(err));
|
||||
.catch((err) => console.error(err));
|
||||
}
|
||||
};
|
||||
|
||||
@ -88,7 +88,7 @@ export class LoginCtrl extends PureComponent<Props, State> {
|
||||
|
||||
getBackendSrv()
|
||||
.post('/login', formModel)
|
||||
.then((result: any) => {
|
||||
.then((result) => {
|
||||
this.result = result;
|
||||
if (formModel.password !== 'admin' || config.ldapEnabled || config.authProxyEnabled) {
|
||||
this.toGrafana();
|
||||
|
@ -1,10 +1,10 @@
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import { Select, Icon, Button } from '@grafana/ui';
|
||||
import { dashboardPermissionLevels } from 'app/types/acl';
|
||||
import { DashboardAcl, dashboardPermissionLevels } from 'app/types/acl';
|
||||
|
||||
export interface Props {
|
||||
item: any;
|
||||
item: DashboardAcl;
|
||||
}
|
||||
|
||||
export default class DisabledPermissionListItem extends Component<Props, any> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
import { FolderInfo } from 'app/types';
|
||||
import { DashboardAcl } from 'app/types/acl';
|
||||
import { DashboardAcl, PermissionLevel } from 'app/types/acl';
|
||||
|
||||
import DisabledPermissionsListItem from './DisabledPermissionListItem';
|
||||
import PermissionsListItem from './PermissionListItem';
|
||||
@ -9,7 +9,7 @@ import PermissionsListItem from './PermissionListItem';
|
||||
export interface Props {
|
||||
items: DashboardAcl[];
|
||||
onRemoveItem: (item: DashboardAcl) => void;
|
||||
onPermissionChanged: any;
|
||||
onPermissionChanged: (item: DashboardAcl, level: PermissionLevel) => void;
|
||||
isFetching: boolean;
|
||||
folderInfo?: FolderInfo;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { debounce, isNil } from 'lodash';
|
||||
import { debounce, DebouncedFuncLeading, isNil } from 'lodash';
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
@ -16,7 +16,7 @@ export interface State {
|
||||
}
|
||||
|
||||
export class TeamPicker extends Component<Props, State> {
|
||||
debouncedSearch: any;
|
||||
debouncedSearch: DebouncedFuncLeading<typeof this.search>;
|
||||
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { debounce, isNil } from 'lodash';
|
||||
import { debounce, DebouncedFuncLeading, isNil } from 'lodash';
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
@ -17,7 +17,7 @@ export interface State {
|
||||
}
|
||||
|
||||
export class UserPicker extends Component<Props, State> {
|
||||
debouncedSearch: any;
|
||||
debouncedSearch: DebouncedFuncLeading<typeof this.search>;
|
||||
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
|
@ -203,7 +203,7 @@ export class UserProfileRow extends PureComponent<UserProfileRowProps, UserProfi
|
||||
value: this.props.value || '',
|
||||
};
|
||||
|
||||
setInputElem = (elem: any) => {
|
||||
setInputElem = (elem: HTMLInputElement) => {
|
||||
this.inputElem = elem;
|
||||
};
|
||||
|
||||
|
@ -172,7 +172,7 @@ describe('ApiKeysPage', () => {
|
||||
|
||||
describe('when a user adds an API key from CTA', () => {
|
||||
it('then it should call addApiKey with correct parameters', async () => {
|
||||
const apiKeys: any[] = [];
|
||||
const apiKeys: ApiKey[] = [];
|
||||
const { addApiKeyMock } = setup({ apiKeys, apiKeysCount: apiKeys.length, hasFetched: true });
|
||||
|
||||
addApiKeyMock.mockClear();
|
||||
|
@ -70,7 +70,7 @@ export const DashNav = React.memo<Props>((props) => {
|
||||
const dashboardSrv = getDashboardSrv();
|
||||
const { dashboard, setStarred } = props;
|
||||
|
||||
dashboardSrv.starDashboard(dashboard.id, dashboard.meta.isStarred).then((newState: any) => {
|
||||
dashboardSrv.starDashboard(dashboard.id, dashboard.meta.isStarred).then((newState) => {
|
||||
setStarred({ id: dashboard.uid, title: dashboard.title, url: dashboard.meta.url ?? '', isStarred: newState });
|
||||
dashboard.meta.isStarred = newState;
|
||||
forceUpdate();
|
||||
|
@ -3,6 +3,7 @@ import React from 'react';
|
||||
|
||||
import { getDashboardModel } from '../../../../../test/helpers/getDashboardModel';
|
||||
import { DashboardModel } from '../../state/DashboardModel';
|
||||
import { PanelModel } from '../../state/PanelModel';
|
||||
|
||||
import { DashNavTimeControls } from './DashNavTimeControls';
|
||||
|
||||
@ -47,7 +48,7 @@ describe('DashNavTimeControls', () => {
|
||||
});
|
||||
|
||||
it('should not render RefreshPicker interval button in panel edit', () => {
|
||||
const panel: any = { destroy: jest.fn(), isEditing: true };
|
||||
const panel: PanelModel = new PanelModel({ destroy: jest.fn(), isEditing: true });
|
||||
dashboardModel.startRefresh = jest.fn();
|
||||
dashboardModel.panelInEdit = panel;
|
||||
const container = render(
|
||||
@ -57,7 +58,7 @@ describe('DashNavTimeControls', () => {
|
||||
});
|
||||
|
||||
it('should render RefreshPicker run button in panel edit', () => {
|
||||
const panel: any = { destroy: jest.fn(), isEditing: true };
|
||||
const panel: PanelModel = new PanelModel({ destroy: jest.fn(), isEditing: true });
|
||||
dashboardModel.startRefresh = jest.fn();
|
||||
dashboardModel.panelInEdit = panel;
|
||||
const container = render(
|
||||
|
@ -7,10 +7,12 @@ import { selectors } from '@grafana/e2e-selectors';
|
||||
import { setAngularLoader, setDataSourceSrv } from '@grafana/runtime';
|
||||
import { mockDataSource, MockDataSourceSrv } from 'app/features/alerting/unified/mocks';
|
||||
|
||||
import { DashboardModel } from '../../state/DashboardModel';
|
||||
|
||||
import { AnnotationsSettings } from './AnnotationsSettings';
|
||||
|
||||
describe('AnnotationsSettings', () => {
|
||||
let dashboard: any;
|
||||
let dashboard: DashboardModel;
|
||||
|
||||
const dataSources = {
|
||||
grafana: mockDataSource(
|
||||
@ -57,7 +59,7 @@ describe('AnnotationsSettings', () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
dashboard = {
|
||||
dashboard = new DashboardModel({
|
||||
id: 74,
|
||||
version: 7,
|
||||
annotations: {
|
||||
@ -74,7 +76,7 @@ describe('AnnotationsSettings', () => {
|
||||
],
|
||||
},
|
||||
links: [],
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
test('it renders a header and cta if no annotations or only builtIn annotation', async () => {
|
||||
@ -143,12 +145,12 @@ describe('AnnotationsSettings', () => {
|
||||
type: 'dashboard',
|
||||
},
|
||||
];
|
||||
const dashboardWithAnnotations = {
|
||||
const dashboardWithAnnotations = new DashboardModel({
|
||||
...dashboard,
|
||||
annotations: {
|
||||
list: [...annotationsList],
|
||||
},
|
||||
};
|
||||
});
|
||||
render(<AnnotationsSettings dashboard={dashboardWithAnnotations} />);
|
||||
// Check that we have the correct annotations
|
||||
expect(screen.queryByText(/prometheus/i)).toBeInTheDocument();
|
||||
@ -177,12 +179,12 @@ describe('AnnotationsSettings', () => {
|
||||
type: 'dashboard',
|
||||
},
|
||||
];
|
||||
const dashboardWithAnnotations = {
|
||||
const dashboardWithAnnotations = new DashboardModel({
|
||||
...dashboard,
|
||||
annotations: {
|
||||
list: [...annotationsList],
|
||||
},
|
||||
};
|
||||
});
|
||||
render(<AnnotationsSettings dashboard={dashboardWithAnnotations} />);
|
||||
// Check that we have sorting buttons
|
||||
expect(within(getTableBodyRows()[0]).queryByRole('button', { name: 'arrow-up' })).not.toBeInTheDocument();
|
||||
|
@ -99,7 +99,7 @@ describe('getValidIntervals', () => {
|
||||
const dependencies = {
|
||||
getTimeSrv: () =>
|
||||
({
|
||||
getValidIntervals: (intervals: any) => intervals,
|
||||
getValidIntervals: (intervals: string[]) => intervals,
|
||||
} as unknown as TimeSrv),
|
||||
};
|
||||
|
||||
@ -115,7 +115,7 @@ describe('getValidIntervals', () => {
|
||||
const dependencies = {
|
||||
getTimeSrv: () =>
|
||||
({
|
||||
getValidIntervals: (intervals: any) => intervals,
|
||||
getValidIntervals: (intervals: string[]) => intervals,
|
||||
} as unknown as TimeSrv),
|
||||
};
|
||||
|
||||
@ -131,7 +131,7 @@ describe('getValidIntervals', () => {
|
||||
const dependencies = {
|
||||
getTimeSrv: () =>
|
||||
({
|
||||
getValidIntervals: (intervals: any) => intervals,
|
||||
getValidIntervals: (intervals: string[]) => intervals,
|
||||
} as unknown as TimeSrv),
|
||||
};
|
||||
|
||||
@ -148,7 +148,7 @@ describe('validateIntervals', () => {
|
||||
const dependencies = {
|
||||
getTimeSrv: () =>
|
||||
({
|
||||
getValidIntervals: (intervals: any) => intervals,
|
||||
getValidIntervals: (intervals: string[]) => intervals,
|
||||
} as unknown as TimeSrv),
|
||||
};
|
||||
|
||||
|
@ -4,6 +4,7 @@ import userEvent from '@testing-library/user-event';
|
||||
import { UserEvent } from '@testing-library/user-event/dist/types/setup';
|
||||
import React from 'react';
|
||||
|
||||
import { DashboardModel } from '../../state/DashboardModel';
|
||||
import { historySrv } from '../VersionHistory/HistorySrv';
|
||||
|
||||
import { VersionsSettings, VERSIONS_FETCH_LIMIT } from './VersionsSettings';
|
||||
@ -23,12 +24,12 @@ const queryByFullText = (text: string) =>
|
||||
});
|
||||
|
||||
describe('VersionSettings', () => {
|
||||
const dashboard: any = {
|
||||
const dashboard = new DashboardModel({
|
||||
id: 74,
|
||||
version: 11,
|
||||
formatDate: jest.fn(() => 'date'),
|
||||
getRelativeTime: jest.fn(() => 'time ago'),
|
||||
};
|
||||
});
|
||||
|
||||
let user: UserEvent;
|
||||
|
||||
|
@ -51,7 +51,7 @@ export const LinkSettingsEdit: React.FC<LinkSettingsEditProps> = ({ editLinkIdx,
|
||||
setLinkSettings(link);
|
||||
};
|
||||
|
||||
const onTagsChange = (tags: any[]) => {
|
||||
const onTagsChange = (tags: string[]) => {
|
||||
onUpdate({ ...linkSettings, tags: tags });
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import { useAsync } from 'react-use';
|
||||
|
||||
import { config } from '@grafana/runtime';
|
||||
import { config, isFetchError } from '@grafana/runtime';
|
||||
import { Drawer, Spinner, Tab, TabsBar } from '@grafana/ui';
|
||||
import { backendSrv } from 'app/core/services/backend_srv';
|
||||
|
||||
@ -126,7 +126,7 @@ export const SaveDashboardDrawer = ({ dashboard, onDismiss, onSaveSuccess, isCop
|
||||
);
|
||||
};
|
||||
|
||||
if (state.error) {
|
||||
if (state.error && isFetchError(state.error)) {
|
||||
return (
|
||||
<SaveDashboardErrorProxy
|
||||
error={state.error}
|
||||
|
@ -2,6 +2,7 @@ import { css } from '@emotion/css';
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
import { GrafanaTheme } from '@grafana/data';
|
||||
import { FetchError } from '@grafana/runtime';
|
||||
import { Button, ConfirmModal, Modal, stylesFactory, useTheme } from '@grafana/ui';
|
||||
import { DashboardModel } from 'app/features/dashboard/state';
|
||||
|
||||
@ -14,7 +15,7 @@ interface SaveDashboardErrorProxyProps {
|
||||
dashboard: DashboardModel;
|
||||
/** dashboard save model with applied modifications, i.e. title */
|
||||
dashboardSaveModel: any;
|
||||
error: any;
|
||||
error: FetchError;
|
||||
onDismiss: () => void;
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ interface SaveDashboardAsFormDTO {
|
||||
}
|
||||
|
||||
const getSaveAsDashboardClone = (dashboard: DashboardModel) => {
|
||||
const clone: any = dashboard.getSaveModelClone();
|
||||
const clone = dashboard.getSaveModelClone();
|
||||
clone.id = null;
|
||||
clone.uid = '';
|
||||
clone.title += ' Copy';
|
||||
|
@ -15,7 +15,7 @@ export type SaveProps = {
|
||||
saveModel: SaveDashboardData; // already cloned
|
||||
onCancel: () => void;
|
||||
onSuccess: () => void;
|
||||
onSubmit?: (clone: any, options: SaveDashboardOptions, dashboard: DashboardModel) => Promise<any>;
|
||||
onSubmit?: (clone: DashboardModel, options: SaveDashboardOptions, dashboard: DashboardModel) => Promise<any>;
|
||||
options: SaveDashboardOptions;
|
||||
onOptionsChange: (opts: SaveDashboardOptions) => void;
|
||||
};
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
|
||||
import { BootData } from '@grafana/data';
|
||||
import { setEchoSrv } from '@grafana/runtime/src';
|
||||
import config from 'app/core/config';
|
||||
|
||||
@ -48,7 +49,7 @@ function mockLocationHref(href: string) {
|
||||
}
|
||||
|
||||
describe('ShareEmbed', () => {
|
||||
let originalBootData: any;
|
||||
let originalBootData: BootData;
|
||||
|
||||
beforeAll(() => {
|
||||
setEchoSrv(new Echo());
|
||||
|
@ -54,11 +54,11 @@ export class ShareExport extends PureComponent<Props, State> {
|
||||
const { trimDefaults } = this.state;
|
||||
|
||||
if (shareExternally) {
|
||||
this.exporter.makeExportable(dashboard).then((dashboardJson: any) => {
|
||||
this.exporter.makeExportable(dashboard).then((dashboardJson) => {
|
||||
if (trimDefaults) {
|
||||
getBackendSrv()
|
||||
.post('/api/dashboards/trim', { dashboard: dashboardJson })
|
||||
.then((resp: any) => {
|
||||
.then((resp) => {
|
||||
this.openSaveAsDialog(resp.dashboard);
|
||||
});
|
||||
} else {
|
||||
@ -69,7 +69,7 @@ export class ShareExport extends PureComponent<Props, State> {
|
||||
if (trimDefaults) {
|
||||
getBackendSrv()
|
||||
.post('/api/dashboards/trim', { dashboard: dashboard.getSaveModelClone() })
|
||||
.then((resp: any) => {
|
||||
.then((resp) => {
|
||||
this.openSaveAsDialog(resp.dashboard);
|
||||
});
|
||||
} else {
|
||||
@ -84,11 +84,11 @@ export class ShareExport extends PureComponent<Props, State> {
|
||||
const { trimDefaults } = this.state;
|
||||
|
||||
if (shareExternally) {
|
||||
this.exporter.makeExportable(dashboard).then((dashboardJson: any) => {
|
||||
this.exporter.makeExportable(dashboard).then((dashboardJson) => {
|
||||
if (trimDefaults) {
|
||||
getBackendSrv()
|
||||
.post('/api/dashboards/trim', { dashboard: dashboardJson })
|
||||
.then((resp: any) => {
|
||||
.then((resp) => {
|
||||
this.openJsonModal(resp.dashboard);
|
||||
});
|
||||
} else {
|
||||
@ -99,7 +99,7 @@ export class ShareExport extends PureComponent<Props, State> {
|
||||
if (trimDefaults) {
|
||||
getBackendSrv()
|
||||
.post('/api/dashboards/trim', { dashboard: dashboard.getSaveModelClone() })
|
||||
.then((resp: any) => {
|
||||
.then((resp) => {
|
||||
this.openJsonModal(resp.dashboard);
|
||||
});
|
||||
} else {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
|
||||
import { BootData } from '@grafana/data';
|
||||
import { BackendSrv, setEchoSrv } from '@grafana/runtime';
|
||||
import config from 'app/core/config';
|
||||
import { DashboardModel, PanelModel } from 'app/features/dashboard/state';
|
||||
@ -44,7 +45,7 @@ jest.mock('app/core/core', () => {
|
||||
});
|
||||
|
||||
describe('SharePublic', () => {
|
||||
let originalBootData: any;
|
||||
let originalBootData: BootData;
|
||||
|
||||
beforeAll(() => {
|
||||
setEchoSrv(new Echo());
|
||||
|
@ -1,13 +1,13 @@
|
||||
import React, { FunctionComponent, useEffect, useState } from 'react';
|
||||
|
||||
import { AnnotationQuery, EventBus } from '@grafana/data';
|
||||
import { AnnotationQuery, DataQuery, EventBus } from '@grafana/data';
|
||||
|
||||
import { AnnotationPicker } from './AnnotationPicker';
|
||||
|
||||
interface Props {
|
||||
events: EventBus;
|
||||
annotations: AnnotationQuery[];
|
||||
onAnnotationChanged: (annotation: any) => void;
|
||||
onAnnotationChanged: (annotation: AnnotationQuery<DataQuery>) => void;
|
||||
}
|
||||
|
||||
export const Annotations: FunctionComponent<Props> = ({ annotations, onAnnotationChanged, events }) => {
|
||||
|
@ -2,7 +2,7 @@ import { css } from '@emotion/css';
|
||||
import React, { PureComponent } from 'react';
|
||||
import { connect, MapStateToProps } from 'react-redux';
|
||||
|
||||
import { AnnotationQuery } from '@grafana/data';
|
||||
import { AnnotationQuery, DataQuery } from '@grafana/data';
|
||||
|
||||
import { StoreState } from '../../../../types';
|
||||
import { getSubMenuVariables, getVariablesState } from '../../../variables/state/selectors';
|
||||
@ -29,7 +29,7 @@ interface DispatchProps {}
|
||||
type Props = OwnProps & ConnectedProps & DispatchProps;
|
||||
|
||||
class SubMenuUnConnected extends PureComponent<Props> {
|
||||
onAnnotationStateChanged = (updatedAnnotation: any) => {
|
||||
onAnnotationStateChanged = (updatedAnnotation: AnnotationQuery<DataQuery>) => {
|
||||
// we're mutating dashboard state directly here until annotations are in Redux.
|
||||
for (let index = 0; index < this.props.dashboard.annotations.list.length; index++) {
|
||||
const annotation = this.props.dashboard.annotations.list[index];
|
||||
|
@ -11,7 +11,7 @@ import { selectors } from '@grafana/e2e-selectors';
|
||||
import { config, locationService, setDataSourceSrv } from '@grafana/runtime';
|
||||
import { notifyApp } from 'app/core/actions';
|
||||
import { getRouteComponentProps } from 'app/core/navigation/__mocks__/routeProps';
|
||||
import { DashboardInitPhase, DashboardRoutes } from 'app/types';
|
||||
import { DashboardInitPhase, DashboardMeta, DashboardRoutes } from 'app/types';
|
||||
|
||||
import { configureStore } from '../../../store/configureStore';
|
||||
import { Props as LazyLoaderProps } from '../dashgrid/LazyLoader';
|
||||
@ -74,7 +74,7 @@ interface ScenarioContext {
|
||||
setup: (fn: () => void) => void;
|
||||
}
|
||||
|
||||
function getTestDashboard(overrides?: any, metaOverrides?: any): DashboardModel {
|
||||
function getTestDashboard(overrides?: any, metaOverrides?: Partial<DashboardMeta>): DashboardModel {
|
||||
const data = Object.assign(
|
||||
{
|
||||
title: 'My dashboard',
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
|
||||
import { DashboardRoutes } from 'app/types';
|
||||
import { DashboardMeta, DashboardRoutes } from 'app/types';
|
||||
|
||||
import { getRouteComponentProps } from '../../../core/navigation/__mocks__/routeProps';
|
||||
import { Props as DashboardPanelProps } from '../dashgrid/DashboardPanel';
|
||||
@ -24,14 +24,14 @@ jest.mock('app/features/dashboard/dashgrid/DashboardPanel', () => {
|
||||
interface ScenarioContext {
|
||||
dashboard?: DashboardModel | null;
|
||||
secondaryDashboard?: DashboardModel | null;
|
||||
setDashboard: (overrides?: any, metaOverrides?: any) => void;
|
||||
setSecondaryDashboard: (overrides?: any, metaOverrides?: any) => void;
|
||||
setDashboard: (overrides?: any, metaOverrides?: Partial<DashboardMeta>) => void;
|
||||
setSecondaryDashboard: (overrides?: any, metaOverrides?: Partial<DashboardMeta>) => void;
|
||||
mount: (propOverrides?: Partial<Props>) => void;
|
||||
rerender: (propOverrides?: Partial<Props>) => void;
|
||||
setup: (fn: () => void) => void;
|
||||
}
|
||||
|
||||
function getTestDashboard(overrides?: any, metaOverrides?: any): DashboardModel {
|
||||
function getTestDashboard(overrides?: any, metaOverrides?: Partial<DashboardMeta>): DashboardModel {
|
||||
const data = Object.assign(
|
||||
{
|
||||
title: 'My dashboard',
|
||||
@ -59,10 +59,10 @@ function soloPanelPageScenario(description: string, scenarioFn: (ctx: ScenarioCo
|
||||
setup: (fn) => {
|
||||
setupFn = fn;
|
||||
},
|
||||
setDashboard: (overrides?: any, metaOverrides?: any) => {
|
||||
setDashboard: (overrides?: any, metaOverrides?: Partial<DashboardMeta>) => {
|
||||
ctx.dashboard = getTestDashboard(overrides, metaOverrides);
|
||||
},
|
||||
setSecondaryDashboard: (overrides?: any, metaOverrides?: any) => {
|
||||
setSecondaryDashboard: (overrides?: any, metaOverrides?: Partial<DashboardMeta>) => {
|
||||
ctx.secondaryDashboard = getTestDashboard(overrides, metaOverrides);
|
||||
},
|
||||
mount: (propOverrides?: Partial<Props>) => {
|
||||
|
@ -1,6 +1,8 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
|
||||
import { DashboardMeta } from 'app/types';
|
||||
|
||||
import { DashboardModel } from '../state';
|
||||
|
||||
import { DashboardGridUnconnected as DashboardGrid, Props } from './DashboardGrid';
|
||||
@ -12,7 +14,7 @@ jest.mock('app/features/dashboard/dashgrid/LazyLoader', () => {
|
||||
return { LazyLoader };
|
||||
});
|
||||
|
||||
function getTestDashboard(overrides?: any, metaOverrides?: any): DashboardModel {
|
||||
function getTestDashboard(overrides?: any, metaOverrides?: Partial<DashboardMeta>): DashboardModel {
|
||||
const data = Object.assign(
|
||||
{
|
||||
title: 'My dashboard',
|
||||
|
@ -11,7 +11,7 @@ export interface Props {
|
||||
canDelete: boolean;
|
||||
onDelete: () => void;
|
||||
onSubmit: (event: any) => void;
|
||||
onTest: (event: any) => void;
|
||||
onTest: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
||||
}
|
||||
|
||||
export function ButtonRow({ canSave, canDelete, onDelete, onSubmit, onTest, exploreUrl }: Props) {
|
||||
|
@ -90,7 +90,7 @@ export const ResourcePicker = (props: Props) => {
|
||||
{...popperProps}
|
||||
referenceElement={pickerTriggerRef.current}
|
||||
onMouseEnter={showPopper}
|
||||
onKeyDown={(event: any) => {
|
||||
onKeyDown={(event) => {
|
||||
closePopover(event, hidePopper);
|
||||
}}
|
||||
/>
|
||||
|
@ -28,7 +28,7 @@ function getCurrentThresholds(editor: ThresholdsEditor) {
|
||||
}
|
||||
|
||||
describe('ThresholdsEditor', () => {
|
||||
let restoreThemeContext: any;
|
||||
let restoreThemeContext: () => void;
|
||||
|
||||
beforeAll(() => {
|
||||
restoreThemeContext = mockThemeContext(createTheme());
|
||||
|
@ -6,7 +6,7 @@ import AutoSizer from 'react-virtualized-auto-sizer';
|
||||
import { compose } from 'redux';
|
||||
import { Unsubscribable } from 'rxjs';
|
||||
|
||||
import { AbsoluteTimeRange, DataQuery, GrafanaTheme2, LoadingState, RawTimeRange } from '@grafana/data';
|
||||
import { AbsoluteTimeRange, DataQuery, GrafanaTheme2, LoadingState, QueryFixAction, RawTimeRange } from '@grafana/data';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
import { Collapse, CustomScrollbar, ErrorBoundaryAlert, Themeable2, withTheme2, PanelContainer } from '@grafana/ui';
|
||||
import { FILTER_FOR_OPERATOR, FILTER_OUT_OPERATOR, FilterItem } from '@grafana/ui/src/components/Table/types';
|
||||
@ -167,10 +167,10 @@ export class Explore extends React.PureComponent<Props, ExploreState> {
|
||||
makeAbsoluteTime();
|
||||
};
|
||||
|
||||
onModifyQueries = (action: any, index?: number) => {
|
||||
onModifyQueries = (action: QueryFixAction, index?: number) => {
|
||||
const { datasourceInstance } = this.props;
|
||||
if (datasourceInstance?.modifyQuery) {
|
||||
const modifier = (queries: DataQuery, modification: any) =>
|
||||
const modifier = (queries: DataQuery, modification: QueryFixAction) =>
|
||||
datasourceInstance.modifyQuery!(queries, modification);
|
||||
this.props.modifyQueries(this.props.exploreId, action, modifier, index);
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ interface Props extends OwnProps, ConnectedProps<typeof connector> {}
|
||||
* of state based on URL changes and preventing any infinite loops.
|
||||
*/
|
||||
class ExplorePaneContainerUnconnected extends React.PureComponent<Props> {
|
||||
el: any;
|
||||
el: HTMLDivElement | null = null;
|
||||
exploreEvents: EventBusExtended;
|
||||
|
||||
constructor(props: Props) {
|
||||
@ -100,7 +100,7 @@ class ExplorePaneContainerUnconnected extends React.PureComponent<Props> {
|
||||
}
|
||||
};
|
||||
|
||||
getRef = (el: any) => {
|
||||
getRef = (el: HTMLDivElement) => {
|
||||
this.el = el;
|
||||
};
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { FC, useState } from 'react';
|
||||
|
||||
import { SelectableValue, urlUtil } from '@grafana/data';
|
||||
import { SelectableValue, UrlQueryMap, urlUtil } from '@grafana/data';
|
||||
import { locationService } from '@grafana/runtime';
|
||||
import { Button, Checkbox, Field, FieldSet, Modal, RadioButtonGroup } from '@grafana/ui';
|
||||
|
||||
@ -22,7 +22,7 @@ export const StartModal: FC<StartModalProps> = ({ playlist, onDismiss }) => {
|
||||
];
|
||||
|
||||
const onStart = () => {
|
||||
const params: any = {};
|
||||
const params: UrlQueryMap = {};
|
||||
if (mode) {
|
||||
params.kiosk = mode;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ export default function Browse({ route }: GrafanaRouteComponentProps): ReactElem
|
||||
history.push({ query: { filterByType: value } });
|
||||
};
|
||||
|
||||
const onSearch = (q: any) => {
|
||||
const onSearch = (q: string) => {
|
||||
history.push({ query: { filterBy: 'all', filterByType: 'all', q } });
|
||||
};
|
||||
|
||||
|
@ -99,7 +99,7 @@ export const getBasicValueMatchersUI = (): Array<ValueMatcherUIRegistryItem<Basi
|
||||
id: ValueMatcherID.regex,
|
||||
component: basicMatcherEditor<string>({
|
||||
validator: () => true,
|
||||
converter: (value: any) => String(value),
|
||||
converter: (value) => String(value),
|
||||
}),
|
||||
},
|
||||
];
|
||||
|
@ -37,7 +37,7 @@ const LOGQL_EXAMPLES = [
|
||||
];
|
||||
|
||||
export default class LokiCheatSheet extends PureComponent<QueryEditorHelpProps<LokiQuery>, { userExamples: string[] }> {
|
||||
declare userLabelTimer: NodeJS.Timeout;
|
||||
declare userLabelTimer: ReturnType<typeof setTimeout>;
|
||||
state = {
|
||||
userExamples: [],
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user