fix: UID Filter Improvement (#7741)

Co-authored-by: sumit_chaturvedi <chaturvedi.sumit@tftus.com>
This commit is contained in:
Pablo Laraandsumit_chaturvedi authored and César Arroba committed 2025-05-19 10:46:40 +02:00
1 parent e539b1ab4d
commit a0e72eab0b
5 files changed
+60 -15

No files matched your search

@@ -18,6 +18,8 @@ import { PlusCircleIcon } from "@/components/icons";
import { useUrlFilters } from "@/hooks/use-url-filters";
import { CustomDropdownFilterProps } from "@/types";
import { EntityInfoShort } from "../entities";
const filterSelectedClass =
"inline-flex items-center border py-1 text-xs transition-colors border-transparent bg-default-500 text-secondary-foreground hover:bg-default-500/80 rounded-md px-2 font-normal";
@@ -192,18 +194,35 @@ export const CustomDropdownFilter: React.FC<CustomDropdownFilterProps> = ({
hideScrollBar
className="flex max-h-96 max-w-56 flex-col gap-y-2 py-2"
>
{memoizedFilterValues.map((value) => (
<Checkbox
classNames={{
label: "text-small font-normal",
wrapper: "checkbox-update",
}}
key={value}
value={value}
>
{value}
</Checkbox>
))}
{memoizedFilterValues.map((value) => {
// Find the corresponding entity from valueLabelMapping
const matchingEntry = filter.valueLabelMapping?.find(
(entry) => entry[value],
);
const entity = matchingEntry?.[value];
return (
<Checkbox
classNames={{
label: "text-small font-normal",
wrapper: "checkbox-update",
}}
key={value}
value={value}
>
{entity ? (
<EntityInfoShort
cloudProvider={entity.provider}
entityAlias={entity.alias}
entityId={entity.uid}
hideCopyButton
/>
) : (
value
)}
</Checkbox>
);
})}
</ScrollShadow>
</CheckboxGroup>
</div>