From d413780a98607cbbbbba53cbb58b9257c5ae9be0 Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Fri, 14 Nov 2025 13:20:48 +0530 Subject: [PATCH 1/9] feat: update security center URLs and add large size support in segmented control --- src/Common/Constants.ts | 5 ++++- src/Common/SegmentedControl/constants.ts | 2 ++ src/Common/SegmentedControl/types.ts | 5 ++++- src/Shared/Hooks/useUserPreferences/types.ts | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Common/Constants.ts b/src/Common/Constants.ts index 8275ea0d1..f778430f7 100644 --- a/src/Common/Constants.ts +++ b/src/Common/Constants.ts @@ -131,7 +131,10 @@ export const URLS = { // SECURITY CENTER SECURITY_CENTER: SECURITY_CENTER_ROOT, SECURITY_CENTER_OVERVIEW: `${SECURITY_CENTER_ROOT}/overview`, - SECURITY_CENTER_SCANS: `${SECURITY_CENTER_ROOT}/scans`, + SECURITY_CENTER_VULNERABILITIES: `${SECURITY_CENTER_ROOT}/vulnerabilities`, + SECURITY_CENTER_VULNERABILITY_DEPLOYMENTS: `${SECURITY_CENTER_ROOT}/vulnerabilities/deployments`, + SECURITY_CENTER_VULNERABILITY_CVES: `${SECURITY_CENTER_ROOT}/vulnerabilities/cves`, + SECURITY_CENTER_SECURITY_ENABLEMENT: `${SECURITY_CENTER_ROOT}/security-enablement`, SECURITY_CENTER_POLICIES: `${SECURITY_CENTER_ROOT}/policies`, // AUTOMATION AND ENABLEMENT AUTOMATION_AND_ENABLEMENT: AUTOMATION_AND_ENABLEMENT_ROOT, diff --git a/src/Common/SegmentedControl/constants.ts b/src/Common/SegmentedControl/constants.ts index 21bca10ef..404965a13 100644 --- a/src/Common/SegmentedControl/constants.ts +++ b/src/Common/SegmentedControl/constants.ts @@ -22,10 +22,12 @@ export const COMPONENT_SIZE_TO_SEGMENT_CLASS_MAP: Record = { [ComponentSizeType.xs]: 'py-1', [ComponentSizeType.small]: 'py-2', [ComponentSizeType.medium]: 'py-2', + [ComponentSizeType.large]: 'py-3', } as const diff --git a/src/Common/SegmentedControl/types.ts b/src/Common/SegmentedControl/types.ts index 289d57550..08bbfd74c 100644 --- a/src/Common/SegmentedControl/types.ts +++ b/src/Common/SegmentedControl/types.ts @@ -74,7 +74,10 @@ export type SegmentedControlProps = { * Please make sure this is unique */ name: string - size?: Extract + size?: Extract< + ComponentSizeType, + ComponentSizeType.xs | ComponentSizeType.small | ComponentSizeType.medium | ComponentSizeType.large + > fullWidth?: boolean disabled?: boolean } & ( diff --git a/src/Shared/Hooks/useUserPreferences/types.ts b/src/Shared/Hooks/useUserPreferences/types.ts index e0c9d015b..2df44992a 100644 --- a/src/Shared/Hooks/useUserPreferences/types.ts +++ b/src/Shared/Hooks/useUserPreferences/types.ts @@ -40,7 +40,8 @@ export type NavigationItemID = | 'cost-visibility-cost-breakdown' | 'cost-visibility-configurations' | 'security-center-overview' - | 'security-center-security-scans' + | 'security-center-security-vulnerabilities' + | 'security-center-security-enablement' | 'security-center-security-policy' | 'automation-and-enablement-jobs' | 'automation-and-enablement-alerting' From 20bc6eb88db68b1908a0f9b8c3a8fcf3a94631be Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Mon, 17 Nov 2025 13:35:37 +0530 Subject: [PATCH 2/9] feat: export SeverityChip component from Security index --- src/Shared/Components/Security/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Shared/Components/Security/index.tsx b/src/Shared/Components/Security/index.tsx index e7af72994..c08f3cfc2 100644 --- a/src/Shared/Components/Security/index.tsx +++ b/src/Shared/Components/Security/index.tsx @@ -17,5 +17,6 @@ export { SEVERITY_LABEL_MAP } from './constants' export * from './SecurityDetailsCards' export * from './SecurityModal' +export { default as SeverityChip } from './SeverityChip' export * from './utils' export * from './Vulnerabilities' From a2fb3e49b6ed44dc36358516aaa81db4b216aa74 Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Mon, 17 Nov 2025 16:36:11 +0530 Subject: [PATCH 3/9] feat: add ScanTypeOptions enum and export from types --- src/Shared/Components/Security/index.tsx | 1 + src/Shared/Components/Security/types.tsx | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/Shared/Components/Security/index.tsx b/src/Shared/Components/Security/index.tsx index c08f3cfc2..facdf6bf6 100644 --- a/src/Shared/Components/Security/index.tsx +++ b/src/Shared/Components/Security/index.tsx @@ -18,5 +18,6 @@ export { SEVERITY_LABEL_MAP } from './constants' export * from './SecurityDetailsCards' export * from './SecurityModal' export { default as SeverityChip } from './SeverityChip' +export { ScanTypeOptions } from './types' export * from './utils' export * from './Vulnerabilities' diff --git a/src/Shared/Components/Security/types.tsx b/src/Shared/Components/Security/types.tsx index c7372ee97..4b67b0a5e 100644 --- a/src/Shared/Components/Security/types.tsx +++ b/src/Shared/Components/Security/types.tsx @@ -42,3 +42,9 @@ export interface GetSidebarDataParamsType extends Record Date: Tue, 18 Nov 2025 16:09:02 +0530 Subject: [PATCH 4/9] feat: remove ScanTypeOptions enum from types and update exports in Security index --- src/Shared/Components/Security/index.tsx | 1 - src/Shared/Components/Security/types.tsx | 6 ------ 2 files changed, 7 deletions(-) diff --git a/src/Shared/Components/Security/index.tsx b/src/Shared/Components/Security/index.tsx index facdf6bf6..c08f3cfc2 100644 --- a/src/Shared/Components/Security/index.tsx +++ b/src/Shared/Components/Security/index.tsx @@ -18,6 +18,5 @@ export { SEVERITY_LABEL_MAP } from './constants' export * from './SecurityDetailsCards' export * from './SecurityModal' export { default as SeverityChip } from './SeverityChip' -export { ScanTypeOptions } from './types' export * from './utils' export * from './Vulnerabilities' diff --git a/src/Shared/Components/Security/types.tsx b/src/Shared/Components/Security/types.tsx index 4b67b0a5e..c7372ee97 100644 --- a/src/Shared/Components/Security/types.tsx +++ b/src/Shared/Components/Security/types.tsx @@ -42,9 +42,3 @@ export interface GetSidebarDataParamsType extends Record Date: Tue, 18 Nov 2025 17:53:37 +0530 Subject: [PATCH 5/9] feat: add getSelectPickerOptionsByValue utility function and update exports in SelectPicker --- src/Common/Types.ts | 1 + src/Shared/Components/SelectPicker/index.ts | 2 +- src/Shared/Components/SelectPicker/utils.ts | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Common/Types.ts b/src/Common/Types.ts index ff8edc942..689118388 100644 --- a/src/Common/Types.ts +++ b/src/Common/Types.ts @@ -1116,6 +1116,7 @@ export type AppsGroupedByProjectsType = { projectName: string appList: { name: string + id: number }[] }[] diff --git a/src/Shared/Components/SelectPicker/index.ts b/src/Shared/Components/SelectPicker/index.ts index 0d2932a96..12aae43ad 100644 --- a/src/Shared/Components/SelectPicker/index.ts +++ b/src/Shared/Components/SelectPicker/index.ts @@ -20,4 +20,4 @@ export * from './GroupedFilterSelectPicker' export { default as SelectPicker } from './SelectPicker.component' export * from './SelectPickerTextArea.component' export * from './type' -export { getSelectPickerOptionByValue } from './utils' +export { getSelectPickerOptionByValue, getSelectPickerOptionsByValue } from './utils' diff --git a/src/Shared/Components/SelectPicker/utils.ts b/src/Shared/Components/SelectPicker/utils.ts index 20fb32729..799721984 100644 --- a/src/Shared/Components/SelectPicker/utils.ts +++ b/src/Shared/Components/SelectPicker/utils.ts @@ -435,3 +435,8 @@ export const getSelectPickerOptionByValue = ( }) ?? defaultOption ) } + +export const getSelectPickerOptionsByValue = ( + optionsList: SelectPickerOptionType[], + values: OptionValue[], +): SelectPickerOptionType[] => (optionsList ?? []).filter((option) => values.includes(option.value)) From 463804060cff7be86caf1fe5773dd673bd49d62d Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Mon, 24 Nov 2025 13:39:13 +0530 Subject: [PATCH 6/9] feat: enhance SegmentedBarChart with hideTotal prop and update severity constants --- .../SegmentedBarChart/SegmentedBarChart.tsx | 3 ++- src/Common/SegmentedBarChart/types.ts | 14 ++++++++++++-- .../SecurityDetailsCards/SecurityCard.tsx | 4 ++-- .../Security/SecurityModal/constants.tsx | 2 +- .../Security/SecurityModal/index.ts | 2 +- .../Security/SecurityModal/utils.tsx | 19 +++++++++++-------- 6 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/Common/SegmentedBarChart/SegmentedBarChart.tsx b/src/Common/SegmentedBarChart/SegmentedBarChart.tsx index 93d2ac30b..3d598fba0 100644 --- a/src/Common/SegmentedBarChart/SegmentedBarChart.tsx +++ b/src/Common/SegmentedBarChart/SegmentedBarChart.tsx @@ -32,6 +32,7 @@ const SegmentedBarChart: React.FC = ({ countClassName, labelClassName, isProportional, + hideTotal, swapLegendAndBar = false, showAnimationOnBar = false, isLoading, @@ -58,7 +59,7 @@ const SegmentedBarChart: React.FC = ({
) : ( - {isProportional ? `${value}/${total}` : value} + {isProportional && !hideTotal ? `${value}/${total}` : value} ) diff --git a/src/Common/SegmentedBarChart/types.ts b/src/Common/SegmentedBarChart/types.ts index 7ddf526e6..2101e42f4 100644 --- a/src/Common/SegmentedBarChart/types.ts +++ b/src/Common/SegmentedBarChart/types.ts @@ -32,13 +32,23 @@ type EntityPropType = entities: NonNullable & { label?: never }>[] } +type ProportionalType = + | { + isProportional?: true + hideTotal?: boolean + } + | { + isProportional?: false | never + hideTotal?: never + } + export type SegmentedBarChartProps = { rootClassName?: string countClassName?: string labelClassName?: string - isProportional?: boolean swapLegendAndBar?: boolean showAnimationOnBar?: boolean isLoading?: boolean size?: ComponentSizeType -} & EntityPropType +} & EntityPropType & + ProportionalType diff --git a/src/Shared/Components/Security/SecurityDetailsCards/SecurityCard.tsx b/src/Shared/Components/Security/SecurityDetailsCards/SecurityCard.tsx index c728c555f..aac0fd138 100644 --- a/src/Shared/Components/Security/SecurityDetailsCards/SecurityCard.tsx +++ b/src/Shared/Components/Security/SecurityDetailsCards/SecurityCard.tsx @@ -21,7 +21,7 @@ import { ReactComponent as ICShieldWarning } from '@Icons/ic-shield-warning-outl import { SegmentedBarChart } from '@Common/SegmentedBarChart' import { SECURITY_CONFIG } from '../constants' -import { SEVERITIES } from '../SecurityModal/constants' +import { SEVERITIES_LABEL_COLOR_MAP } from '../SecurityModal/constants' import { SUB_CATEGORIES } from '../SecurityModal/types' import { getTotalSeverities } from '../utils' import { SecurityCardProps } from './types' @@ -39,7 +39,7 @@ const SecurityCard = ({ const hasThreats: boolean = !!totalCount - const entities = Object.entries(SEVERITIES) + const entities = Object.entries(SEVERITIES_LABEL_COLOR_MAP) .map(([key, severity]) => ({ ...severity, value: severities[key], diff --git a/src/Shared/Components/Security/SecurityModal/constants.tsx b/src/Shared/Components/Security/SecurityModal/constants.tsx index f838c24ed..b75cdeb10 100644 --- a/src/Shared/Components/Security/SecurityModal/constants.tsx +++ b/src/Shared/Components/Security/SecurityModal/constants.tsx @@ -73,7 +73,7 @@ export const SUB_CATEGORY_LABELS = { EXPOSED_SECRETS: 'Exposed Secrets', } as const -export const SEVERITIES = { +export const SEVERITIES_LABEL_COLOR_MAP = { [SeveritiesDTO.CRITICAL]: { label: 'Critical', color: 'var(--R700)', diff --git a/src/Shared/Components/Security/SecurityModal/index.ts b/src/Shared/Components/Security/SecurityModal/index.ts index e16f6439f..9ddf29487 100644 --- a/src/Shared/Components/Security/SecurityModal/index.ts +++ b/src/Shared/Components/Security/SecurityModal/index.ts @@ -20,7 +20,7 @@ export { getSecurityModalSidebarId, getSidebarData, } from './config' -export { CATEGORY_LABELS } from './constants' +export { CATEGORY_LABELS, SEVERITIES_LABEL_COLOR_MAP } from './constants' export { default as SecurityModal } from './SecurityModal' export { getSecurityScan } from './service' export type { diff --git a/src/Shared/Components/Security/SecurityModal/utils.tsx b/src/Shared/Components/Security/SecurityModal/utils.tsx index 08ac7b5e6..c0a646607 100644 --- a/src/Shared/Components/Security/SecurityModal/utils.tsx +++ b/src/Shared/Components/Security/SecurityModal/utils.tsx @@ -20,7 +20,7 @@ import { VulnerabilityType } from '@Common/Types' import { ScannedByToolModal } from '@Shared/Components/ScannedByToolModal' import { Severity } from '@Shared/types' -import { ORDERED_SEVERITY_KEYS, SEVERITIES, TRIVY_ICON_URL } from './constants' +import { ORDERED_SEVERITY_KEYS, SEVERITIES_LABEL_COLOR_MAP, TRIVY_ICON_URL } from './constants' import { CATEGORIES, GetResourceScanDetailsResponseType, @@ -34,27 +34,30 @@ import { } from './types' export const mapSeveritiesToSegmentedBarChartEntities = ( - severities: Partial>, + severities: Partial>, ) => /* for all the SEVERITY keys in @severities create @Entity */ severities && ORDERED_SEVERITY_KEYS.map( - (key: keyof typeof SEVERITIES) => + (key: keyof typeof SEVERITIES_LABEL_COLOR_MAP) => severities[key] && { - color: SEVERITIES[key].color, - label: SEVERITIES[key].label, + color: SEVERITIES_LABEL_COLOR_MAP[key].color, + label: SEVERITIES_LABEL_COLOR_MAP[key].label, value: severities[key], }, ).filter((entity: SegmentedBarChartProps['entities'][number]) => !!entity) -export const stringifySeverities = (severities: Partial>) => +export const stringifySeverities = (severities: Partial>) => severities && Object.keys(severities) .sort( - (a: keyof typeof SEVERITIES, b: keyof typeof SEVERITIES) => + (a: keyof typeof SEVERITIES_LABEL_COLOR_MAP, b: keyof typeof SEVERITIES_LABEL_COLOR_MAP) => ORDERED_SEVERITY_KEYS.indexOf(a) - ORDERED_SEVERITY_KEYS.indexOf(b), ) - .map((key: keyof typeof SEVERITIES) => `${severities[key]} ${SEVERITIES[key].label}`) + .map( + (key: keyof typeof SEVERITIES_LABEL_COLOR_MAP) => + `${severities[key]} ${SEVERITIES_LABEL_COLOR_MAP[key].label}`, + ) .join(', ') export const getSeverityWeight = (severity: SeveritiesDTO): number => From 9045d09664e5c4e4e11a12aeb80044551390660c Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Mon, 24 Nov 2025 14:18:40 +0530 Subject: [PATCH 7/9] chore: bump version to 1.20.6-pre-52 in package.json and package-lock.json --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5a8d826bc..25d376a8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.20.6-pre-51", + "version": "1.20.6-pre-52", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.20.6-pre-51", + "version": "1.20.6-pre-52", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 3625d2ac5..da591eef0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.20.6-pre-51", + "version": "1.20.6-pre-52", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", From 610e11872e9b62b4478b636d340b7b9e3638cc8c Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Mon, 24 Nov 2025 16:38:22 +0530 Subject: [PATCH 8/9] chore: bump version to 1.20.6-pre-53 and add new vulnerability discovery age and fix availability options --- package-lock.json | 4 ++-- package.json | 2 +- src/Shared/Components/Security/index.tsx | 1 + src/Shared/Components/Security/types.tsx | 12 ++++++++++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 25d376a8a..64831ace8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.20.6-pre-52", + "version": "1.20.6-pre-53", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.20.6-pre-52", + "version": "1.20.6-pre-53", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index da591eef0..6545ce2a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.20.6-pre-52", + "version": "1.20.6-pre-53", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", diff --git a/src/Shared/Components/Security/index.tsx b/src/Shared/Components/Security/index.tsx index c08f3cfc2..08d1890a4 100644 --- a/src/Shared/Components/Security/index.tsx +++ b/src/Shared/Components/Security/index.tsx @@ -18,5 +18,6 @@ export { SEVERITY_LABEL_MAP } from './constants' export * from './SecurityDetailsCards' export * from './SecurityModal' export { default as SeverityChip } from './SeverityChip' +export { FixAvailabilityOptions, VulnerabilityDiscoveryAgeOptions } from './types' export * from './utils' export * from './Vulnerabilities' diff --git a/src/Shared/Components/Security/types.tsx b/src/Shared/Components/Security/types.tsx index c7372ee97..c9e8e13e7 100644 --- a/src/Shared/Components/Security/types.tsx +++ b/src/Shared/Components/Security/types.tsx @@ -42,3 +42,15 @@ export interface GetSidebarDataParamsType extends Record Date: Tue, 25 Nov 2025 15:18:29 +0530 Subject: [PATCH 9/9] feat: enhance `getSelectPickerOptionsByValue` to support grouped options by flattening them before filtering. --- src/Shared/Components/SelectPicker/utils.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Shared/Components/SelectPicker/utils.ts b/src/Shared/Components/SelectPicker/utils.ts index 799721984..1b3e33d57 100644 --- a/src/Shared/Components/SelectPicker/utils.ts +++ b/src/Shared/Components/SelectPicker/utils.ts @@ -437,6 +437,16 @@ export const getSelectPickerOptionByValue = ( } export const getSelectPickerOptionsByValue = ( - optionsList: SelectPickerOptionType[], + optionsList: OptionsOrGroups, GroupBase>>, values: OptionValue[], -): SelectPickerOptionType[] => (optionsList ?? []).filter((option) => values.includes(option.value)) +): SelectPickerOptionType[] => { + if (!Array.isArray(optionsList)) { + return [] + } + + const flatOptionsList = optionsList.flatMap>((groupOrBaseOption) => + 'options' in groupOrBaseOption ? groupOrBaseOption.options : [groupOrBaseOption], + ) + + return flatOptionsList.filter((option) => values.includes(option.value)) +}