Skip to content

Commit

Permalink
Sort the IDPs in the admin console admin and organization tables by a…
Browse files Browse the repository at this point in the history
…lias (keycloak#32999)

- prevent issues when ordering by guiOrder due to pagination of results

Closes keycloak#32669

Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
  • Loading branch information
sguilhen authored Sep 18, 2024
1 parent d9de358 commit 6503d20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default function IdentityProvidersSection() {
params.search = search;
}
const providers = await adminClient.identityProviders.find(params);
return sortBy(providers, ["config.guiOrder", "alias"]);
return sortBy(providers, "alias");
};

const navigateToCreate = (providerId: string) =>
Expand Down
9 changes: 7 additions & 2 deletions js/apps/admin-ui/src/organizations/IdentityProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
Switch,
ToolbarItem,
} from "@patternfly/react-core";
import { sortBy } from "lodash-es";
import { BellIcon } from "@patternfly/react-icons";
import { useState } from "react";
import { useTranslation } from "react-i18next";
Expand Down Expand Up @@ -89,8 +90,12 @@ export const IdentityProviders = () => {
[],
);

const loader = () =>
adminClient.organizations.listIdentityProviders({ orgId: orgId! });
const loader = async () => {
const providers = await adminClient.organizations.listIdentityProviders({
orgId: orgId!,
});
return sortBy(providers, "alias");
};

const [toggleUnlinkDialog, UnlinkConfirm] = useConfirmDialog({
titleKey: "identityProviderUnlink",
Expand Down

0 comments on commit 6503d20

Please sign in to comment.