removed some remnant namespaces usage (#23669)

This commit is contained in:
Erik Jan de Wit 2023-10-19 14:07:48 +02:00 committed by GitHub
parent 22868406c2
commit c7183049c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 20 deletions

View file

@ -209,7 +209,6 @@ const AuthorizationEvaluateContent = ({ client }: Props) => {
<ClientSelect
name="client"
label="client"
namespace="clients"
helpText={"clientHelp"}
defaultValue={client.clientId}
/>

View file

@ -15,20 +15,17 @@ import { adminClient } from "../../admin-client";
import { useFetch } from "../../utils/useFetch";
import type { ComponentProps } from "../dynamic/components";
type ClientSelectProps = ComponentProps & {
namespace: string;
};
type ClientSelectProps = ComponentProps & {};
export const ClientSelect = ({
name,
label,
helpText,
defaultValue,
namespace,
isDisabled = false,
required = false,
}: ClientSelectProps) => {
const { t } = useTranslation(namespace);
const { t } = useTranslation();
const {
control,
formState: { errors },
@ -66,12 +63,7 @@ export const ClientSelect = ({
<FormGroup
label={t(label!)}
isRequired={required}
labelIcon={
<HelpItem
helpText={t(helpText!)}
fieldLabelId={`${namespace}:${label}`}
/>
}
labelIcon={<HelpItem helpText={t(helpText!)} fieldLabelId={label!} />}
fieldId={name!}
validated={errors[name!] ? "error" : "default"}
helperTextInvalid={t("required")}

View file

@ -3,11 +3,5 @@ import { ClientSelect } from "../client/ClientSelect";
import { convertToName } from "./DynamicComponents";
export const ClientSelectComponent = (props: ComponentProps) => {
return (
<ClientSelect
{...props}
name={convertToName(props.name!)}
namespace="dynamic"
/>
);
return <ClientSelect {...props} name={convertToName(props.name!)} />;
};

View file

@ -40,7 +40,7 @@ export const AddRoleMappingModal = ({
onAssign,
onClose,
}: AddRoleMappingModalProps) => {
const { t } = useTranslation(type);
const { t } = useTranslation();
const { hasAccess } = useAccess();
const canViewRealmRoles = hasAccess("view-realm") || hasAccess("query-users");