revert table tracking (#77021)

This commit is contained in:
Victor Marin 2023-10-24 13:58:14 +03:00 committed by GitHub
parent ced065c7e9
commit 575981201c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 22 deletions

View File

@ -3,11 +3,9 @@ import { merge } from 'lodash';
import React, { useState } from 'react';
import { GrafanaTheme2, SelectableValue } from '@grafana/data';
import { reportInteraction } from '@grafana/runtime';
import { TableCellOptions } from '@grafana/schema';
import { Field, Select, TableCellDisplayMode, useStyles2 } from '@grafana/ui';
import { INTERACTION_EVENT_NAME, INTERACTION_ITEM } from './TablePanel';
import { BarGaugeCellOptionsEditor } from './cells/BarGaugeCellOptionsEditor';
import { ColorBackgroundCellOptionsEditor } from './cells/ColorBackgroundCellOptionsEditor';
import { SparklineCellOptionsEditor } from './cells/SparklineCellOptionsEditor';
@ -44,8 +42,6 @@ export const TableCellOptionEditor = ({ value, onChange }: Props) => {
value = merge(value, settingCache[value.type]);
}
reportInteraction(INTERACTION_EVENT_NAME, { item: INTERACTION_ITEM.CELL_TYPE_CHANGE, type: value.type });
onChange(value);
}
};

View File

@ -2,22 +2,13 @@ import { css } from '@emotion/css';
import React from 'react';
import { DataFrame, FieldMatcherID, getFrameDisplayName, PanelProps, SelectableValue } from '@grafana/data';
import { PanelDataErrorView, reportInteraction } from '@grafana/runtime';
import { PanelDataErrorView } from '@grafana/runtime';
import { Select, Table, usePanelContext, useTheme2 } from '@grafana/ui';
import { TableSortByFieldState } from '@grafana/ui/src/components/Table/types';
import { hasDeprecatedParentRowIndex, migrateFromParentRowIndexToNestedFrames } from './migrations';
import { Options } from './panelcfg.gen';
export const INTERACTION_EVENT_NAME = 'table_panel_usage';
export const INTERACTION_ITEM = {
COLUMN_RESIZE: 'column_resize',
SORT_BY: 'sort_by',
TABLE_SELECTION_CHANGE: 'table_selection_change',
ERROR_VIEW: 'error_view',
CELL_TYPE_CHANGE: 'cell_type_change',
};
interface Props extends PanelProps<Options> {}
export function TablePanel(props: Props) {
@ -36,8 +27,6 @@ export function TablePanel(props: Props) {
let tableHeight = height;
if (!count || !hasFields) {
reportInteraction(INTERACTION_EVENT_NAME, { item: INTERACTION_ITEM.ERROR_VIEW });
return <PanelDataErrorView panelId={id} fieldConfig={fieldConfig} data={data} />;
}
@ -117,8 +106,6 @@ function onColumnResize(fieldDisplayName: string, width: number, props: Props) {
});
}
reportInteraction(INTERACTION_EVENT_NAME, { item: INTERACTION_ITEM.COLUMN_RESIZE });
props.onFieldConfigChange({
...fieldConfig,
overrides,
@ -126,8 +113,6 @@ function onColumnResize(fieldDisplayName: string, width: number, props: Props) {
}
function onSortByChange(sortBy: TableSortByFieldState[], props: Props) {
reportInteraction(INTERACTION_EVENT_NAME, { item: INTERACTION_ITEM.SORT_BY });
props.onOptionsChange({
...props.options,
sortBy,
@ -135,8 +120,6 @@ function onSortByChange(sortBy: TableSortByFieldState[], props: Props) {
}
function onChangeTableSelection(val: SelectableValue<number>, props: Props) {
reportInteraction(INTERACTION_EVENT_NAME, { item: INTERACTION_ITEM.TABLE_SELECTION_CHANGE });
props.onOptionsChange({
...props.options,
frameIndex: val.value || 0,