Skip to content

Commit 85f32f5

Browse files
committed
Add bug labels to top exceptions table.
1 parent fbd2abb commit 85f32f5

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/exceptions-table/exceptions-table.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,13 @@ export class ExceptionsTable extends LitElement {
115115
}
116116
}
117117

118-
private getBugMetaForEntry(entry: ExceptionListEntry) {
119-
return entry.bugIds.map((id) => this.bugMeta[id]).filter((meta) => meta != null);
120-
}
121-
122118
private renderTable() {
123119
return html`
124120
<div class="table-container">
125121
<table>
126122
<thead>
127123
<tr>
128-
<th>Bugs</th>
124+
<th class="compact-col">Bugs</th>
129125
<th class="${this.hasGlobalRules ? "" : "hidden-col"}">Top Site</th>
130126
<th>Resource</th>
131127
<th>Classifier Features</th>
@@ -138,7 +134,11 @@ export class ExceptionsTable extends LitElement {
138134
(entry) => html`
139135
<tr id=${entry.id ?? ""}>
140136
<td>
141-
<bug-label .bugMeta=${this.getBugMetaForEntry(entry)}></bug-label>
137+
<bug-label
138+
.bugMeta=${entry.bugIds
139+
.map((id) => this.bugMeta[id])
140+
.filter((meta) => meta != null)}
141+
></bug-label>
142142
</td>
143143
<td class="${this.hasGlobalRules ? "" : "hidden-col"}">
144144
${renderUrlPattern(entry.topLevelUrlPattern)}

src/exceptions-table/top-exceptions-table.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import "../bug-label";
1010
import "./exception-dialog";
1111
import { ExceptionDialog } from "./exception-dialog";
1212
import tableStyles from "./table-styles.css.ts";
13-
import { getHostFromUrlPattern } from "./utils.ts";
13+
import { getHostFromUrlPattern, getBugMetaForEntry } from "./utils.ts";
1414

1515
interface TopResource {
1616
host: string;
@@ -99,6 +99,7 @@ export class TopExceptionsTable extends LitElement {
9999
<table>
100100
<thead>
101101
<tr>
102+
<th class="compact-col">Bugs</th>
102103
<th class="compact-col"># Sites</th>
103104
<th>Resource</th>
104105
<th>Detail</th>
@@ -108,6 +109,13 @@ export class TopExceptionsTable extends LitElement {
108109
${this.topResources.map(
109110
(topResource) => html`
110111
<tr>
112+
<td>
113+
<bug-label
114+
.bugMeta=${Array.from(topResource.bugIds)
115+
.map((id) => this.bugMeta[id])
116+
.filter((meta) => meta != null)}
117+
></bug-label>
118+
</td>
111119
<td class="compact-col">${topResource.topLevelSites.size}</td>
112120
<td>${topResource.host}</td>
113121
<td>

0 commit comments

Comments
 (0)