Skip to content

Commit a328b56

Browse files
authored
Merge pull request #97 from digma-ai/feature/fixing_ui
fixing ui for hotspot
2 parents 67cdf25 + 61a5ae7 commit a328b56

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

images/target.png

38.5 KB
Loading

src/views/codeAnalytics/InsightListView/HotspotInsight.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { IListViewItemBase } from "../../ListView/IListViewItem";
2+
import { WebViewUris } from "../../webViewUtils";
23
import { CodeObjectInfo } from "../codeAnalyticsView";
34
import { CodeObjectInsight, IInsightListViewItemsCreator } from "./IInsightListViewItemsCreator";
45

@@ -8,19 +9,26 @@ export interface HotspotInsight extends CodeObjectInsight
89
}
910
export class HotspotListViewItemsCreator implements IInsightListViewItemsCreator
1011
{
12+
constructor(
13+
private viewUris: WebViewUris
14+
15+
){
16+
17+
}
1118
public async create(scope: CodeObjectInfo, codeObjectsInsight: HotspotInsight []): Promise<IListViewItemBase []> {
1219
let result = codeObjectsInsight.filter(o=>o.score >=70)
1320
.map(o=>{
1421
const html = `
1522
<div class="list-item">
1623
<div class="list-item-content-area">
1724
<div class="list-item-header"><strong>This is an error hotspot</strong></div>
18-
<div><span class="list-item-content-description">Many major errors occur or propogate through this function. </span>
19-
<span class="link ellipsis" href="#">See how this was calculated</span></div>
25+
<div class="list-item-content-description">Major errors occur or propogate through this function. </div>
26+
</div>
27+
<div class="list-item-right-area">
28+
<img style="align-self:center;" src="${this.viewUris.image("target.png")}" width="32" height="32">
29+
<span class="insight-main-value" title="Error hostpot">Hotspot</span>
30+
</div>
2031
</div>
21-
<div class="list-item-right-area">
22-
<img style="align-self:center;" src="https://phmecloud.blob.core.windows.net/photo/web/ou0ehpjndrfhkkx1tekojx0-3.png" width="32" height="32">
23-
</div>
2432
</div>
2533
`;
2634
return {getHtml: ()=>html, sortIndex: 0, groupId: undefined};

src/views/codeAnalytics/codeAnalyticsView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class CodeAnalyticsViewProvider implements vscode.WebviewViewProvider,vscode.Dis
121121

122122

123123
const listViewItemsCreator = new InsightListViewItemsCreator();
124-
listViewItemsCreator.add("HotSpot", new HotspotListViewItemsCreator());
124+
listViewItemsCreator.add("HotSpot", new HotspotListViewItemsCreator(this._webViewUris));
125125
listViewItemsCreator.add("Errors", new ErrorsListViewItemsCreator());
126126
listViewItemsCreator.add("SpanUsages", new SpanListViewItemsCreator());
127127
listViewItemsCreator.add("SlowestSpans", new SlowestSpansListViewItemsCreator(this._webViewUris, editorHelper,_documentInfoProvider,this._channel));

0 commit comments

Comments
 (0)