Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#9380] Add line-number and location info on call-tree #9605

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -109,12 +109,12 @@ export class CallTreeContainerComponent implements OnInit, OnDestroy {
});
}

onCellDoubleClicked(contents: string): void {
onCellDoubleClicked({type, contents}: {type: string, contents: string}): void {
this.dynamicPopupService.openPopup({
data: {
title: 'Contents',
contents,
type: 'plain'
type
},
component: MessagePopupContainerComponent
}, {
Original file line number Diff line number Diff line change
@@ -24,6 +24,8 @@ export interface IGridData {
methodType: string;
hasException: boolean;
isAuthorized: boolean;
lineNumber: number;
location: string;
folder?: boolean;
open?: boolean;
children?: any[];
@@ -54,7 +56,7 @@ export class CallTreeComponent implements OnInit, OnChanges, AfterViewInit {
@Input() dateFormat: string;
@Output() outSelectFormatting = new EventEmitter<any>();
@Output() outRowSelected = new EventEmitter<IGridData>();
@Output() outCellDoubleClicked = new EventEmitter<string>();
@Output() outCellDoubleClicked = new EventEmitter<{type: string, contents: string}>();

private originalData: ITransactionDetailData;
private ratio: number;
@@ -408,7 +410,36 @@ export class CallTreeComponent implements OnInit, OnChanges, AfterViewInit {
}

onCellDoubleClicked(params: any): void {
this.outCellDoubleClicked.emit(params.data[params.colDef.field]);
const field = params.colDef.field;
let contents = params.data[field];
let type = 'plain';

if (!contents) {
return;
}

switch (field) {
case 'method':
const location = params.data.location;
const lineNumber = params.data.lineNumber;
const metaInfo = lineNumber ? `${location}:${lineNumber}` : '';

type = 'html';
contents = `${contents} <span style="text-decoration:underline !important; color:var(--text-secondary); font-size:12px; margin-left:3px;">${metaInfo}</span>`;

break;
case 'startTime':
contents = moment(params.value).tz(this.timezone).format(this.dateFormat);

break;
default:
break;
}

this.outCellDoubleClicked.emit({
type,
contents
});
}

onGridSizeChanged(_: GridOptions): void {
@@ -493,6 +524,9 @@ export class CallTreeComponent implements OnInit, OnChanges, AfterViewInit {
oRow['methodType'] = callTree[oIndex.methodType];
oRow['hasException'] = callTree[oIndex.hasException];
oRow['isAuthorized'] = callTree[oIndex.isAuthorized];
oRow['lineNumber'] = callTree[oIndex.lineNumber];
oRow['location'] = callTree[oIndex.location];

if (callTree[oIndex.hasChild]) {
oRow['folder'] = true;
oRow['open'] = true;