-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vulnz report facelift #145
Conversation
…ings and update related components
…erability details
… components Co-authored-by: Andreas Nordahl <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates several utility and test files to improve the vulnerability reporting and image parsing functionality while aligning menu item behavior with the new admin flag. Key changes include:
- Adding a new test for getImageDisplayName and relocating its implementation into src/lib/utils/image.ts.
- Enhancing the severityToColor function to support text-specific color schemes and updating menuItems to incorporate the isAdmin flag.
- Removing legacy admin page code and cleaning up the associated file.
Reviewed Changes
Copilot reviewed 21 out of 33 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/lib/utils/image.test.ts | Added tests for the getImageDisplayName utility function |
src/lib/components/image/imageUtils.ts | Extended detailsUrl to handle UBUNTU-based vulnerability IDs |
src/lib/utils/vulnerabilities.ts | Modified severityToColor with an optional isText parameter |
src/lib/menuItems.test.ts | Updated tests for menuItems to include the new isAdmin parameter |
src/lib/utils/image.ts | Adjusted parseImage to handle undefined images and relocated getImageDisplayName |
src/lib/menuItems.ts | Integrated isAdmin into the menuItems logic |
src/routes/admin/+page.ts | Removed legacy commented-out admin page code |
Files not reviewed (12)
- src/lib/components/Image.svelte: Language not supported
- src/lib/components/VulnerabilityBadges.svelte: Language not supported
- src/lib/components/WorkloadDeploy.svelte: Language not supported
- src/lib/components/WorkloadVulnerabilitySummary.svelte: Language not supported
- src/lib/components/errors/ErrorMessage.svelte: Language not supported
- src/lib/components/errors/RiskScore.stories.svelte: Language not supported
- src/lib/components/image/ImageVulnerabilities.svelte: Language not supported
- src/lib/components/image/ImageWorkloadReferences.svelte: Language not supported
- src/lib/components/image/TrailFinding.svelte: Language not supported
- src/routes/dataproduct/image/+page.gql: Language not supported
- src/routes/team/[team]/+layout.svelte: Language not supported
- src/routes/team/[team]/+page.svelte: Language not supported
Comments suppressed due to low confidence (1)
src/routes/admin/+page.ts:1
- The entire file is commented out; if it is no longer needed, consider removing it entirely to keep the codebase clean.
// TODO: Denne trengs vel ikke lenger? Kommenterer ut for å få npm run check ok.
export const parseImage = (image?: string) => { | ||
if (!image) { | ||
return {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function parseImage now accepts an optional image parameter but returns an empty object if undefined. Consider defining an explicit return type or error handling for clarity and better type safety.
export const parseImage = (image?: string) => { | |
if (!image) { | |
return {}; | |
interface ParsedImage { | |
registry: string; | |
repository: string; | |
name: string; | |
tag?: string; | |
} | |
export const parseImage = (image?: string): ParsedImage => { | |
if (!image) { | |
throw new Error('Image parameter is undefined'); |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
…p and adjusting button visibility
…ust usage in components
No description provided.