From b7ce04eb50ed75305fe58ef49edd48e646b74861 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Thu, 19 Oct 2023 12:17:38 +0200 Subject: [PATCH] Make dropdown groups unique (#24137) fixes: #24067 --- .../user-profile/AttributesTab.tsx | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/js/apps/admin-ui/src/realm-settings/user-profile/AttributesTab.tsx b/js/apps/admin-ui/src/realm-settings/user-profile/AttributesTab.tsx index e56a56e3f1..9f15fc8f64 100644 --- a/js/apps/admin-ui/src/realm-settings/user-profile/AttributesTab.tsx +++ b/js/apps/admin-ui/src/realm-settings/user-profile/AttributesTab.tsx @@ -11,10 +11,10 @@ import { ToolbarItem, } from "@patternfly/react-core"; import { FilterIcon } from "@patternfly/react-icons"; +import { uniqBy } from "lodash-es"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { Link, useNavigate } from "react-router-dom"; - import { DraggableTable } from "../../authentication/components/DraggableTable"; import { useConfirmDialog } from "../../components/confirm-dialog/ConfirmDialog"; import { KeycloakSpinner } from "../../components/keycloak-spinner/KeycloakSpinner"; @@ -134,15 +134,16 @@ export const AttributesTab = () => { > {t("allGroups")} , - ...config - .attributes!.filter((attr) => !!attr.group) - .map((attr) => ( - - )), + ...uniqBy( + config.attributes!.filter((attr) => !!attr.group), + "group", + ).map((attr) => ( + + )), ]}