mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-29 16:14:42 +00:00
feat: show labels in widget selector
This commit is contained in:
parent
d6088f97e7
commit
f9f463cce6
@ -65,6 +65,7 @@ const CustomMultiSelect: React.FC<CustomMultiSelectProps> = ({
|
|||||||
maxTagTextLength,
|
maxTagTextLength,
|
||||||
onDropdownVisibleChange,
|
onDropdownVisibleChange,
|
||||||
showIncompleteDataMessage = false,
|
showIncompleteDataMessage = false,
|
||||||
|
showLabels = false,
|
||||||
...rest
|
...rest
|
||||||
}) => {
|
}) => {
|
||||||
// ===== State & Refs =====
|
// ===== State & Refs =====
|
||||||
@ -1709,7 +1710,11 @@ const CustomMultiSelect: React.FC<CustomMultiSelectProps> = ({
|
|||||||
// Custom Tag Render (needs significant updates)
|
// Custom Tag Render (needs significant updates)
|
||||||
const tagRender = useCallback(
|
const tagRender = useCallback(
|
||||||
(props: CustomTagProps): React.ReactElement => {
|
(props: CustomTagProps): React.ReactElement => {
|
||||||
const { label, value, closable, onClose } = props;
|
const { label: labelProp, value, closable, onClose } = props;
|
||||||
|
|
||||||
|
const label = showLabels
|
||||||
|
? options.find((option) => option.value === value)?.label || labelProp
|
||||||
|
: labelProp;
|
||||||
|
|
||||||
// If the display value is the special ALL value, render the ALL tag
|
// If the display value is the special ALL value, render the ALL tag
|
||||||
if (allOptionShown) {
|
if (allOptionShown) {
|
||||||
|
|||||||
@ -60,4 +60,5 @@ export interface CustomMultiSelectProps
|
|||||||
onRetry?: () => void;
|
onRetry?: () => void;
|
||||||
maxTagTextLength?: number;
|
maxTagTextLength?: number;
|
||||||
showIncompleteDataMessage?: boolean;
|
showIncompleteDataMessage?: boolean;
|
||||||
|
showLabels?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,7 @@ export function WidgetSelector({
|
|||||||
value={selectedWidgets}
|
value={selectedWidgets}
|
||||||
labelInValue
|
labelInValue
|
||||||
onChange={(value): void => setSelectedWidgets(value as string[])}
|
onChange={(value): void => setSelectedWidgets(value as string[])}
|
||||||
|
showLabels
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user