mirror of
https://github.com/grafana/grafana.git
synced 2025-01-13 09:32:12 -06:00
Chore: Avoid Grafana core imports for the test data source (#71956)
This commit is contained in:
parent
2c82a6b6c4
commit
47f1c5d084
33
.eslintrc
33
.eslintrc
@ -88,6 +88,39 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"public/app/plugins/datasource/testdata/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/testdata/**/*.{ts,tsx}"
|
||||
],
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
// generic rules
|
||||
{
|
||||
"name": "react-redux",
|
||||
"importNames": ["useDispatch", "useSelector"],
|
||||
"message": "Please import from app/types instead."
|
||||
},
|
||||
{
|
||||
"name": "react-i18next",
|
||||
"importNames": ["Trans", "t"],
|
||||
"message": "Please import from app/core/internationalization instead"
|
||||
}
|
||||
],
|
||||
// new rules
|
||||
"patterns": [
|
||||
{
|
||||
"group": ["**/app/*"],
|
||||
"message": "Core plugins are not allowed to depend on Grafana core packages"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import { useAsync } from 'react-use';
|
||||
import { QueryEditorProps, SelectableValue } from '@grafana/data';
|
||||
import { selectors as editorSelectors } from '@grafana/e2e-selectors';
|
||||
import { InlineField, InlineFieldRow, InlineSwitch, Input, Select, Icon, TextArea } from '@grafana/ui';
|
||||
import { NumberInput } from 'app/core/components/OptionsUI/NumberInput';
|
||||
|
||||
import { RandomWalkEditor, StreamingClientEditor } from './components';
|
||||
import { CSVContentEditor } from './components/CSVContentEditor';
|
||||
@ -166,13 +165,6 @@ export const QueryEditor = ({ query, datasource, onChange, onRunQuery }: Props)
|
||||
onUpdate({ ...query, csvWave });
|
||||
};
|
||||
|
||||
const onDropPercentChanged = (dropPercent: number | undefined) => {
|
||||
if (!dropPercent) {
|
||||
dropPercent = undefined;
|
||||
}
|
||||
onChange({ ...query, dropPercent });
|
||||
};
|
||||
|
||||
const options = useMemo(
|
||||
() =>
|
||||
(scenarioList || [])
|
||||
@ -234,12 +226,14 @@ export const QueryEditor = ({ query, datasource, onChange, onRunQuery }: Props)
|
||||
)}
|
||||
{show.dropPercent && (
|
||||
<InlineField label="Drop" tooltip={'Drop a random set of points'}>
|
||||
<NumberInput
|
||||
<Input
|
||||
type="number"
|
||||
min={0}
|
||||
max={100}
|
||||
step={5}
|
||||
width={8}
|
||||
onChange={onDropPercentChanged}
|
||||
onChange={onInputChange}
|
||||
name="dropPercent"
|
||||
placeholder="0"
|
||||
value={query.dropPercent}
|
||||
suffix={<Icon name="percentage" />}
|
||||
|
@ -12,7 +12,9 @@ import {
|
||||
DataFrameSchema,
|
||||
DataFrameData,
|
||||
} from '@grafana/data';
|
||||
// eslint-disable-next-line no-restricted-imports -- In the process from being removed
|
||||
import { liveTimer } from 'app/features/dashboard/dashgrid/liveTimer';
|
||||
// eslint-disable-next-line no-restricted-imports -- In the process from being removed
|
||||
import { StreamingDataFrame } from 'app/features/live/data/StreamingDataFrame';
|
||||
|
||||
import { getRandomLine } from './LogIpsum';
|
||||
|
Loading…
Reference in New Issue
Block a user