fix data list bug
This commit is contained in:
parent
4182f2bd58
commit
817714df0b
2 changed files with 10 additions and 10 deletions
|
@ -33,7 +33,7 @@ export const AssociatedRolesModal = (props: AssociatedRolesModalProps) => {
|
||||||
const { t } = useTranslation("roles");
|
const { t } = useTranslation("roles");
|
||||||
const [name, setName] = useState("");
|
const [name, setName] = useState("");
|
||||||
const adminClient = useAdminClient();
|
const adminClient = useAdminClient();
|
||||||
const [selectedRows, setSelectedRows] = useState<RoleRepresentation[]>([]);
|
const [selectedRows, setSelectedRows] = useState<Role[]>([]);
|
||||||
const errorHandler = useErrorHandler();
|
const errorHandler = useErrorHandler();
|
||||||
|
|
||||||
const [isFilterDropdownOpen, setIsFilterDropdownOpen] = useState(false);
|
const [isFilterDropdownOpen, setIsFilterDropdownOpen] = useState(false);
|
||||||
|
@ -69,10 +69,10 @@ export const AssociatedRolesModal = (props: AssociatedRolesModalProps) => {
|
||||||
)!.clientId!)
|
)!.clientId!)
|
||||||
);
|
);
|
||||||
|
|
||||||
return alphabetize(filterDupes).filter((role: RoleRepresentation) => {
|
return alphabetize(filterDupes).filter((role: Role) => {
|
||||||
return (
|
return (
|
||||||
props.existingCompositeRoles.find(
|
props.existingCompositeRoles.find(
|
||||||
(existing: RoleRepresentation) => existing.name === role.name
|
(existing: Role) => existing.name === role.name
|
||||||
) === undefined && role.name !== name
|
) === undefined && role.name !== name
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -116,7 +116,7 @@ export const AssociatedRolesModal = (props: AssociatedRolesModalProps) => {
|
||||||
)!.clientId!)
|
)!.clientId!)
|
||||||
);
|
);
|
||||||
|
|
||||||
return alphabetize(rolesList).filter((role: RoleRepresentation) => {
|
return alphabetize(rolesList).filter((role: Role) => {
|
||||||
return (
|
return (
|
||||||
existingAdditionalRoles.find(
|
existingAdditionalRoles.find(
|
||||||
(existing: RoleRepresentation) => existing.name === role.name
|
(existing: RoleRepresentation) => existing.name === role.name
|
||||||
|
@ -170,6 +170,7 @@ export const AssociatedRolesModal = (props: AssociatedRolesModalProps) => {
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
props.toggleDialog();
|
props.toggleDialog();
|
||||||
props.onConfirm(selectedRows);
|
props.onConfirm(selectedRows);
|
||||||
|
console.log(selectedRows)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("common:add")}
|
{t("common:add")}
|
||||||
|
|
|
@ -13,7 +13,6 @@ import {
|
||||||
import RoleRepresentation from "keycloak-admin/lib/defs/roleRepresentation";
|
import RoleRepresentation from "keycloak-admin/lib/defs/roleRepresentation";
|
||||||
import { ListEmptyState } from "../components/list-empty-state/ListEmptyState";
|
import { ListEmptyState } from "../components/list-empty-state/ListEmptyState";
|
||||||
import { KeycloakDataTable } from "../components/table-toolbar/KeycloakDataTable";
|
import { KeycloakDataTable } from "../components/table-toolbar/KeycloakDataTable";
|
||||||
import { formattedLinkTableCell } from "../components/external-link/FormattedLink";
|
|
||||||
import { useAlerts } from "../components/alert/Alerts";
|
import { useAlerts } from "../components/alert/Alerts";
|
||||||
import { useConfirmDialog } from "../components/confirm-dialog/ConfirmDialog";
|
import { useConfirmDialog } from "../components/confirm-dialog/ConfirmDialog";
|
||||||
import { emptyFormatter } from "../util";
|
import { emptyFormatter } from "../util";
|
||||||
|
@ -135,7 +134,7 @@ export const AssociatedRolesTab = ({
|
||||||
refresh();
|
refresh();
|
||||||
}, [additionalRoles, isInheritedHidden]);
|
}, [additionalRoles, isInheritedHidden]);
|
||||||
|
|
||||||
const InheritedRoleName = (role: RoleRepresentation) => {
|
const InheritedRoleName = (role: Role) => {
|
||||||
return <>{inheritanceMap.current[role.id!]}</>;
|
return <>{inheritanceMap.current[role.id!]}</>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -268,7 +267,7 @@ export const AssociatedRolesTab = ({
|
||||||
name: "name",
|
name: "name",
|
||||||
displayKey: "roles:roleName",
|
displayKey: "roles:roleName",
|
||||||
cellRenderer: AliasRenderer,
|
cellRenderer: AliasRenderer,
|
||||||
cellFormatters: [formattedLinkTableCell(), emptyFormatter()],
|
cellFormatters: [emptyFormatter()],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "containerId",
|
name: "containerId",
|
||||||
|
|
Loading…
Reference in a new issue