Tempo: Remove noop (#74207)

Remove noop
This commit is contained in:
Joey 2023-09-04 15:55:22 +01:00 committed by GitHub
parent 7f2841aeca
commit 3a90e2d13c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1 additions and 26 deletions

View File

@ -48,10 +48,6 @@ const getStyles = (theme: GrafanaTheme2) => ({
`,
});
function noop(): {} {
return {};
}
type Props = {
dataFrames: DataFrame[];
splitOpenFn?: SplitOpen;
@ -165,7 +161,6 @@ export function TraceView(props: Props) {
updateViewRangeTime={updateViewRangeTime}
/>
<TraceTimelineViewer
registerAccessors={noop}
findMatchesIDs={spanFilterMatches}
trace={traceProp}
datasourceType={datasourceType}

View File

@ -37,7 +37,6 @@ let props = {
detailTagsToggle: jest.fn(),
detailToggle: jest.fn(),
findMatchesIDs: null,
registerAccessors: jest.fn(),
setSpanNameColumnWidth: jest.fn(),
spanNameColumnWidth: 0.5,
trace,

View File

@ -22,7 +22,6 @@ import { GrafanaTheme2, LinkModel, TimeZone } from '@grafana/data';
import { config, reportInteraction } from '@grafana/runtime';
import { stylesFactory, withTheme2, ToolbarButton } from '@grafana/ui';
import { Accessors } from '../ScrollManager';
import { PEER_SERVICE } from '../constants/tag-keys';
import { SpanBarOptions, SpanLinkFunc, TNil } from '../types';
import TTraceTimeline from '../types/TTraceTimeline';
@ -83,7 +82,6 @@ type TVirtualizedTraceViewOwnProps = {
currentViewRangeTime: [number, number];
timeZone: TimeZone;
findMatchesIDs: Set<string> | TNil;
registerAccessors: (accesors: Accessors) => void;
trace: Trace;
spanBarOptions: SpanBarOptions | undefined;
linksGetter: (span: TraceSpan, items: TraceKeyValuePair[], itemIndex: number) => TraceLink[];
@ -219,17 +217,7 @@ export class UnthemedVirtualizedTraceView extends React.Component<VirtualizedTra
}
componentDidUpdate(prevProps: Readonly<VirtualizedTraceViewProps>) {
const { registerAccessors } = prevProps;
const {
registerAccessors: nextRegisterAccessors,
headerHeight,
focusedSpanId,
focusedSpanIdForSearch,
} = this.props;
if (this.listView && registerAccessors !== nextRegisterAccessors) {
nextRegisterAccessors(this.getAccessors());
}
const { headerHeight, focusedSpanId, focusedSpanIdForSearch } = this.props;
if (!this.hasScrolledToSpan) {
this.scrollToSpan(headerHeight, focusedSpanId);
@ -305,11 +293,7 @@ export class UnthemedVirtualizedTraceView extends React.Component<VirtualizedTra
};
setListView = (listView: ListView | TNil) => {
const isChanged = this.listView !== listView;
this.listView = listView;
if (listView && isChanged) {
this.props.registerAccessors(this.getAccessors());
}
};
// use long form syntax to avert flow error

View File

@ -49,7 +49,6 @@ describe('<TraceTimelineViewer>', () => {
expandAll: jest.fn(),
collapseAll: jest.fn(),
expandOne: jest.fn(),
registerAccessors: jest.fn(),
collapseOne: jest.fn(),
theme: createTheme(),
history: {

View File

@ -19,7 +19,6 @@ import { GrafanaTheme2, LinkModel, TimeZone } from '@grafana/data';
import { config, reportInteraction } from '@grafana/runtime';
import { stylesFactory, withTheme2 } from '@grafana/ui';
import { Accessors } from '../ScrollManager';
import { autoColor } from '../Theme';
import { merge as mergeShortcuts } from '../keyboard-shortcuts';
import { SpanBarOptions } from '../settings/SpanBarSettings';
@ -68,7 +67,6 @@ const getStyles = stylesFactory((theme: GrafanaTheme2) => {
});
export type TProps = {
registerAccessors: (accessors: Accessors) => void;
findMatchesIDs: Set<string> | TNil;
traceTimeline: TTraceTimeline;
trace: Trace;