Fix policy profiles (#2120)
This commit is contained in:
parent
3bf43f15c0
commit
14ab0ceacb
2 changed files with 7 additions and 7 deletions
|
@ -49,15 +49,18 @@ export const AddClientProfileModal = (props: AddClientProfileModalProps) => {
|
|||
[]
|
||||
);
|
||||
|
||||
const loader = async () => tableProfiles ?? [];
|
||||
const loader = async () =>
|
||||
tableProfiles?.filter((item) => !props.allProfiles.includes(item.name!)) ??
|
||||
[];
|
||||
|
||||
if (!tableProfiles) {
|
||||
return <KeycloakSpinner />;
|
||||
}
|
||||
|
||||
const AliasRenderer = ({ name }: ClientProfile) => (
|
||||
const AliasRenderer = ({ name, global }: ClientProfile) => (
|
||||
<>
|
||||
{name && <Label color="blue">{name}</Label>} {name}
|
||||
{name}{" "}
|
||||
{global && <Label color="blue">{t("realm-settings:global")}</Label>}
|
||||
</>
|
||||
);
|
||||
|
||||
|
@ -94,9 +97,6 @@ export const AddClientProfileModal = (props: AddClientProfileModalProps) => {
|
|||
>
|
||||
<KeycloakDataTable
|
||||
loader={loader}
|
||||
isRowDisabled={(value) =>
|
||||
props.allProfiles.includes(value.name!) || false
|
||||
}
|
||||
ariaLabelKey="realm-settings:profilesList"
|
||||
searchPlaceholderKey="realm-settings:searchProfile"
|
||||
canSelectAll
|
||||
|
|
|
@ -387,7 +387,7 @@ export default function NewClientPolicyForm() {
|
|||
const addProfiles = async (profiles: string[]) => {
|
||||
const createdPolicy = {
|
||||
...currentPolicy,
|
||||
profiles: (currentPolicy?.profiles ?? []).concat(profiles),
|
||||
profiles: policyProfiles.concat(profiles),
|
||||
conditions: currentPolicy?.conditions,
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue