Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ export const Annotation: CompoundSearchFilterAttribute = {
inputType: 'autocomplete',
};

export const ContainerType: CompoundSearchFilterAttribute = {
displayName: 'Container type',
filterChipLabel: 'Container type',
searchTerm: 'Container Type',
inputType: 'select',
inputProps: {
options: [
{ value: 'REGULAR', label: 'Regular' },
{ value: 'INIT', label: 'Init' },
],
},
featureFlagDependency: ['ROX_INIT_CONTAINER_SUPPORT'],
};

export const Inactive: CompoundSearchFilterAttribute = {
displayName: 'Status',
filterChipLabel: 'Deployment status',
Expand All @@ -43,4 +57,4 @@ export const Inactive: CompoundSearchFilterAttribute = {
},
};

export const deploymentAttributes = [Annotation, ID, Label, Name, Inactive];
export const deploymentAttributes = [Annotation, ContainerType, ID, Label, Name, Inactive];
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { Toolbar, ToolbarContent, ToolbarGroup } from '@patternfly/react-core';

import type { SearchFilter } from 'types/search';
import useAnalytics from 'hooks/useAnalytics';
import useFeatureFlags from 'hooks/useFeatureFlags';
import { createFilterTracker } from 'utils/analyticsEventTracking';
import type { OnSearchCallback } from 'Components/CompoundSearchFilter/types';
import CompoundSearchFilter from 'Components/CompoundSearchFilter/components/CompoundSearchFilter';
import CompoundSearchFilterLabels from 'Components/CompoundSearchFilter/components/CompoundSearchFilterLabels';
import { getSearchFilterConfigWithFeatureFlagDependency } from 'Components/CompoundSearchFilter/utils/utils';
import type { FilteredWorkflowView } from 'Components/FilteredWorkflowViewSelector/types';

import { getSearchFilterConfig } from './ViolationsTableSearchFilter.utils';
Expand All @@ -27,8 +29,12 @@ function ViolationsTableSearchFilter({
}: ViolationsTableSearchFilterProps) {
const { analyticsTrack } = useAnalytics();
const trackAppliedFilter = createFilterTracker(analyticsTrack);
const { isFeatureFlagEnabled } = useFeatureFlags();

const searchFilterConfig = getSearchFilterConfig(filteredWorkflowView);
const searchFilterConfig = getSearchFilterConfigWithFeatureFlagDependency(
isFeatureFlagEnabled,
getSearchFilterConfig(filteredWorkflowView)
);

const onSearchHandler: OnSearchCallback = (payload) => {
onSearch(payload);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
} from 'Components/CompoundSearchFilter/attributes/namespace';
import {
Annotation as DeploymentAnnotation,
ContainerType as DeploymentContainerType,
ID as DeploymentID,
Inactive as DeploymentInactive,
Label as DeploymentLabel,
Expand Down Expand Up @@ -55,6 +56,7 @@ const allSearchFilterEntities: CompoundSearchFilterConfig = [
searchCategory: 'ALERTS',
attributes: [
DeploymentAnnotation,
DeploymentContainerType,
DeploymentID,
DeploymentLabel,
DeploymentName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ import {
clusterPlatformTypeAttribute,
clusterTypeAttribute,
} from 'Components/CompoundSearchFilter/attributes/cluster';
import { Annotation, ID, Label, Name } from 'Components/CompoundSearchFilter/attributes/deployment';
import {
Annotation,
ContainerType,
ID,
Label,
Name,
} from 'Components/CompoundSearchFilter/attributes/deployment';
import { imageAttributes } from 'Components/CompoundSearchFilter/attributes/image';
import { imageCVEAttributes } from 'Components/CompoundSearchFilter/attributes/imageCVE';
import { imageComponentAttributes } from 'Components/CompoundSearchFilter/attributes/imageComponent';
Expand Down Expand Up @@ -81,7 +87,7 @@ export const imageComponentSearchFilterConfig: CompoundSearchFilterEntity = {
export const deploymentSearchFilterConfig: CompoundSearchFilterEntity = {
displayName: 'Deployment',
searchCategory: 'DEPLOYMENTS',
attributes: [Annotation, ID, Label, Name],
attributes: [Annotation, ContainerType, ID, Label, Name],
};

export const namespaceSearchFilterConfig: CompoundSearchFilterEntity = {
Expand Down
1 change: 1 addition & 0 deletions ui/apps/platform/src/types/featureFlag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export type FeatureFlagEnvVar =
| 'ROX_CISA_KEV'
| 'ROX_CVE_FIX_TIMESTAMP'
| 'ROX_FLATTEN_IMAGE_DATA'
| 'ROX_INIT_CONTAINER_SUPPORT'
| 'ROX_LABEL_BASED_POLICY_SCOPING'
| 'ROX_NODE_INDEX_ENABLED'
| 'ROX_NODE_VULNERABILITY_REPORTS'
Expand Down
1 change: 1 addition & 0 deletions ui/apps/platform/src/types/searchOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export type SearchFieldLabel =
| 'Container ID'
| 'Container Image Digest'
| 'Container Name'
| 'Container Type'
| 'Deployment ID'
| 'Deployment'
| 'Deployment Label'
Expand Down
Loading