Skip to content

Commit

Permalink
static/frontend/vuln: add withdrawn chip for vulns
Browse files Browse the repository at this point in the history
Adds a gray chip and a strikethrough to withdrawn vulns
so they are more recognizable.

Change-Id: I632a7606b4a4b107a05e3c8b73b7978831d2efbf
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/580195
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Damien Neil <[email protected]>
Run-TryBot: Tatiana Bradley <[email protected]>
kokoro-CI: kokoro <[email protected]>
  • Loading branch information
tatianab committed Apr 23, 2024
1 parent ddbbf7b commit 039f943
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 16 deletions.
5 changes: 4 additions & 1 deletion static/frontend/vuln/entry/entry.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
</li>
</ol>
</nav>
<h1 class="Vuln-title">Vulnerability Report: {{.Entry.ID}}</h1>
<div class="Vuln-header">
<h1 class="Vuln-title">Vulnerability Report: {{.Entry.ID}}</h1>
{{template "vuln-chips" .Entry}}
</div>
{{template "vuln-details" .Entry}}
{{$numAdvs := subtract (len .AdvisoryLinks) 1}}
{{with .AdvisoryLinks}}
Expand Down
7 changes: 7 additions & 0 deletions static/frontend/vuln/list/list.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
display: none;
}

.VulnList-header {
align-items: center;
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}

.VulnList-title {
font-size: 1.25rem;
font-weight: 400;
Expand Down
2 changes: 1 addition & 1 deletion static/frontend/vuln/list/list.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions static/frontend/vuln/list/list.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions static/frontend/vuln/list/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@
<p>No reports found. <a href="/vuln/list">View all reports.</a></p>
{{else}}
{{range .Entries}}
<h2 class="VulnList-title">
<a href="/vuln/{{.ID}}">{{.ID}}</a>
</h2>
<div class="VulnList-header">
<h2 class="VulnList-title{{if .Withdrawn}} Vuln-titleWithdrawn{{end}}" >
<a href="/vuln/{{.ID}}">{{.ID}}</a>
</h2>
{{template "vuln-chips" .}}
</div>
<div class="VulnList-details">
{{template "vuln-details" .}}
</div>
Expand Down
7 changes: 7 additions & 0 deletions static/frontend/vuln/main/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
.VulnMain-title {
font-size: 1.25rem;
font-weight: 400;
}

.VulnMain-header {
align-items: center;
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin: 0 0 0.5rem;
}

Expand Down
2 changes: 1 addition & 1 deletion static/frontend/vuln/main/main.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions static/frontend/vuln/main/main.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions static/frontend/vuln/main/main.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@
<h2>Recent Reports</h2>
<div class="VulnMain-recent">
{{range .Entries}}
<h3 class="VulnMain-title">
<a href="/vuln/{{.ID}}">{{.ID}}</a>
</h3>
<div class="VulnMain-header">
<h3 class="VulnMain-title{{if .Withdrawn}} Vuln-titleWithdrawn{{end}}">
<a href="/vuln/{{.ID}}">{{.ID}}</a>
</h3>
{{template "vuln-chips" .}}
</div>
<div class="VulnMain-details">
{{template "vuln-details" .}}
</div>
Expand Down
15 changes: 15 additions & 0 deletions static/frontend/vuln/vuln.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@
margin-bottom: 1rem;
}

.Vuln-titleWithdrawn {
text-decoration: line-through;
}

.Vuln-header {
align-items: center;
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}

.Vuln-header span {
margin-bottom: 1rem;
}

.Vuln-details {
display: flex;
flex-direction: column;
Expand Down
2 changes: 1 addition & 1 deletion static/frontend/vuln/vuln.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions static/frontend/vuln/vuln.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions static/frontend/vuln/vuln.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@
<button class="go-Button">Submit</button>
</form>
{{end}}

{{define "vuln-chips"}}
{{if .Withdrawn}}
<span class="go-Chip go-Chip--subtle">withdrawn</span>
{{end}}
{{end}}
Binary file modified tests/screentest/testdata/ci/vuln-540x1080.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/screentest/testdata/ci/vuln-entry-withdrawn-540x1080.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/screentest/testdata/ci/vuln-entry-withdrawn.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/screentest/testdata/ci/vuln-list-540x1080.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/screentest/testdata/ci/vuln-list.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/screentest/testdata/ci/vuln.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 039f943

Please sign in to comment.