diff --git a/src/PageNav.tsx b/src/PageNav.tsx index 954def4738..350b7ee4ea 100644 --- a/src/PageNav.tsx +++ b/src/PageNav.tsx @@ -49,7 +49,6 @@ export const PageNav: React.FunctionComponent = () => { type LeftNavProps = { title: string; path: string }; const LeftNav = ({ title, path }: LeftNavProps) => { const route = routes(() => {}).find((route) => route.path === path); - console.log(`hasAccess(${route!.access})=` + hasAccess(route!.access)); if (!route || !hasAccess(route.access)) return <>; return ( diff --git a/src/client-scopes/add/RoleMappingForm.tsx b/src/client-scopes/add/RoleMappingForm.tsx index 7de21a490a..eebfade001 100644 --- a/src/client-scopes/add/RoleMappingForm.tsx +++ b/src/client-scopes/add/RoleMappingForm.tsx @@ -16,6 +16,7 @@ import { Split, SplitItem, Divider, + ValidatedOptions, } from "@patternfly/react-core"; import { useAlerts } from "../../components/alert/Alerts"; @@ -173,7 +174,9 @@ export const RoleMappingForm = ({ clientScopeId }: RoleMappingFormProps) => { } fieldId="name" isRequired - validated={errors.name ? "error" : "default"} + validated={ + errors.name ? ValidatedOptions.error : ValidatedOptions.default + } helperTextInvalid={t("common:required")} > { type="text" id="name" name="name" + validated={ + errors.name ? ValidatedOptions.error : ValidatedOptions.default + } /> { } fieldId="kc-name" isRequired - validated={errors.name ? "error" : "default"} + validated={ + errors.name + ? ValidatedOptions.error + : ValidatedOptions.default + } helperTextInvalid={t("common:required")} > { type="text" id="kc-name" name="name" + validated={ + errors.name + ? ValidatedOptions.error + : ValidatedOptions.default + } /> { label={t("clientID")} fieldId="kc-client-id" helperTextInvalid={t("common:required")} - validated={errors.clientId ? "error" : "default"} + validated={ + errors.clientId ? ValidatedOptions.error : ValidatedOptions.default + } isRequired > { type="text" id="kc-client-id" name="clientId" + validated={ + errors.clientId ? ValidatedOptions.error : ValidatedOptions.default + } /> diff --git a/src/common-messages.json b/src/common-messages.json index 43426220f8..14c0c1b2ff 100644 --- a/src/common-messages.json +++ b/src/common-messages.json @@ -52,6 +52,7 @@ "userFederation": "User federation", "required": "Required field", + "maxLength": "Max length {{length}}", "createRealm": "Create Realm" } diff --git a/src/context/whoami/WhoAmI.tsx b/src/context/whoami/WhoAmI.tsx index ce88e94bca..b742cb06e6 100644 --- a/src/context/whoami/WhoAmI.tsx +++ b/src/context/whoami/WhoAmI.tsx @@ -14,7 +14,7 @@ export class WhoAmI { ) { if (this.me !== undefined && this.me.locale) { i18n.changeLanguage(this.me.locale, (error) => { - if (error) console.log("Unable to set locale to " + this.me?.locale); + if (error) console.error("Unable to set locale to", this.me?.locale); }); } } diff --git a/src/groups/GroupsCreateModal.tsx b/src/groups/GroupsCreateModal.tsx index d78c806d05..b0e27c12df 100644 --- a/src/groups/GroupsCreateModal.tsx +++ b/src/groups/GroupsCreateModal.tsx @@ -7,6 +7,7 @@ import { Modal, ModalVariant, TextInput, + ValidatedOptions, } from "@patternfly/react-core"; import { useTranslation } from "react-i18next"; import { HttpClientContext } from "../context/http-service/HttpClientContext"; @@ -80,7 +81,9 @@ export const GroupsCreateModal = ({ label={t("name")} fieldId="group-id" helperTextInvalid={t("common:required")} - validated={errors.name ? "error" : "default"} + validated={ + errors.name ? ValidatedOptions.error : ValidatedOptions.default + } isRequired > diff --git a/src/realm-roles/add/NewRoleForm.tsx b/src/realm-roles/add/NewRoleForm.tsx index 8e7f391718..8cc567da44 100644 --- a/src/realm-roles/add/NewRoleForm.tsx +++ b/src/realm-roles/add/NewRoleForm.tsx @@ -18,7 +18,7 @@ import { import { RoleRepresentation } from "../../model/role-model"; import { HttpClientContext } from "../../context/http-service/HttpClientContext"; import { useAlerts } from "../../components/alert/Alerts"; -import { Controller, useForm, FieldErrors } from "react-hook-form"; +import { Controller, useForm } from "react-hook-form"; import { RealmContext } from "../../context/realm-context/RealmContext"; export const NewRoleForm = () => { @@ -40,8 +40,6 @@ export const NewRoleForm = () => { } }; - console.log(errors); - return ( <> @@ -52,24 +50,35 @@ export const NewRoleForm = () => {
- + {