Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
import type { MenuToggleElement } from '@patternfly/react-core';
import { TimesIcon } from '@patternfly/react-icons';

import useFeatureFlags from 'hooks/useFeatureFlags';
import useFetchClustersForPermissions from 'hooks/useFetchClustersForPermissions';
import type { ClientPolicy } from 'types/policy.proto';
import type { ListImage } from 'types/image.proto';
Expand All @@ -37,7 +36,6 @@ import { getImages } from 'services/imageService';
import ExternalLink from 'Components/PatternFly/IconText/ExternalLink';

import { initialExcludedDeployment, initialScope } from '../../policies.utils';
import PolicyScopeCardLegacy from './PolicyScopeCardLegacy';
import InclusionScopeCard from './InclusionScopeCard';
import ExclusionScopeCard from './ExclusionScopeCard';

Expand All @@ -63,7 +61,6 @@ function PolicyScopeForm(): ReactElement {
const [isExcludeImagesOpen, setIsExcludeImagesOpen] = useState(false);
const [filterValue, setFilterValue] = useState('');
const [images, setImages] = useState<ListImage[]>([]);
const { isFeatureFlagEnabled } = useFeatureFlags();
const { clusters } = useFetchClustersForPermissions(['Deployment']);
const { values, handleChange, setFieldValue } = useFormikContext<ClientPolicy>();
const { scope, excludedDeploymentScopes, excludedImageNames } = values;
Expand Down Expand Up @@ -183,24 +180,14 @@ function PolicyScopeForm(): ReactElement {
{scope?.map((_, index) => (
// eslint-disable-next-line react/no-array-index-key
<GridItem key={index}>
{isFeatureFlagEnabled('ROX_LABEL_BASED_POLICY_SCOPING') ? (
<InclusionScopeCard
index={index}
scope={scope[index]}
clusters={clusters}
handleChange={handleChange}
setFieldValue={setFieldValue}
onDelete={() => deleteInclusionScope(index)}
/>
) : (
<PolicyScopeCardLegacy
type="inclusion"
name={`scope[${index}]`}
clusters={clusters}
onDelete={() => deleteInclusionScope(index)}
hasAuditLogEventSource={hasAuditLogEventSource}
/>
)}
<InclusionScopeCard
index={index}
scope={scope[index]}
clusters={clusters}
handleChange={handleChange}
setFieldValue={setFieldValue}
onDelete={() => deleteInclusionScope(index)}
/>
</GridItem>
))}
</Grid>
Expand Down Expand Up @@ -234,24 +221,14 @@ function PolicyScopeForm(): ReactElement {
{excludedDeploymentScopes?.map((_, index) => (
// eslint-disable-next-line react/no-array-index-key
<GridItem key={index}>
{isFeatureFlagEnabled('ROX_LABEL_BASED_POLICY_SCOPING') ? (
<ExclusionScopeCard
index={index}
excludedDeploymentScope={excludedDeploymentScopes[index]}
clusters={clusters}
handleChange={handleChange}
setFieldValue={setFieldValue}
onDelete={() => deleteExclusionDeploymentScope(index)}
/>
) : (
<PolicyScopeCardLegacy
type="exclusion"
name={`excludedDeploymentScopes[${index}]`}
clusters={clusters}
onDelete={() => deleteExclusionDeploymentScope(index)}
hasAuditLogEventSource={hasAuditLogEventSource}
/>
)}
<ExclusionScopeCard
index={index}
excludedDeploymentScope={excludedDeploymentScopes[index]}
clusters={clusters}
handleChange={handleChange}
setFieldValue={setFieldValue}
onDelete={() => deleteExclusionDeploymentScope(index)}
/>
</GridItem>
))}
</Grid>
Expand Down
1 change: 0 additions & 1 deletion ui/apps/platform/src/types/featureFlag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export type FeatureFlagEnvVar =
| 'ROX_DEPRECATED_COMPLIANCE_DASHBOARD'
| 'ROX_EVALUATION_FILTER'
| 'ROX_INIT_CONTAINER_SUPPORT'
| 'ROX_LABEL_BASED_POLICY_SCOPING'
| 'ROX_LEGACY_SCANNER'
| 'ROX_LIGHTSPEED_RISK_SUMMARY'
| 'ROX_NODE_INDEX_ENABLED'
Expand Down
Loading