fix(report): move fix version column next to current version in HTML findings table (#388)#392
Merged
Conversation
Contributor
Author
|
@sonukapoor please review the pr |
Collaborator
|
Thanks for picking this up — the column reorder and the Two things to address before we can merge:
Once those are done this is good to go. |
33b210e to
ef538eb
Compare
Contributor
Author
|
@sonukapoor Done! Rebased and amended the commit. when you have free time please review it. |
Collaborator
|
Clean — JSON file removed, tests passing. Merging. Thanks for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, these two columns were far apart, making it difficult for users to quickly compare the before/after version changes at a glance.
Proposed Column Order 🛠️
| Package | Fix available | Severity | Type | CVE / Advisory | (Previously, Fix available was located at the end of the table).
Key Changes & Approach 💻
HTML Structure Update (src/output/html-reporter.ts):
Shifted the Fix available header inside to be right next to the Package header.
Reordered the cells inside renderFindingRow() to align with the new header sequence, rendering ${fixHtml} immediately after the Package/Version cell.
Ensured that ⚠ Malicious and ⚠ No fix badges continue to render correctly inside the reordered cell.
Sorting Logic Sync (src/output/html-reporter.ts):
Since the column indices changed, the sorting indicator class updates inside the sortBy() JavaScript function were out of sync.
Updated the colIndex lookup array mapping to align with the new column layout:
javascript
const colIndex = ['', 'package', '', 'severity', 'relationship'].indexOf(col);
This fixes the sorting headers highlights and arrows, making sure that clicking headers correctly targets the active sorted column.