[8.x] [Cloud Security] Adjust posture type filters from dashboard (#195241) (#195356)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Cloud Security] Adjust posture type filters from dashboard
(#195241)](https://github.com/elastic/kibana/pull/195241)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Jordan","email":"51442161+JordanSh@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-08T08:06:40Z","message":"[Cloud
Security] Adjust posture type filters from dashboard
(#195241)","sha":"b5bc989442fd1ada37914f6f1071b9aabaa73b4c","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Cloud
Security","backport:prev-minor"],"title":"[Cloud Security] Adjust
posture type filters from
dashboard","number":195241,"url":"https://github.com/elastic/kibana/pull/195241","mergeCommit":{"message":"[Cloud
Security] Adjust posture type filters from dashboard
(#195241)","sha":"b5bc989442fd1ada37914f6f1071b9aabaa73b4c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195241","number":195241,"mergeCommit":{"message":"[Cloud
Security] Adjust posture type filters from dashboard
(#195241)","sha":"b5bc989442fd1ada37914f6f1071b9aabaa73b4c"}}]}]
BACKPORT-->

Co-authored-by: Jordan <51442161+JordanSh@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2024-10-08 21:02:15 +11:00 committed by GitHub
parent eb09d4c218
commit 8c11543663
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -40,13 +40,9 @@ export const dashboardColumnsGrow: Record<string, EuiFlexItemProps['grow']> = {
third: 8,
};
export const getPolicyTemplateQuery = (policyTemplate: PosturePolicyTemplate): NavFilter => {
if (policyTemplate === CSPM_POLICY_TEMPLATE) {
return { 'rule.benchmark.posture_type': CSPM_POLICY_TEMPLATE };
}
return { 'rule.benchmark.posture_type': { value: CSPM_POLICY_TEMPLATE, negate: true } };
};
export const getPolicyTemplateQuery = (policyTemplate: PosturePolicyTemplate): NavFilter => ({
'rule.benchmark.posture_type': policyTemplate,
});
export const SummarySection = ({
dashboardType,