Skip to content

Commit

Permalink
fix: dashboard to use ingested time to fetch last sbom/advisory (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosthe19916 authored Dec 10, 2024
1 parent 4845b90 commit aaeed9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions client/src/app/pages/home/components/MonitoringSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { LoadingWrapper } from "@app/components/LoadingWrapper";
import { useVulnerabilitiesOfSboms } from "@app/hooks/domain-controls/useVulnerabilitiesOfSbom";
import { useFetchAdvisories } from "@app/queries/advisories";
import { useFetchSBOMs } from "@app/queries/sboms";
import { formatDate } from "@app/utils/utils";
import { formatDateTime } from "@app/utils/utils";

interface Legend {
severity: Severity;
Expand All @@ -62,7 +62,7 @@ export const MonitoringSection: React.FC = () => {
} = useFetchSBOMs(
{
page: { pageNumber: 1, itemsPerPage: 10 },
sort: { field: "published", direction: "desc" },
sort: { field: "ingested", direction: "desc" },
},
true
);
Expand Down Expand Up @@ -90,7 +90,7 @@ export const MonitoringSection: React.FC = () => {
} = useFetchAdvisories(
{
page: { pageNumber: 1, itemsPerPage: 10 },
sort: { field: "published", direction: "desc" },
sort: { field: "ingested", direction: "desc" },
},
true
);
Expand Down Expand Up @@ -264,7 +264,7 @@ export const MonitoringSection: React.FC = () => {
<DescriptionListDescription>
<Stack>
<StackItem>
{formatDate(barchartSboms?.[0]?.published)}
{formatDateTime(barchartSboms?.[0]?.ingested)}
</StackItem>
<StackItem>
<Link to={`/sboms/${barchartSboms?.[0]?.id}`}>
Expand Down Expand Up @@ -295,7 +295,7 @@ export const MonitoringSection: React.FC = () => {
<DescriptionListDescription>
<Stack>
<StackItem>
{formatDate(advisories?.[0]?.published)}
{formatDateTime(advisories?.[0]?.ingested)}
</StackItem>
<StackItem>{advisories?.[0]?.identifier}</StackItem>
</Stack>
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const formatDate = (value?: string | null) => {
return value ? dayjs(value).format(RENDER_DATE_FORMAT) : null;
};

export const formatDateTime = (value?: string) => {
export const formatDateTime = (value?: string | null) => {
return value ? dayjs(value).format(RENDER_DATETIME_FORMAT) : null;
};

Expand Down

0 comments on commit aaeed9a

Please sign in to comment.