Skip to content

Commit

Permalink
ui: Profile info section fixed (#4629)
Browse files Browse the repository at this point in the history
* Profile info fixed

* Removed the query from description

* Fix to how the description is handled at the UI
  • Loading branch information
manojVivek committed May 15, 2024
1 parent e66b29f commit 6287940
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions ui/packages/shared/profile/src/ProfileSource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ export class ProfileDiffSource implements ProfileSource {
}

toString(): string {
const aDesc = this.a.toString();
const bDesc = this.b.toString();

if (aDesc === bDesc) {
return 'profile comparison';
}

return `${this.a.toString()} compared with ${this.b.toString()}`;
}
}
Expand Down Expand Up @@ -240,10 +247,20 @@ export class MergedProfileSource implements ProfileSource {
}

toString(timezone?: string): string {
return `merged profiles of query "${this.query.toString()}" from ${formatDate(
this.mergeFrom,
timeFormat(timezone),
timezone
)} to ${formatDate(this.mergeTo, timeFormat(timezone), timezone)}`;
let queryPart = '';
if (this.query.toString()?.length > 0) {
queryPart = ` of query "${this.query.toString()}"`;
}

let timePart = '';
if (this.mergeFrom !== 0) {
timePart = ` from ${formatDate(
this.mergeFrom,
timeFormat(timezone),
timezone
)} to ${formatDate(this.mergeTo, timeFormat(timezone), timezone)}`;
}

return `merged profiles${queryPart}${timePart}`;
}
}

0 comments on commit 6287940

Please sign in to comment.