From 0dd6256b03ba820a7c475a57ebba35ce927de37f Mon Sep 17 00:00:00 2001 From: AsToNlele Date: Fri, 25 Aug 2023 11:00:56 +0200 Subject: [PATCH] feat(PolicySystemsTab): RHICOMPL-3946 - Detect when user has not access to all hosts --- .../__snapshots__/PoliciesTable.test.js.snap | 26 +- .../ReportDetailsDescription.test.js.snap | 2 +- .../__snapshots__/Filters.test.js.snap | 28 +- .../__snapshots__/ReportsTable.test.js.snap | 26 +- .../PolicyDetails/PolicySystemsTab.js | 54 +- .../PolicyDetails/PolicySystemsTab.test.js | 12 + .../PolicySystemsTab.test.js.snap | 982 +++++++++++------- src/__fixtures__/policies.js | 26 +- 8 files changed, 702 insertions(+), 454 deletions(-) diff --git a/src/PresentationalComponents/PoliciesTable/__snapshots__/PoliciesTable.test.js.snap b/src/PresentationalComponents/PoliciesTable/__snapshots__/PoliciesTable.test.js.snap index d6e9dcbeac..0e29fa053f 100644 --- a/src/PresentationalComponents/PoliciesTable/__snapshots__/PoliciesTable.test.js.snap +++ b/src/PresentationalComponents/PoliciesTable/__snapshots__/PoliciesTable.test.js.snap @@ -938,7 +938,7 @@ exports[`PoliciesTable expect to render without error 1`] = ` "policyType": "United States Government Standard", "refId": "xccdf_org.ssgproject.content_profile_ospp23", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -1013,7 +1013,7 @@ exports[`PoliciesTable expect to render without error 1`] = ` "policyType": "PCI-DSS v3 Control Baseline for Red Hat Enterprise Linux 73", "refId": "xccdf_org.ssgproject.content_profile_pci-dss3", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -1039,7 +1039,7 @@ exports[`PoliciesTable expect to render without error 1`] = ` "policyType": "United States Government Configuration Baseline2", "refId": "xccdf_org.ssgproject.content_profile_ospp2", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -1065,7 +1065,7 @@ exports[`PoliciesTable expect to render without error 1`] = ` "policyType": "C2S for Red Hat Enterprise Linux 7", "refId": "xccdf_org.ssgproject.content_profile_C2S", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -1091,7 +1091,7 @@ exports[`PoliciesTable expect to render without error 1`] = ` "policyType": "Criminal Justice Information Services (CJIS) Security Policy", "refId": "xccdf_org.ssgproject.content_profile_cjis", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -1117,7 +1117,7 @@ exports[`PoliciesTable expect to render without error 1`] = ` "policyType": "Unclassified Information in Non-federal Information Systems and Organizations (NIST 800-171)", "refId": "xccdf_org.ssgproject.content_profile_nist-800-171-cui", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -1143,7 +1143,7 @@ exports[`PoliciesTable expect to render without error 1`] = ` "policyType": "PCI-DSS v3 Control Baseline for Red Hat Enterprise Linux 7", "refId": "xccdf_org.ssgproject.content_profile_pci-dss", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -1169,7 +1169,7 @@ exports[`PoliciesTable expect to render without error 1`] = ` "policyType": "Red Hat Corporate Profile for Certified Cloud Providers (RH CCP)", "refId": "xccdf_org.ssgproject.content_profile_rht-ccp", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -1195,7 +1195,7 @@ exports[`PoliciesTable expect to render without error 1`] = ` "policyType": "Health Insurance Portability and Accountability Act (HIPAA)", "refId": "xccdf_org.ssgproject.content_profile_hipaa", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -1221,7 +1221,7 @@ exports[`PoliciesTable expect to render without error 1`] = ` "policyType": "United States Government Configuration Baseline", "refId": "xccdf_org.ssgproject.content_profile_ospp", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -1247,7 +1247,7 @@ exports[`PoliciesTable expect to render without error 1`] = ` "policyType": "Standard System Security Profile for Red Hat Enterprise Linux 7", "refId": "xccdf_org.ssgproject.content_profile_standard", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -1273,7 +1273,7 @@ exports[`PoliciesTable expect to render without error 1`] = ` "policyType": "DISA STIG for Red Hat Enterprise Linux 7", "refId": "xccdf_org.ssgproject.content_profile_stig-rhel7-disa", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -1299,7 +1299,7 @@ exports[`PoliciesTable expect to render without error 1`] = ` "policyType": "PCI-DSS v3 Control Baseline for Red Hat Enterprise Linux 72", "refId": "xccdf_org.ssgproject.content_profile_pci-dss2", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, ] } diff --git a/src/PresentationalComponents/ReportDetailsDescription/__snapshots__/ReportDetailsDescription.test.js.snap b/src/PresentationalComponents/ReportDetailsDescription/__snapshots__/ReportDetailsDescription.test.js.snap index 3e3b10ad8c..191fc994e2 100644 --- a/src/PresentationalComponents/ReportDetailsDescription/__snapshots__/ReportDetailsDescription.test.js.snap +++ b/src/PresentationalComponents/ReportDetailsDescription/__snapshots__/ReportDetailsDescription.test.js.snap @@ -123,7 +123,7 @@ exports[`ReportDetailsDescription expect to render without error 1`] = ` "policyType": "United States Government Standard", "refId": "xccdf_org.ssgproject.content_profile_ospp23", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, } } /> diff --git a/src/PresentationalComponents/ReportsTable/__snapshots__/Filters.test.js.snap b/src/PresentationalComponents/ReportsTable/__snapshots__/Filters.test.js.snap index 4612754dae..e0a9305e27 100644 --- a/src/PresentationalComponents/ReportsTable/__snapshots__/Filters.test.js.snap +++ b/src/PresentationalComponents/ReportsTable/__snapshots__/Filters.test.js.snap @@ -119,7 +119,7 @@ exports[`operatingSystemFilter expect to return results 1`] = ` "policyType": "United States Government Standard", "refId": "xccdf_org.ssgproject.content_profile_ospp23", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -194,7 +194,7 @@ exports[`operatingSystemFilter expect to return results 1`] = ` "policyType": "PCI-DSS v3 Control Baseline for Red Hat Enterprise Linux 73", "refId": "xccdf_org.ssgproject.content_profile_pci-dss3", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -220,7 +220,7 @@ exports[`operatingSystemFilter expect to return results 1`] = ` "policyType": "United States Government Configuration Baseline2", "refId": "xccdf_org.ssgproject.content_profile_ospp2", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -246,7 +246,7 @@ exports[`operatingSystemFilter expect to return results 1`] = ` "policyType": "C2S for Red Hat Enterprise Linux 7", "refId": "xccdf_org.ssgproject.content_profile_C2S", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -272,7 +272,7 @@ exports[`operatingSystemFilter expect to return results 1`] = ` "policyType": "Criminal Justice Information Services (CJIS) Security Policy", "refId": "xccdf_org.ssgproject.content_profile_cjis", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -298,7 +298,7 @@ exports[`operatingSystemFilter expect to return results 1`] = ` "policyType": "Unclassified Information in Non-federal Information Systems and Organizations (NIST 800-171)", "refId": "xccdf_org.ssgproject.content_profile_nist-800-171-cui", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -324,7 +324,7 @@ exports[`operatingSystemFilter expect to return results 1`] = ` "policyType": "PCI-DSS v3 Control Baseline for Red Hat Enterprise Linux 7", "refId": "xccdf_org.ssgproject.content_profile_pci-dss", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -350,7 +350,7 @@ exports[`operatingSystemFilter expect to return results 1`] = ` "policyType": "Red Hat Corporate Profile for Certified Cloud Providers (RH CCP)", "refId": "xccdf_org.ssgproject.content_profile_rht-ccp", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -376,7 +376,7 @@ exports[`operatingSystemFilter expect to return results 1`] = ` "policyType": "Health Insurance Portability and Accountability Act (HIPAA)", "refId": "xccdf_org.ssgproject.content_profile_hipaa", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -402,7 +402,7 @@ exports[`operatingSystemFilter expect to return results 1`] = ` "policyType": "United States Government Configuration Baseline", "refId": "xccdf_org.ssgproject.content_profile_ospp", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -428,7 +428,7 @@ exports[`operatingSystemFilter expect to return results 1`] = ` "policyType": "Standard System Security Profile for Red Hat Enterprise Linux 7", "refId": "xccdf_org.ssgproject.content_profile_standard", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -454,7 +454,7 @@ exports[`operatingSystemFilter expect to return results 1`] = ` "policyType": "DISA STIG for Red Hat Enterprise Linux 7", "refId": "xccdf_org.ssgproject.content_profile_stig-rhel7-disa", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -480,7 +480,7 @@ exports[`operatingSystemFilter expect to return results 1`] = ` "policyType": "PCI-DSS v3 Control Baseline for Red Hat Enterprise Linux 72", "refId": "xccdf_org.ssgproject.content_profile_pci-dss2", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, ] `; @@ -513,7 +513,7 @@ exports[`policyNameFilter expect to return results 1`] = ` "policyType": "Unclassified Information in Non-federal Information Systems and Organizations (NIST 800-171)", "refId": "xccdf_org.ssgproject.content_profile_nist-800-171-cui", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, ] `; diff --git a/src/PresentationalComponents/ReportsTable/__snapshots__/ReportsTable.test.js.snap b/src/PresentationalComponents/ReportsTable/__snapshots__/ReportsTable.test.js.snap index 407d550e53..c2829ababb 100644 --- a/src/PresentationalComponents/ReportsTable/__snapshots__/ReportsTable.test.js.snap +++ b/src/PresentationalComponents/ReportsTable/__snapshots__/ReportsTable.test.js.snap @@ -270,7 +270,7 @@ exports[`ReportsTable expect to render without error 1`] = ` "policyType": "United States Government Standard", "refId": "xccdf_org.ssgproject.content_profile_ospp23", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -345,7 +345,7 @@ exports[`ReportsTable expect to render without error 1`] = ` "policyType": "PCI-DSS v3 Control Baseline for Red Hat Enterprise Linux 73", "refId": "xccdf_org.ssgproject.content_profile_pci-dss3", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -371,7 +371,7 @@ exports[`ReportsTable expect to render without error 1`] = ` "policyType": "United States Government Configuration Baseline2", "refId": "xccdf_org.ssgproject.content_profile_ospp2", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -397,7 +397,7 @@ exports[`ReportsTable expect to render without error 1`] = ` "policyType": "C2S for Red Hat Enterprise Linux 7", "refId": "xccdf_org.ssgproject.content_profile_C2S", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -423,7 +423,7 @@ exports[`ReportsTable expect to render without error 1`] = ` "policyType": "Criminal Justice Information Services (CJIS) Security Policy", "refId": "xccdf_org.ssgproject.content_profile_cjis", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -449,7 +449,7 @@ exports[`ReportsTable expect to render without error 1`] = ` "policyType": "Unclassified Information in Non-federal Information Systems and Organizations (NIST 800-171)", "refId": "xccdf_org.ssgproject.content_profile_nist-800-171-cui", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -475,7 +475,7 @@ exports[`ReportsTable expect to render without error 1`] = ` "policyType": "PCI-DSS v3 Control Baseline for Red Hat Enterprise Linux 7", "refId": "xccdf_org.ssgproject.content_profile_pci-dss", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -501,7 +501,7 @@ exports[`ReportsTable expect to render without error 1`] = ` "policyType": "Red Hat Corporate Profile for Certified Cloud Providers (RH CCP)", "refId": "xccdf_org.ssgproject.content_profile_rht-ccp", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -527,7 +527,7 @@ exports[`ReportsTable expect to render without error 1`] = ` "policyType": "Health Insurance Portability and Accountability Act (HIPAA)", "refId": "xccdf_org.ssgproject.content_profile_hipaa", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -553,7 +553,7 @@ exports[`ReportsTable expect to render without error 1`] = ` "policyType": "United States Government Configuration Baseline", "refId": "xccdf_org.ssgproject.content_profile_ospp", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -579,7 +579,7 @@ exports[`ReportsTable expect to render without error 1`] = ` "policyType": "Standard System Security Profile for Red Hat Enterprise Linux 7", "refId": "xccdf_org.ssgproject.content_profile_standard", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -605,7 +605,7 @@ exports[`ReportsTable expect to render without error 1`] = ` "policyType": "DISA STIG for Red Hat Enterprise Linux 7", "refId": "xccdf_org.ssgproject.content_profile_stig-rhel7-disa", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, { "__typename": "Profile", @@ -631,7 +631,7 @@ exports[`ReportsTable expect to render without error 1`] = ` "policyType": "PCI-DSS v3 Control Baseline for Red Hat Enterprise Linux 72", "refId": "xccdf_org.ssgproject.content_profile_pci-dss2", "testResultHostCount": 8, - "totalHostCount": 10, + "totalHostCount": 1, }, ] } diff --git a/src/SmartComponents/PolicyDetails/PolicySystemsTab.js b/src/SmartComponents/PolicyDetails/PolicySystemsTab.js index 3c8f4e7627..3f6ac14ecf 100644 --- a/src/SmartComponents/PolicyDetails/PolicySystemsTab.js +++ b/src/SmartComponents/PolicyDetails/PolicySystemsTab.js @@ -5,29 +5,42 @@ import { NoSystemsTableWithWarning } from 'PresentationalComponents'; import { SystemsTable } from 'SmartComponents'; import * as Columns from '../SystemsTable/Columns'; import EditSystemsButtonToolbarItem from './EditSystemsButtonToolbarItem'; +import { Alert } from '@patternfly/react-core'; const PolicySystemsTab = ({ policy }) => { + const hasDifferentSystemCount = + policy?.totalHostCount !== policy?.hosts.length; return ( - - } - complianceThreshold={policy.complianceThreshold} - dedicatedAction={} - /> + <> + {hasDifferentSystemCount && ( + + )} + + } + complianceThreshold={policy.complianceThreshold} + dedicatedAction={} + /> + ); }; @@ -37,6 +50,7 @@ PolicySystemsTab.propTypes = { complianceThreshold: propTypes.number.isRequired, osMajorVersion: propTypes.string.isRequired, hosts: propTypes.array.isRequired, + totalHostCount: propTypes.number.isRequired, }), dedicatedAction: propTypes.object, systemTableProps: propTypes.object, diff --git a/src/SmartComponents/PolicyDetails/PolicySystemsTab.test.js b/src/SmartComponents/PolicyDetails/PolicySystemsTab.test.js index ee72c6eb7d..f37bd1fd1c 100644 --- a/src/SmartComponents/PolicyDetails/PolicySystemsTab.test.js +++ b/src/SmartComponents/PolicyDetails/PolicySystemsTab.test.js @@ -23,6 +23,7 @@ describe('PolicySystemsTab', () => { it('expect to render with no systems table', () => { const policy = { ...policies.edges[0].node, + totalHostCount: 0, hosts: [], }; @@ -30,4 +31,15 @@ describe('PolicySystemsTab', () => { expect(toJson(wrapper)).toMatchSnapshot(); }); + + it('expect to render with differentHostCount info', () => { + const policy = { + ...policies.edges[0].node, + totalHostCount: policies.edges[0].node.totalHostCount + 1, + }; + + const wrapper = shallow(); + + expect(toJson(wrapper)).toMatchSnapshot(); + }); }); diff --git a/src/SmartComponents/PolicyDetails/__snapshots__/PolicySystemsTab.test.js.snap b/src/SmartComponents/PolicyDetails/__snapshots__/PolicySystemsTab.test.js.snap index 4e86f1bf82..fdf70146be 100644 --- a/src/SmartComponents/PolicyDetails/__snapshots__/PolicySystemsTab.test.js.snap +++ b/src/SmartComponents/PolicyDetails/__snapshots__/PolicySystemsTab.test.js.snap @@ -1,416 +1,638 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`PolicySystemsTab expect to render with no systems table 1`] = ` - + + + Operating System + + } + > - Operating System + OS - } - > - - OS - - , - "transforms": [ - [Function], - ], - }, - { - "exportKey": "testResultProfiles", - "key": "ssg_version", - "renderExport": [Function], - "renderFunc": [Function], - "sortBy": [ - "ssg_version", - ], - "title": "SSG version", - "transforms": [ - [Function], - ], - }, - ] - } - compact={false} - complianceThreshold={100} - compliantFilter={false} - dedicatedAction={ - , + "transforms": [ + [Function], + ], + }, { - "__typename": "Profile", - "benchmark": { - "title": "Guide to the Secure Configuration of RHEL 7", - "version": "0.1.49", - }, - "businessObjective": null, - "complianceThreshold": 100, - "compliantHostCount": 4, - "hosts": [], - "id": "b71376fd-015e-4209-99af-4543e82e5dc5", - "name": "United States Government Configuration Baseline23", - "osMajorVersion": "7", - "policy": { + "exportKey": "testResultProfiles", + "key": "ssg_version", + "renderExport": [Function], + "renderFunc": [Function], + "sortBy": [ + "ssg_version", + ], + "title": "SSG version", + "transforms": [ + [Function], + ], + }, + ] + } + compact={false} + complianceThreshold={100} + compliantFilter={false} + dedicatedAction={ + + } + defaultFilter="policy_id = b71376fd-015e-4209-99af-4543e82e5dc5" + enableExport={true} + noSystemsTable={false} + policyId="b71376fd-015e-4209-99af-4543e82e5dc5" + preselectedSystems={[]} + remediationsEnabled={false} + ruleSeverityFilter={false} + showActions={false} + showComplianceSystemsInfo={false} + showGroupsFilter={false} + showOnlySystemsWithTestResults={false} + showOsMinorVersionFilter={ + [ + "7", + ] + } + /> + +`; + +exports[`PolicySystemsTab expect to render with no systems table 1`] = ` + + + Operating System + + } + > + + OS + + , + "transforms": [ + [Function], + ], + }, + { + "exportKey": "testResultProfiles", + "key": "ssg_version", + "renderExport": [Function], + "renderFunc": [Function], + "sortBy": [ + "ssg_version", + ], + "title": "SSG version", + "transforms": [ + [Function], + ], + }, + ] + } + compact={false} + complianceThreshold={100} + compliantFilter={false} + dedicatedAction={ + - } - defaultFilter="policy_id = b71376fd-015e-4209-99af-4543e82e5dc5" - enableExport={true} - noSystemsTable={} - policyId="b71376fd-015e-4209-99af-4543e82e5dc5" - preselectedSystems={[]} - remediationsEnabled={false} - ruleSeverityFilter={false} - showActions={false} - showComplianceSystemsInfo={false} - showGroupsFilter={false} - showOnlySystemsWithTestResults={false} - showOsMinorVersionFilter={ - [ - "7", - ] - } -/> + /> + } + defaultFilter="policy_id = b71376fd-015e-4209-99af-4543e82e5dc5" + enableExport={true} + noSystemsTable={} + policyId="b71376fd-015e-4209-99af-4543e82e5dc5" + preselectedSystems={[]} + remediationsEnabled={false} + ruleSeverityFilter={false} + showActions={false} + showComplianceSystemsInfo={false} + showGroupsFilter={false} + showOnlySystemsWithTestResults={false} + showOsMinorVersionFilter={ + [ + "7", + ] + } + /> + `; exports[`PolicySystemsTab expect to render without error 1`] = ` - + + Operating System + + } + > - Operating System + OS - } - > - - OS - - , - "transforms": [ - [Function], - ], - }, - { - "exportKey": "testResultProfiles", - "key": "ssg_version", - "renderExport": [Function], - "renderFunc": [Function], - "sortBy": [ - "ssg_version", - ], - "title": "SSG version", - "transforms": [ - [Function], - ], - }, - ] - } - compact={false} - complianceThreshold={100} - compliantFilter={false} - dedicatedAction={ - , + "transforms": [ + [Function], + ], + }, { - "__typename": "Profile", - "benchmark": { - "title": "Guide to the Secure Configuration of RHEL 7", - "version": "0.1.49", - }, - "businessObjective": null, - "complianceThreshold": 100, - "compliantHostCount": 4, - "hosts": [ - { - "id": "f7d15113-1ac8-4aee-b367-e1777e60979d", - "osMinorVersion": 7, - }, + "exportKey": "testResultProfiles", + "key": "ssg_version", + "renderExport": [Function], + "renderFunc": [Function], + "sortBy": [ + "ssg_version", ], - "id": "b71376fd-015e-4209-99af-4543e82e5dc5", - "name": "United States Government Configuration Baseline23", - "osMajorVersion": "7", - "policy": { + "title": "SSG version", + "transforms": [ + [Function], + ], + }, + ] + } + compact={false} + complianceThreshold={100} + compliantFilter={false} + dedicatedAction={ + - } - defaultFilter="policy_id = b71376fd-015e-4209-99af-4543e82e5dc5" - enableExport={true} - noSystemsTable={false} - policyId="b71376fd-015e-4209-99af-4543e82e5dc5" - preselectedSystems={[]} - remediationsEnabled={false} - ruleSeverityFilter={false} - showActions={false} - showComplianceSystemsInfo={false} - showGroupsFilter={false} - showOnlySystemsWithTestResults={false} - showOsMinorVersionFilter={ - [ - "7", - ] - } -/> + /> + } + defaultFilter="policy_id = b71376fd-015e-4209-99af-4543e82e5dc5" + enableExport={true} + noSystemsTable={false} + policyId="b71376fd-015e-4209-99af-4543e82e5dc5" + preselectedSystems={[]} + remediationsEnabled={false} + ruleSeverityFilter={false} + showActions={false} + showComplianceSystemsInfo={false} + showGroupsFilter={false} + showOnlySystemsWithTestResults={false} + showOsMinorVersionFilter={ + [ + "7", + ] + } + /> + `; diff --git a/src/__fixtures__/policies.js b/src/__fixtures__/policies.js index 721dd35792..b5d48fffd9 100644 --- a/src/__fixtures__/policies.js +++ b/src/__fixtures__/policies.js @@ -8,7 +8,7 @@ export const policies = { policyType: 'United States Government Standard', complianceThreshold: 100, businessObjective: null, - totalHostCount: 10, + totalHostCount: 1, testResultHostCount: 8, compliantHostCount: 4, osMajorVersion: '7', @@ -121,7 +121,7 @@ export const policies = { policyType: 'PCI-DSS v3 Control Baseline for Red Hat Enterprise Linux 73', complianceThreshold: 67, businessObjective: null, - totalHostCount: 10, + totalHostCount: 1, testResultHostCount: 8, osMajorVersion: '7', policy: { @@ -194,7 +194,7 @@ export const policies = { policyType: 'United States Government Configuration Baseline2', complianceThreshold: 100, businessObjective: null, - totalHostCount: 10, + totalHostCount: 1, testResultHostCount: 8, osMajorVersion: '7', hosts: [ @@ -220,7 +220,7 @@ export const policies = { refId: 'xccdf_org.ssgproject.content_profile_C2S', complianceThreshold: 69.5, businessObjective: null, - totalHostCount: 10, + totalHostCount: 1, testResultHostCount: 8, osMajorVersion: '7', hosts: [ @@ -246,7 +246,7 @@ export const policies = { refId: 'xccdf_org.ssgproject.content_profile_cjis', complianceThreshold: 100, businessObjective: null, - totalHostCount: 10, + totalHostCount: 1, testResultHostCount: 8, osMajorVersion: '7', hosts: [ @@ -272,7 +272,7 @@ export const policies = { refId: 'xccdf_org.ssgproject.content_profile_nist-800-171-cui', complianceThreshold: 100, businessObjective: null, - totalHostCount: 10, + totalHostCount: 1, testResultHostCount: 8, osMajorVersion: '7', hosts: [ @@ -298,7 +298,7 @@ export const policies = { refId: 'xccdf_org.ssgproject.content_profile_pci-dss', complianceThreshold: 100, businessObjective: null, - totalHostCount: 10, + totalHostCount: 1, testResultHostCount: 8, osMajorVersion: '7', hosts: [ @@ -324,7 +324,7 @@ export const policies = { refId: 'xccdf_org.ssgproject.content_profile_rht-ccp', complianceThreshold: 100, businessObjective: null, - totalHostCount: 10, + totalHostCount: 1, testResultHostCount: 8, osMajorVersion: '7', hosts: [ @@ -349,7 +349,7 @@ export const policies = { policyType: 'Health Insurance Portability and Accountability Act (HIPAA)', refId: 'xccdf_org.ssgproject.content_profile_hipaa', complianceThreshold: 100, - totalHostCount: 10, + totalHostCount: 1, testResultHostCount: 8, businessObjective: null, osMajorVersion: '7', @@ -376,7 +376,7 @@ export const policies = { refId: 'xccdf_org.ssgproject.content_profile_ospp', complianceThreshold: 100, businessObjective: null, - totalHostCount: 10, + totalHostCount: 1, testResultHostCount: 8, osMajorVersion: '7', hosts: [ @@ -402,7 +402,7 @@ export const policies = { refId: 'xccdf_org.ssgproject.content_profile_standard', complianceThreshold: 100, businessObjective: null, - totalHostCount: 10, + totalHostCount: 1, testResultHostCount: 8, osMajorVersion: '7', hosts: [ @@ -428,7 +428,7 @@ export const policies = { refId: 'xccdf_org.ssgproject.content_profile_stig-rhel7-disa', complianceThreshold: 100, businessObjective: null, - totalHostCount: 10, + totalHostCount: 1, testResultHostCount: 8, osMajorVersion: '7', hosts: [ @@ -454,7 +454,7 @@ export const policies = { refId: 'xccdf_org.ssgproject.content_profile_pci-dss2', complianceThreshold: 100, businessObjective: null, - totalHostCount: 10, + totalHostCount: 1, testResultHostCount: 8, osMajorVersion: '7', hosts: [