From 5fda97eadfe669c33a303b3ee8c5cf50d5b7c677 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Tue, 4 Nov 2025 11:47:30 +0530 Subject: [PATCH 1/2] feat: add support for abort signal in getClusterOptions function --- src/Shared/Services/common.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Shared/Services/common.service.ts b/src/Shared/Services/common.service.ts index 4da269fb8..186bc64de 100644 --- a/src/Shared/Services/common.service.ts +++ b/src/Shared/Services/common.service.ts @@ -41,8 +41,8 @@ export const saveCDPipeline = (request, { isTemplateView }: Required get(ROUTES.ENVIRONMENT_DATA) -export const getClusterOptions = async (): Promise => { - const { result } = await get(ROUTES.CLUSTER_LIST_MIN) +export const getClusterOptions = async (signal?: AbortSignal): Promise => { + const { result } = await get(ROUTES.CLUSTER_LIST_MIN, { signal }) if (!result) { return [] From 41b0b8fc0291c26268b24680144b9ee3e95e06b9 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Thu, 6 Nov 2025 13:39:02 +0530 Subject: [PATCH 2/2] feat: add isUserIdentifier prop to SelectPicker components for user-specific rendering --- .../SelectPicker/FilterSelectPicker.tsx | 2 + .../SelectPicker/SelectPicker.component.tsx | 9 +++- src/Shared/Components/SelectPicker/common.tsx | 43 ++++++++++++++++--- src/Shared/Components/SelectPicker/type.ts | 3 ++ 4 files changed, 49 insertions(+), 8 deletions(-) diff --git a/src/Shared/Components/SelectPicker/FilterSelectPicker.tsx b/src/Shared/Components/SelectPicker/FilterSelectPicker.tsx index 1bfa388f3..1971725fd 100644 --- a/src/Shared/Components/SelectPicker/FilterSelectPicker.tsx +++ b/src/Shared/Components/SelectPicker/FilterSelectPicker.tsx @@ -34,6 +34,7 @@ const FilterSelectPicker = ({ options, menuIsOpen = false, onMenuClose, + isUserIdentifier, ...props }: FilterSelectPickerProps) => { const selectRef = useRef['selectRef']['current']>() @@ -110,6 +111,7 @@ const FilterSelectPicker = ({
{...props} + isUserIdentifier={isUserIdentifier} selectRef={selectRef} options={options} value={selectedOptions} diff --git a/src/Shared/Components/SelectPicker/SelectPicker.component.tsx b/src/Shared/Components/SelectPicker/SelectPicker.component.tsx index 72e2b2ef1..8251b3892 100644 --- a/src/Shared/Components/SelectPicker/SelectPicker.component.tsx +++ b/src/Shared/Components/SelectPicker/SelectPicker.component.tsx @@ -199,6 +199,7 @@ const SelectPicker = ({ menuPosition = 'fixed', variant = SelectPickerVariantType.DEFAULT, disableDescriptionEllipsis = false, + isUserIdentifier = false, multiSelectProps = {}, isMulti, name, @@ -302,9 +303,13 @@ const SelectPicker = ({ const renderOption = useCallback( (optionProps: OptionProps>) => ( - + ), - [disableDescriptionEllipsis], + [disableDescriptionEllipsis, isUserIdentifier], ) const renderMultiValue = (multiValueProps: MultiValueProps, true>) => ( diff --git a/src/Shared/Components/SelectPicker/common.tsx b/src/Shared/Components/SelectPicker/common.tsx index 38d0d32af..a10bb5335 100644 --- a/src/Shared/Components/SelectPicker/common.tsx +++ b/src/Shared/Components/SelectPicker/common.tsx @@ -32,11 +32,11 @@ import { ReactComponent as ICCaretDown } from '@Icons/ic-caret-down.svg' import { ReactComponent as ICClose } from '@Icons/ic-close.svg' import { Checkbox } from '@Common/Checkbox' import { ReactSelectInputAction } from '@Common/Constants' -import { noop } from '@Common/Helper' +import { getAlphabetIcon, noop } from '@Common/Helper' import { Progressing } from '@Common/Progressing' import { Tooltip, TooltipProps } from '@Common/Tooltip' import { CHECKBOX_VALUE } from '@Common/Types' -import { ComponentSizeType } from '@Shared/constants' +import { API_TOKEN_PREFIX, ComponentSizeType } from '@Shared/constants' import { isNullOrUndefined } from '@Shared/Helpers' import { Button, ButtonProps, ButtonVariantType } from '../Button' @@ -191,9 +191,10 @@ export const SelectPickerValueContainer = export const SelectPickerOption = ({ disableDescriptionEllipsis, + isUserIdentifier, ...props }: OptionProps> & - Pick, 'disableDescriptionEllipsis'>) => { + Pick, 'disableDescriptionEllipsis' | 'isUserIdentifier'>) => { const { label, data, @@ -215,17 +216,47 @@ export const SelectPickerOption = ({ const iconBaseClass = 'dc__no-shrink icon-dim-16 flex dc__fill-available-space' + const showUserAvatar = isUserIdentifier && !isSelected && typeof label === 'string' + + const renderLabelText = () => { + if (showUserAvatar && label.startsWith(API_TOKEN_PREFIX)) { + return label.split(':')?.[1] || '-' + } + + return label + } + + const renderAvatar = () => { + if (!showUserAvatar) { + return null + } + + return ( +
+ {label.startsWith(API_TOKEN_PREFIX) ? ( + + ) : ( + getAlphabetIcon(label, 'dc__no-shrink m-0-imp') + )} +
+ ) + } + return ( - +
+ {showUserAvatar && renderAvatar()} {isMulti && showCheckboxForMultiSelect && !isCreatableOption && ( )} @@ -243,7 +274,7 @@ export const SelectPickerOption = ({

- {label} + {renderLabelText()}

{/* Add support for custom ellipsis if required */} diff --git a/src/Shared/Components/SelectPicker/type.ts b/src/Shared/Components/SelectPicker/type.ts index f32436e92..e09ce9ee4 100644 --- a/src/Shared/Components/SelectPicker/type.ts +++ b/src/Shared/Components/SelectPicker/type.ts @@ -310,6 +310,7 @@ export type SelectPickerProps, 'customDisplayText'>> & { /** * If true, the group heading can be selected @@ -328,6 +329,7 @@ export type SelectPickerProps { appliedFilterOptions: SelectPickerOptionType[] handleApplyFilter: (filtersToApply: SelectPickerOptionType[]) => void