CustomVariable: Remove dead code and incorrect label (#115340)
* CustomVariable: Remove dead code and incorrect label * Update i18n translations
This commit is contained in:
+1
-19
@@ -1,13 +1,9 @@
|
|||||||
import { FormEvent, useCallback } from 'react';
|
import { FormEvent, useCallback } from 'react';
|
||||||
|
|
||||||
import { t } from '@grafana/i18n';
|
import { CustomVariable } from '@grafana/scenes';
|
||||||
import { CustomVariable, SceneVariable } from '@grafana/scenes';
|
|
||||||
|
|
||||||
import { OptionsPaneItemDescriptor } from '../../../../../dashboard/components/PanelEditor/OptionsPaneItemDescriptor';
|
|
||||||
import { CustomVariableForm } from '../../components/CustomVariableForm';
|
import { CustomVariableForm } from '../../components/CustomVariableForm';
|
||||||
|
|
||||||
import { PaneItem } from './PaneItem';
|
|
||||||
|
|
||||||
interface CustomVariableEditorProps {
|
interface CustomVariableEditorProps {
|
||||||
variable: CustomVariable;
|
variable: CustomVariable;
|
||||||
onRunQuery: () => void;
|
onRunQuery: () => void;
|
||||||
@@ -67,17 +63,3 @@ export function CustomVariableEditor({ variable, onRunQuery }: CustomVariableEdi
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getCustomVariableOptions(variable: SceneVariable): OptionsPaneItemDescriptor[] {
|
|
||||||
if (!(variable instanceof CustomVariable)) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
new OptionsPaneItemDescriptor({
|
|
||||||
title: t('dashboard.edit-pane.variable.custom-options.values', 'Values separated by comma'),
|
|
||||||
id: 'custom-variable-values',
|
|
||||||
render: ({ props }) => <PaneItem id={props.id} variable={variable} />,
|
|
||||||
}),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|||||||
-2
@@ -1,4 +1,3 @@
|
|||||||
import { t } from '@grafana/i18n';
|
|
||||||
import { CustomVariable, SceneVariable } from '@grafana/scenes';
|
import { CustomVariable, SceneVariable } from '@grafana/scenes';
|
||||||
|
|
||||||
import { OptionsPaneItemDescriptor } from '../../../../../dashboard/components/PanelEditor/OptionsPaneItemDescriptor';
|
import { OptionsPaneItemDescriptor } from '../../../../../dashboard/components/PanelEditor/OptionsPaneItemDescriptor';
|
||||||
@@ -12,7 +11,6 @@ export function getCustomVariableOptions(variable: SceneVariable): OptionsPaneIt
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
new OptionsPaneItemDescriptor({
|
new OptionsPaneItemDescriptor({
|
||||||
title: t('dashboard.edit-pane.variable.custom-options.values', 'Values separated by comma'),
|
|
||||||
id: 'custom-variable-values',
|
id: 'custom-variable-values',
|
||||||
render: ({ props }) => <PaneItem id={props.id} variable={variable} />,
|
render: ({ props }) => <PaneItem id={props.id} variable={variable} />,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -4821,8 +4821,7 @@
|
|||||||
"apply": "Apply",
|
"apply": "Apply",
|
||||||
"change-value": "Change variable value",
|
"change-value": "Change variable value",
|
||||||
"discard": "Discard",
|
"discard": "Discard",
|
||||||
"modal-title": "Custom Variable",
|
"modal-title": "Custom Variable"
|
||||||
"values": "Values separated by comma"
|
|
||||||
},
|
},
|
||||||
"datasource-options": {
|
"datasource-options": {
|
||||||
"name-filter": "Name filter",
|
"name-filter": "Name filter",
|
||||||
|
|||||||
Reference in New Issue
Block a user