Skip to content

Commit

Permalink
fix installed clusters policy chart bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jsladerman committed May 16, 2024
1 parent 06ffb57 commit 1c7f8f6
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions assets/src/components/policies/usePolicyChartsData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function usePolicyChartsData(filters: {
: [
{
id: 'violations',
label: 'WITH VIOLATIONS',
label: 'with violations',
color: theme.colors.semanticRedLight,
value:
clusterPolicyStats?.policyStatistics?.find(
Expand All @@ -54,7 +54,7 @@ export function usePolicyChartsData(filters: {
},
{
id: 'no-violations',
label: 'WITHOUT',
label: 'without',
color: theme.colors.semanticGreen,
value:
clusterPolicyStats?.policyStatistics?.find(
Expand All @@ -76,7 +76,7 @@ export function usePolicyChartsData(filters: {
: [
{
id: 'dryrun',
label: 'DRYRUN',
label: 'dryrun',
color: theme.colors.semanticGreen,
value:
enforcementStats?.policyStatistics?.find(
Expand All @@ -85,7 +85,7 @@ export function usePolicyChartsData(filters: {
},
{
id: 'deny',
label: 'DENY',
label: 'deny',
color: theme.colors.semanticRedLight,
value:
enforcementStats?.policyStatistics?.find(
Expand All @@ -94,7 +94,7 @@ export function usePolicyChartsData(filters: {
},
{
id: 'warn',
label: 'WARN',
label: 'warn',
color: theme.colors.semanticYellow,
value:
enforcementStats?.policyStatistics?.find(
Expand All @@ -116,25 +116,24 @@ export function usePolicyChartsData(filters: {
: [
{
id: 'uninstalled',
label: 'UNINSTALLED',
label: 'uninstalled',
color: theme.colors.semanticRedLight,
value:
clusterPolicyStats?.policyStatistics?.find(
(stat) => stat?.aggregate === 'none'
installedStats?.policyStatistics.find(
(stat) => stat?.aggregate === 'uninstalled'
)?.count ?? 0,
},
{
id: 'installed',
label: 'INSTALLED',
label: 'installed',
color: theme.colors.semanticGreen,
value:
clusterPolicyStats?.policyStatistics?.find(
(stat) => stat?.aggregate === 'exists'
installedStats?.policyStatistics?.find(
(stat) => stat?.aggregate === 'installed'
)?.count ?? 0,
},
],
[
clusterPolicyStats?.policyStatistics,
installedStats?.policyStatistics,
theme.colors.semanticGreen,
theme.colors.semanticRedLight,
Expand Down

0 comments on commit 1c7f8f6

Please sign in to comment.