mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 21:19:28 -06:00
parent
7f2841aeca
commit
3a90e2d13c
@ -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}
|
||||
|
@ -37,7 +37,6 @@ let props = {
|
||||
detailTagsToggle: jest.fn(),
|
||||
detailToggle: jest.fn(),
|
||||
findMatchesIDs: null,
|
||||
registerAccessors: jest.fn(),
|
||||
setSpanNameColumnWidth: jest.fn(),
|
||||
spanNameColumnWidth: 0.5,
|
||||
trace,
|
||||
|
@ -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
|
||||
|
@ -49,7 +49,6 @@ describe('<TraceTimelineViewer>', () => {
|
||||
expandAll: jest.fn(),
|
||||
collapseAll: jest.fn(),
|
||||
expandOne: jest.fn(),
|
||||
registerAccessors: jest.fn(),
|
||||
collapseOne: jest.fn(),
|
||||
theme: createTheme(),
|
||||
history: {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user