Skip to content

Commit 9d6f8e8

Browse files
committed
fix: Add styling to the Snyk Language Server html
1 parent 99c2cc4 commit 9d6f8e8

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

plugin/src/main/java/io/snyk/eclipse/plugin/html/StaticPageHtmlProvider.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ public String getSummaryInitHtml() {
156156
<body>
157157
<div class="container">
158158
<h3 class="summary-header">SUMMARY</h3>
159-
<button type="button" onclick="window.showAllIssuesTab()">All issues</button>
160-
<button type="button" onclick="window.showDeltaIssuesTab()">Delta issues</button>
159+
<button type="button" onclick="window.showAllIssuesTab()">All issues</button>
160+
<button type="button" onclick="window.showDeltaIssuesTab()">Delta issues</button>
161161
<div class="summary-row">
162162
<span class="icon">⚠️</span>
163163
<span class="text">312 issues found in your project</span>
@@ -170,9 +170,17 @@ public String getSummaryInitHtml() {
170170
</div>
171171
</body>
172172
</html>
173+
""".formatted(head);
174+
return replaceCssVariables(html);
175+
}
173176
"""
174177
.formatted(head);
175178
return replaceCssVariables(html);
176179
}
177180

181+
public String getFormattedSummaryHtml(String summary) {
182+
var html = summary
183+
.formatted(head);
184+
return replaceCssVariables(html);
185+
}
178186
}

plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/SummaryBrowserHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void setDefaultBrowserText() {
6464
}
6565

6666
public void setBrowserText(String summary) {
67-
browser.setText(summary);
67+
browser.setText(StaticPageHtmlProvider.getInstance().getFormattedSummaryHtml(summary));
6868
}
6969

7070
}

0 commit comments

Comments
 (0)