Chore: Move amendTimeSeries in @grafana/data package (#89456)

* move amendTimeSeries in @grafana/data package

* betterer and prettier
This commit is contained in:
ismail simsek 2024-06-21 12:39:42 +02:00 committed by GitHub
parent d750af0c48
commit 957957e62a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 11 deletions

View File

@ -143,6 +143,14 @@ exports[`better eslint`] = {
"packages/grafana-data/src/panel/registryFactories.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"packages/grafana-data/src/table/amendTimeSeries.ts:5381": [
[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.", "2"],
[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.", "5"]
],
"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.", "1"],
@ -4611,14 +4619,6 @@ exports[`better eslint`] = {
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"],
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "2"]
],
"public/app/features/live/data/amendTimeSeries.ts:5381": [
[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.", "2"],
[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.", "5"]
],
"public/app/features/logs/components/InfiniteScroll.tsx:5381": [
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"]
],

View File

@ -16,6 +16,7 @@ export * from './themes';
export * from './monaco';
export * from './geo/layer';
export * from './query';
export { amendTable, trimTable, type Table } from './table/amendTimeSeries';
export {
type ValueMatcherOptions,
type BasicValueMatcherOptions,

View File

@ -1,4 +1,4 @@
import { Table, amendTable } from "./amendTimeSeries";
import { Table, amendTable } from './amendTimeSeries';
describe('amendTable', () => {
it('should append nextTable when there is no overlap (nextTable after prevTable)', () => {

View File

@ -1,4 +1,4 @@
import { closestIdx } from '@grafana/data';
import { closestIdx } from '../';
export type Table = [times: number[], ...values: any[][]];
@ -98,7 +98,7 @@ export function trimTable(table: Table, fromTime: number, toTime: number): Table
if (fromIdx != null || toIdx != null) {
times = times.slice(fromIdx ?? 0, toIdx);
vals = vals.map(vals2 => vals2.slice(fromIdx ?? 0, toIdx));
vals = vals.map((vals2) => vals2.slice(fromIdx ?? 0, toIdx));
}
return [times, ...vals];