Skip to content

Commit d8239ef

Browse files
committed
fix(ui): add minimum width to advisory column
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent 64c8339 commit d8239ef

2 files changed

Lines changed: 35 additions & 32 deletions

File tree

vulnerabilities/templates/severity_curation.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
{% block extrahead %}
66
<style>
7-
.state-undefined {
8-
background-color: #f5f5f5 !important;
9-
color: #7a7a7a !important;
10-
font-style: italic;
11-
}
12-
137
.table {
148
table-layout: fixed !important;
159
width: 100% !important;
@@ -36,15 +30,21 @@
3630
}
3731

3832
#table-header th:first-child {
39-
width: 260px !important;
33+
width: 300px !important;
4034
}
35+
4136
#table-header th:nth-child(2) {
42-
width: 240px !important;
37+
width: 230px !important;
38+
}
39+
40+
#table-header th:nth-child(n+3) {
41+
width: 160px !important;
4342
}
4443

4544
.metric-category-row {
4645
background-color: #eef6fc !important;
4746
color: #1d72b8;
47+
font-weight: 600;
4848
}
4949

5050
.curation-select-container {
@@ -65,10 +65,7 @@
6565
}
6666

6767
.vector-data-cell {
68-
background-color: #fafafa;
69-
padding: 8px !important;
7068
vertical-align: middle !important;
71-
border: 1px solid #dbdbdb !important;
7269
word-break: break-all !important;
7370
}
7471

@@ -79,7 +76,13 @@
7976

8077
.immutable-advisory-cell {
8178
vertical-align: middle !important;
82-
background-color: #ffffff;
79+
cursor: not-allowed;
80+
}
81+
82+
.state-undefined {
83+
background-color: #f5f5f5 !important;
84+
color: #7a7a7a !important;
85+
font-style: italic;
8386
}
8487

8588
#summaries-container p strong {

vulnerablecode/static/js/severity_curation.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ const app = {
243243
const vectorDataRow = document.createElement('tr');
244244
let rowHtml = `
245245
<td></td>
246-
<td class="vector-data-cell is-size-6 has-text-centered ">
246+
<td class="vector-data-cell is-size-6 has-text-centered py-4">
247247
${this.generateCalculatedVectorString(item)}
248248
</td>
249249
`;
@@ -252,11 +252,11 @@ const app = {
252252
const colKey = `${this.currentIndex}-col-${groupIdx}`;
253253
const isExpanded = this.expandedFolds.has(colKey);
254254

255-
rowHtml += `<td class="vector-data-cell is-size-6 has-text-centered ">${advGroup.primary.vector_string || 'NA'}</td>`;
255+
rowHtml += `<td class="vector-data-cell is-size-6 has-text-centered py-4 ">${advGroup.primary.vector_string || 'NA'}</td>`;
256256

257257
if (isExpanded && advGroup.secondaries) {
258258
advGroup.secondaries.forEach(sec => {
259-
rowHtml += `<td class="vector-data-cell is-size-6 has-text-centered" style="background-color: #fafafa;">${sec.vector_string || 'NA'}</td>`;
259+
rowHtml += `<td class="vector-data-cell is-size-6 has-text-centered py-4" style="background-color: #fafafa;">${sec.vector_string || 'NA'}</td>`;
260260
});
261261
}
262262
});
@@ -380,27 +380,27 @@ const app = {
380380
this.renderBody(item);
381381
},
382382

383-
pickAdvisory(groupIdx, type, secIdx = null) {
384-
const item = curationItems[this.currentIndex];
385-
let targetAdvisory;
383+
pickAdvisory(groupIdx, type, secIdx = null) {
384+
const item = curationItems[this.currentIndex];
385+
let targetAdvisory;
386386

387-
if (type === 'primary') {
388-
targetAdvisory = item.advisories[groupIdx].primary.vector;
389-
} else if (type === 'secondary') {
390-
targetAdvisory = item.advisories[groupIdx].secondaries[secIdx].vector;
391-
}
387+
if (type === 'primary') {
388+
targetAdvisory = item.advisories[groupIdx].primary.vector;
389+
} else if (type === 'secondary') {
390+
targetAdvisory = item.advisories[groupIdx].secondaries[secIdx].vector;
391+
}
392392

393-
for (const [cat, metrics] of Object.entries(cvss_mapping[item.cvss])) {
394-
for (const metricKey of Object.keys(metrics)) {
395-
if (targetAdvisory[metricKey] !== undefined && targetAdvisory[metricKey] !== '') {
396-
this.userStates[this.currentIndex][metricKey] = String(targetAdvisory[metricKey]);
397-
} else {
398-
this.userStates[this.currentIndex][metricKey] = '';
393+
for (const [cat, metrics] of Object.entries(cvss_mapping[item.cvss])) {
394+
for (const metricKey of Object.keys(metrics)) {
395+
if (targetAdvisory[metricKey] !== undefined && targetAdvisory[metricKey] !== '') {
396+
this.userStates[this.currentIndex][metricKey] = String(targetAdvisory[metricKey]);
397+
} else {
398+
this.userStates[this.currentIndex][metricKey] = '';
399+
}
399400
}
400401
}
401-
}
402-
this.renderBody(item);
403-
},
402+
this.renderBody(item);
403+
},
404404

405405
resetCurrentCuration() {
406406
const item = curationItems[this.currentIndex];

0 commit comments

Comments
 (0)