feat: add "Created on" column to SBOMs by package tab (#583)#982
Open
rkdfx wants to merge 1 commit intoguacsec:mainfrom
Open
feat: add "Created on" column to SBOMs by package tab (#583)#982rkdfx wants to merge 1 commit intoguacsec:mainfrom
rkdfx wants to merge 1 commit intoguacsec:mainfrom
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a sortable "Created on" (published) column to the SBOMs-by-package table, wiring it through the table controls and rendering a formatted date, while slightly adjusting column widths to accommodate the new column. Sequence diagram for sorting SBOMs by Created on in SbomsByPackagesequenceDiagram
actor User
participant SbomsByPackage
participant TableControls
participant SbomQuery as useFetchSbomsByPackageId
User->>SbomsByPackage: Load package_details_page_with_purl
SbomsByPackage->>TableControls: useControlledTableParams(columns, sortableColumns[name,published])
TableControls-->>SbomsByPackage: tableControlState_with_hubSortFieldKeys(name,published)
SbomsByPackage->>SbomQuery: useFetchSbomsByPackageId(purl, sortField, sortDirection)
SbomQuery-->>SbomsByPackage: sboms_list_with_published
loop Render table
SbomsByPackage->>SbomsByPackage: formatDate(published) for each_row
SbomsByPackage-->>User: Render table_with_created_on_column
end
User->>SbomsByPackage: Click_created_on_column_header
SbomsByPackage->>TableControls: updateSort(columnKey=published)
TableControls-->>SbomsByPackage: updated_tableControlState(sortField=published)
SbomsByPackage->>SbomQuery: refetch_sboms(sortField=published)
SbomQuery-->>SbomsByPackage: sorted_sboms_by_published
SbomsByPackage-->>User: Re_render_table_sorted_by_created_on
Class diagram for SbomsByPackage component with Created on columnclassDiagram
class SbomsByPackage {
+string purl
+SbomsByPackage(props)
-columns: object
-sortableColumns: string[]
-filterCategories: object[]
-tableControlState: object
-items: SbomItem[]
}
class SbomItem {
+string id
+string name
+string[] suppliers
+DescribedByItem[] described_by
+string published
}
class DescribedByItem {
+string version
}
class useControlledTableParams {
+useControlledTableParams(columns, isPaginationEnabled, isSortEnabled, sortableColumns, isFilterEnabled, filterCategories)
}
class useTableControlProps {
+useTableControlProps(tableControlState, hubSortFieldKeys)
}
class useFetchSbomsByPackageId {
+useFetchSbomsByPackageId(purl, sortField, sortDirection)
}
class formatDate {
+formatDate(dateString)
}
SbomsByPackage --> useControlledTableParams : uses
SbomsByPackage --> useTableControlProps : uses
SbomsByPackage --> useFetchSbomsByPackageId : uses
SbomsByPackage --> formatDate : formats_published
SbomsByPackage --> SbomItem : renders
SbomItem --> DescribedByItem : contains
class HubSortFieldKeys {
+string name
+string published
}
SbomsByPackage --> HubSortFieldKeys : configures_sort_fields
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- When rendering the new
publishedcolumn, consider defensively handling missing or invaliditem.publishedvalues (e.g., null/undefined or unexpected formats) before passing them toformatDateto avoid runtime errors or inconsistent display.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- When rendering the new `published` column, consider defensively handling missing or invalid `item.published` values (e.g., null/undefined or unexpected formats) before passing them to `formatDate` to avoid runtime errors or inconsistent display.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #982 +/- ##
==========================================
+ Coverage 66.79% 66.82% +0.02%
==========================================
Files 221 221
Lines 3882 3882
Branches 898 898
==========================================
+ Hits 2593 2594 +1
+ Misses 949 946 -3
- Partials 340 342 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ee69a18 to
afa62a5
Compare
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.
Adds the "Created on" column to the "SBOMs using package" tab on the package detail page, matching the main SBOM list. Uses the existing
publishedfield with sortable column support.Closes #583
Summary by Sourcery
Add a created-on date column to the SBOMs-by-package table on the package detail page, aligning it with the main SBOM list and enabling sorting by this field.
New Features: