diff --git a/.betterer.results b/.betterer.results index 309c5db2ef6..556a784b5dd 100644 --- a/.betterer.results +++ b/.betterer.results @@ -2916,19 +2916,9 @@ exports[`better eslint`] = { "public/app/features/dashboard/components/HelpWizard/randomizer.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], - "public/app/features/dashboard/components/Inspector/PanelInspectActions.tsx:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"] - ], "public/app/features/dashboard/components/Inspector/PanelInspector.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], - "public/app/features/dashboard/components/Inspector/hooks.ts:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"] - ], "public/app/features/dashboard/components/PanelEditor/OptionsPane.tsx:5381": [ [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"] ], diff --git a/public/app/features/dashboard/components/Inspector/PanelInspectActions.tsx b/public/app/features/dashboard/components/Inspector/PanelInspectActions.tsx deleted file mode 100644 index e66449ae3f4..00000000000 --- a/public/app/features/dashboard/components/Inspector/PanelInspectActions.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import React, { ComponentType } from 'react'; - -import { PanelData } from '@grafana/data'; - -import { PanelModel } from '../../state'; - -export interface PanelInspectActionProps { - panel: PanelModel; - data?: PanelData; -} - -export interface PanelInspectAction { - title: string; - description: string; - - component: ComponentType; -} - -export interface PanelInspectActionSupplier { - getActions: (panel: PanelModel) => PanelInspectAction[] | null; -} - -// const dummySupplier: PanelInspectActionSupplier = { -// getActions: (panel: PanelModel) => { -// return [ -// { -// title: 'Do something', -// description: 'that thingy', -// // eslint-disable-next-line react/display-name -// component: ({ panel }) => { -// return ( -//
-// DO THING ONE. Panel:
{JSON.stringify(panel.targets)}
-//
-// ); -// }, -// }, -// { -// title: 'Do something else', -// description: 'another thing', -// // eslint-disable-next-line react/display-name -// component: ({ panel }) => { -// return ( -//
-// DO THING TWO. Panel:
{JSON.stringify(panel.targets)}
-//
-// ); -// }, -// }, -// ]; -// }, -// }; - -// In Grafana 8.1, this can be improved and moved to `@grafana/runtime` -// NOTE: This is an internal/experimental API/hack and will change! -// (window as any).grafanaPanelInspectActionSupplier = dummySupplier; - -interface InspectActionsTabProps { - panel: PanelModel; - data?: PanelData; -} - -export const InspectActionsTab: React.FC = ({ panel, data }) => { - const supplier = (window as any).grafanaPanelInspectActionSupplier as PanelInspectActionSupplier; - if (!supplier) { - return
Missing actions
; - } - - const actions = supplier.getActions(panel); - if (!actions?.length) { - return
No actions avaliable
; - } - - return ( -
- {actions.map((a, idx) => ( -
-

{a.title}

- {a.description} - -
- ))} -
- ); -}; diff --git a/public/app/features/dashboard/components/Inspector/hooks.ts b/public/app/features/dashboard/components/Inspector/hooks.ts index d359c475973..48163ea84cc 100644 --- a/public/app/features/dashboard/components/Inspector/hooks.ts +++ b/public/app/features/dashboard/components/Inspector/hooks.ts @@ -9,8 +9,6 @@ import { InspectTab } from 'app/features/inspector/types'; import { supportsDataQuery } from '../PanelEditor/utils'; -import { PanelInspectActionSupplier } from './PanelInspectActions'; - /** * Given PanelData return first data source supporting metadata inspector */ @@ -62,19 +60,9 @@ export const useInspectTabs = ( tabs.push({ label: t('dashboard.inspect.error-tab', 'Error'), value: InspectTab.Error }); } - // This is a quick internal hack to allow custom actions in inspect - // For 8.1, something like this should be exposed through grafana/runtime - const supplier = (window as any).grafanaPanelInspectActionSupplier as PanelInspectActionSupplier; - if (supplier && supplier.getActions(panel)?.length) { - tabs.push({ - label: t('dashboard.inspect.actions-tab', 'Actions'), - value: InspectTab.Actions, - }); - } - if (dashboard.meta.canEdit && supportsDataQuery(plugin)) { tabs.push({ label: t('dashboard.inspect.query-tab', 'Query'), value: InspectTab.Query }); } return tabs; - }, [panel, plugin, metaDs, dashboard, error]); + }, [plugin, metaDs, dashboard, error]); }; diff --git a/public/app/features/inspector/types.ts b/public/app/features/inspector/types.ts index fedd51f5ab5..fabd72d10f1 100644 --- a/public/app/features/inspector/types.ts +++ b/public/app/features/inspector/types.ts @@ -5,6 +5,5 @@ export enum InspectTab { Stats = 'stats', JSON = 'json', Query = 'query', - Actions = 'actions', // ALPHA! Help = 'help', // get info required for support+debugging } diff --git a/public/locales/de-DE/grafana.json b/public/locales/de-DE/grafana.json index 82ce8b0468d..444a8897ff9 100644 --- a/public/locales/de-DE/grafana.json +++ b/public/locales/de-DE/grafana.json @@ -32,7 +32,6 @@ }, "dashboard": { "inspect": { - "actions-tab": "Aktionen", "data-tab": "Daten", "error-tab": "Fehler", "json-tab": "JSON", diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index 77978f893c5..d30697295a1 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -32,7 +32,6 @@ }, "dashboard": { "inspect": { - "actions-tab": "Actions", "data-tab": "Data", "error-tab": "Error", "json-tab": "JSON", diff --git a/public/locales/es-ES/grafana.json b/public/locales/es-ES/grafana.json index 4030d4aaf87..ffe76941eb9 100644 --- a/public/locales/es-ES/grafana.json +++ b/public/locales/es-ES/grafana.json @@ -32,7 +32,6 @@ }, "dashboard": { "inspect": { - "actions-tab": "Acciones", "data-tab": "Datos", "error-tab": "Error", "json-tab": "JSON", diff --git a/public/locales/fr-FR/grafana.json b/public/locales/fr-FR/grafana.json index e684abfd899..2dbf6848724 100644 --- a/public/locales/fr-FR/grafana.json +++ b/public/locales/fr-FR/grafana.json @@ -32,7 +32,6 @@ }, "dashboard": { "inspect": { - "actions-tab": "Actions", "data-tab": "Données", "error-tab": "Erreur", "json-tab": "JSON", diff --git a/public/locales/pseudo-LOCALE/grafana.json b/public/locales/pseudo-LOCALE/grafana.json index 3a9dd97dc82..b8e05e65ae7 100644 --- a/public/locales/pseudo-LOCALE/grafana.json +++ b/public/locales/pseudo-LOCALE/grafana.json @@ -32,7 +32,6 @@ }, "dashboard": { "inspect": { - "actions-tab": "Åčŧįőʼnş", "data-tab": "Đäŧä", "error-tab": "Ēřřőř", "json-tab": "ĴŜØŃ", diff --git a/public/locales/zh-Hans/grafana.json b/public/locales/zh-Hans/grafana.json index 907485f55ca..a7603565155 100644 --- a/public/locales/zh-Hans/grafana.json +++ b/public/locales/zh-Hans/grafana.json @@ -32,7 +32,6 @@ }, "dashboard": { "inspect": { - "actions-tab": "操作", "data-tab": "数据", "error-tab": "错误", "json-tab": "JSON",