Skip to content

Commit

Permalink
chore(heureka): renames Issues to Vulnerabilities tab with the defaul…
Browse files Browse the repository at this point in the history
…t filter of issueType is Vulnerability (#660)

* chore(heureka): shows only vulnerabilities from issueMatches entity

* chore(heureka): adds changeset
  • Loading branch information
hodanoori authored Dec 10, 2024
1 parent 3471a77 commit d07a3cb
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 23 deletions.
6 changes: 6 additions & 0 deletions .changeset/neat-rats-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@cloudoperators/juno-app-heureka": patch
"@cloudoperators/juno-app-greenhouse": patch
---

Add Default Vulnerability Filter to issueMatches entity and renames tab to Vulnerabilities instead of Issues
2 changes: 1 addition & 1 deletion apps/heureka/src/components/CustomAppShell.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import constants from "./shared/constants"
// Configuration for navigation items and their respective components
const VIEW_CONFIG = {
Services: { label: "Services", icon: "dns", component: ServicesView },
IssueMatches: { label: "Issues", icon: "autoAwesomeMotion", component: IssueMatchesView },
IssueMatches: { label: "Vulnerabilities", icon: "autoAwesomeMotion", component: IssueMatchesView },
Components: { label: "Images", icon: "autoAwesomeMotion", component: ComponentsView }, // Commented out to remove ComponentsView for MVP version
}

Expand Down
2 changes: 1 addition & 1 deletion apps/heureka/src/components/components/ComponentsList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const ComponentsList = ({ items, isLoading }) => {
) : (
<DataGridRow>
<DataGridCell colSpan={10}>
<HintNotFound text="No components found" />
<HintNotFound text="No images found" />
</DataGridCell>
</DataGridRow>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const IssueMatchesDetails = () => {
</DataGridRow>

<DataGridRow>
<DataGridHeadCell>Support Group Name</DataGridHeadCell>
<DataGridHeadCell>Support Group</DataGridHeadCell>

<DataGridCell>
<LoadElement elem={listOfCommaSeparatedObjs(issue?.componentInstance?.service?.supportGroups, "ccrn")} />
Expand Down Expand Up @@ -126,12 +126,6 @@ const IssueMatchesDetails = () => {
)}
</DataGridCell>
</DataGridRow>

<DataGridRow>
<DataGridHeadCell>Issue Type</DataGridHeadCell>

<DataGridCell>{<LoadElement elem={issue?.issue?.type} />}</DataGridCell>
</DataGridRow>
</DataGrid>
</Stack>
</>
Expand Down
4 changes: 2 additions & 2 deletions apps/heureka/src/components/issueMatches/IssueMatchesList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const IssueMatchesList = ({ items, isLoading }) => {
{isLoading && !items ? (
<DataGridRow>
<DataGridCell colSpan={7}>
<HintLoading className="my-4" text="Loading issue matches..." />
<HintLoading className="my-4" text="Loading vulnerabilities..." />
</DataGridCell>
</DataGridRow>
) : (
Expand All @@ -40,7 +40,7 @@ const IssueMatchesList = ({ items, isLoading }) => {
) : (
<DataGridRow>
<DataGridCell colSpan={7}>
<HintNotFound text="No issue matches found" />
<HintNotFound text="No vulnerabilities found" />
</DataGridCell>
</DataGridRow>
)}
Expand Down
7 changes: 7 additions & 0 deletions apps/heureka/src/components/issueMatches/IssueMatchesView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
useIssueMatchesFilterLabels,
useIssueMatchesFilterLabelValues,
useIssueMatchesSearchTerm,
useGlobalsActions,
} from "../StoreProvider"

const IssueMatchesView = () => {
Expand All @@ -21,6 +22,12 @@ const IssueMatchesView = () => {
const labels = useIssueMatchesFilterLabels()
const filterLabelValues = useIssueMatchesFilterLabelValues()
const searchTerm = useIssueMatchesSearchTerm()

// Access filter actions
const { setQueryOptions } = useGlobalsActions()

setQueryOptions("IssueMatches", { filter: { issueType: ["Vulnerability"] } })

return (
<>
<MessagesProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const ComponentInstancesList = ({ serviceCcrn }) => {
<DataGridRow>
<DataGridHeadCell>Name</DataGridHeadCell>
<DataGridHeadCell>Version</DataGridHeadCell>
<DataGridHeadCell>Total Number of Issues</DataGridHeadCell>
<DataGridHeadCell>Total Number of Vulnerabilities</DataGridHeadCell>
<DataGridHeadCell>Highest Severity</DataGridHeadCell>
</DataGridRow>
{isLoading ? (
Expand All @@ -56,7 +56,7 @@ const ComponentInstancesList = ({ serviceCcrn }) => {
</DataGridCell>
</DataGridRow>
) : items.length === 0 ? (
<HintNotFound text="No component instances available." />
<HintNotFound text="No pods available." />
) : (
items.map((componentInstance, i) => (
<DataGridRow key={i}>
Expand Down
8 changes: 4 additions & 4 deletions apps/heureka/src/components/services/ServicesList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ const ServicesList = ({ items, isLoading }) => {
<DataGridHeadCell>
<Stack direction="vertical">
<Tooltip triggerEvent="hover">
<TooltipTrigger>Components</TooltipTrigger>
<TooltipContent>Total Number of Component Instances</TooltipContent>
<TooltipTrigger>Pods</TooltipTrigger>
<TooltipContent>Total Number of Pods</TooltipContent>
</Tooltip>
</Stack>
</DataGridHeadCell>
<DataGridHeadCell>
<Stack direction="vertical">
<Tooltip triggerEvent="hover">
<TooltipTrigger>Issues</TooltipTrigger>
<TooltipContent>Total Number of IssueMatches</TooltipContent>
<TooltipTrigger>Vulnerabilities</TooltipTrigger>
<TooltipContent>Total Number of Vulnerabilities</TooltipContent>
</Tooltip>
</Stack>
</DataGridHeadCell>
Expand Down
5 changes: 0 additions & 5 deletions apps/heureka/src/lib/queries/issueMatchesFilterValues.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ export default () => gql`
filterName
values
}
issueType {
displayName
filterName
values
}
affectedService {
displayName
filterName
Expand Down
5 changes: 4 additions & 1 deletion apps/heureka/src/lib/slices/createGlobalsSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ const createGlobalsSlice = (set, get, options) => ({
setQueryOptions: (viewName, options) =>
set(
produce((state) => {
state.globals.views[viewName].queryOptions = options
state.globals.views[viewName].queryOptions = {
...state.globals.views[viewName].queryOptions,
...options,
}
}),
false,
"globals/setQueryOptions"
Expand Down

0 comments on commit d07a3cb

Please sign in to comment.