Skip to content

Commit

Permalink
[Cloud Security] address pr nit comments (#172853)
Browse files Browse the repository at this point in the history
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.
Address nit comments from [Compliance Dashboard UI/API
PR](#171312)
  • Loading branch information
Omolola-Akinleye authored Dec 13, 2023
1 parent 5085d23 commit 86bdae2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions x-pack/plugins/cloud_security_posture/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export const RULE_FAILED = `failed`;

export const POSTURE_TYPE_ALL = 'all';

export const CSPM_FINDINGS_STATS_INTERVAL = 5;

// A mapping of in-development features to their status. These features should be hidden from users but can be easily
// activated via a simple code change in a single location.
export const INTERNAL_FEATURE_FLAGS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const CompactPercentageLabels = ({
</>
);

const NonCompactPercentageLabels = ({
const PercentageLabels = ({
onEvalCounterClick,
stats,
}: {
Expand Down Expand Up @@ -301,7 +301,7 @@ export const ComplianceScoreChart = ({
onEvalCounterClick={onEvalCounterClick}
/>
) : (
<NonCompactPercentageLabels
<PercentageLabels
stats={{ totalPassed: data.totalPassed, totalFailed: data.totalFailed }}
onEvalCounterClick={onEvalCounterClick}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

import { ElasticsearchClient, Logger } from '@kbn/core/server';
import { calculatePostureScore } from '../../../common/utils/helpers';
import { BENCHMARK_SCORE_INDEX_DEFAULT_NS } from '../../../common/constants';
import {
BENCHMARK_SCORE_INDEX_DEFAULT_NS,
CSPM_FINDINGS_STATS_INTERVAL,
} from '../../../common/constants';
import type { PosturePolicyTemplate, Stats } from '../../../common/types_old';
import { toBenchmarkDocFieldKey } from '../../lib/mapping_field_util';
import { CSPM_FINDINGS_STATS_INTERVAL } from '../../tasks/findings_stats_task';

interface FindingsDetails {
total_findings: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { getIdentifierRuntimeMapping } from '../../common/runtime_mappings/get_i
import { FindingsStatsTaskResult, ScoreByPolicyTemplateBucket, VulnSeverityAggs } from './types';
import {
BENCHMARK_SCORE_INDEX_DEFAULT_NS,
CSPM_FINDINGS_STATS_INTERVAL,
LATEST_FINDINGS_INDEX_DEFAULT_NS,
LATEST_VULNERABILITIES_INDEX_DEFAULT_NS,
VULNERABILITIES_SEVERITY,
Expand All @@ -36,7 +37,6 @@ import { toBenchmarkMappingFieldKey } from '../lib/mapping_field_util';

const CSPM_FINDINGS_STATS_TASK_ID = 'cloud_security_posture-findings_stats';
const CSPM_FINDINGS_STATS_TASK_TYPE = 'cloud_security_posture-stats_task';
export const CSPM_FINDINGS_STATS_INTERVAL = 5;

export async function scheduleFindingsStatsTask(
taskManager: TaskManagerStartContract,
Expand Down

0 comments on commit 86bdae2

Please sign in to comment.