Sort the IDPs in the admin console admin and organization tables by alias (#32999)

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

Closes #32669

Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
This commit is contained in:
Stefan Guilhen 2024-09-18 02:18:10 -03:00 committed by GitHub
parent d9de358a7f
commit 6503d202ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -135,7 +135,7 @@ export default function IdentityProvidersSection() {
params.search = search; params.search = search;
} }
const providers = await adminClient.identityProviders.find(params); const providers = await adminClient.identityProviders.find(params);
return sortBy(providers, ["config.guiOrder", "alias"]); return sortBy(providers, "alias");
}; };
const navigateToCreate = (providerId: string) => const navigateToCreate = (providerId: string) =>

View file

@ -12,6 +12,7 @@ import {
Switch, Switch,
ToolbarItem, ToolbarItem,
} from "@patternfly/react-core"; } from "@patternfly/react-core";
import { sortBy } from "lodash-es";
import { BellIcon } from "@patternfly/react-icons"; import { BellIcon } from "@patternfly/react-icons";
import { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
@ -89,8 +90,12 @@ export const IdentityProviders = () => {
[], [],
); );
const loader = () => const loader = async () => {
adminClient.organizations.listIdentityProviders({ orgId: orgId! }); const providers = await adminClient.organizations.listIdentityProviders({
orgId: orgId!,
});
return sortBy(providers, "alias");
};
const [toggleUnlinkDialog, UnlinkConfirm] = useConfirmDialog({ const [toggleUnlinkDialog, UnlinkConfirm] = useConfirmDialog({
titleKey: "identityProviderUnlink", titleKey: "identityProviderUnlink",