11import React from 'react' ;
22
3- import { Content , Form , Title } from '@patternfly/react-core' ;
3+ import { Content , Form , Label , Title } from '@patternfly/react-core' ;
4+ import { InfoCircleIcon } from '@patternfly/react-icons' ;
45
6+ import { useGetOscapCustomizationsQuery } from '@/store/api/backend' ;
57import { selectIsOnPremise } from '@/store/slices/env' ;
6- import { selectDistribution } from '@/store/slices/wizard' ;
8+ import {
9+ selectComplianceProfileID ,
10+ selectDistribution ,
11+ } from '@/store/slices/wizard' ;
12+ import { asDistribution } from '@/store/typeGuards' ;
713
814import PackageRecommendations from './components/PackageRecommendations' ;
915import Packages from './components/Packages' ;
@@ -15,11 +21,37 @@ import { CustomizationLabels } from '../../../sharedComponents/CustomizationLabe
1521const PackagesStep = ( ) => {
1622 const distribution = useAppSelector ( selectDistribution ) ;
1723 const isOnPremise = useAppSelector ( selectIsOnPremise ) ;
24+ const release = useAppSelector ( selectDistribution ) ;
25+ const complianceProfileID = useAppSelector ( selectComplianceProfileID ) ;
26+
27+ const { data : oscapProfileInfo } = useGetOscapCustomizationsQuery (
28+ {
29+ distribution : asDistribution ( release ) ,
30+ // @ts -ignore if complianceProfileID is undefined the query is going to get skipped, so it's safe here to ignore the linter here
31+ profile : complianceProfileID ,
32+ } ,
33+ {
34+ skip : ! complianceProfileID ,
35+ } ,
36+ ) ;
37+
38+ const requiredByOpenSCAPCount =
39+ oscapProfileInfo ?. packages ?. filter ( Boolean ) . length ?? 0 ;
40+
1841 return (
1942 < Form >
2043 < CustomizationLabels customization = 'packages' />
21- < Title headingLevel = 'h1' size = 'xl' >
44+ < Title
45+ headingLevel = 'h1'
46+ size = 'xl'
47+ className = 'pf-v6-u-display-flex pf-v6-u-align-items-center'
48+ >
2249 Packages
50+ { requiredByOpenSCAPCount > 0 && (
51+ < Label icon = { < InfoCircleIcon /> } className = 'pf-v6-u-ml-sm' >
52+ { requiredByOpenSCAPCount } Added by OpenSCAP
53+ </ Label >
54+ ) }
2355 </ Title >
2456 < Content >
2557 Search and add individual packages to include in your image. You can
0 commit comments