more help items and small linout (#519)

* more help items and small linout

* fixed clicking the steps links clearing the form

* fixed validation when jumping pages

* changed help text

* Update src/clients/help.json

Co-authored-by: Eugenia <32821331+jenny-s51@users.noreply.github.com>

Co-authored-by: Eugenia <32821331+jenny-s51@users.noreply.github.com>
This commit is contained in:
Erik Jan de Wit 2021-04-13 02:05:00 +02:00 committed by GitHub
parent ceabb4f690
commit eb94ded90a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 9 deletions

View file

@ -37,6 +37,13 @@ export const CapabilityConfig = ({
hasNoPaddingTop
label={t("clientAuthentication")}
fieldId="kc-authentication"
labelIcon={
<HelpItem
helpText="clients-help:authentication"
forLabel={t("authentication")}
forID="kc-authentication"
/>
}
>
<Controller
name="publicClient"
@ -59,6 +66,13 @@ export const CapabilityConfig = ({
hasNoPaddingTop
label={t("clientAuthorization")}
fieldId="kc-authorization"
labelIcon={
<HelpItem
helpText="clients-help:authorization"
forLabel={t("authorization")}
forID="kc-authorization"
/>
}
>
<Controller
name="authorizationServicesEnabled"
@ -206,6 +220,7 @@ export const CapabilityConfig = ({
}
label={t("encryptAssertions")}
fieldId="kc-encrypt"
hasNoPaddingTop
>
<Controller
name="attributes.saml_encrypt"
@ -233,6 +248,7 @@ export const CapabilityConfig = ({
}
label={t("clientSignature")}
fieldId="kc-client-signature"
hasNoPaddingTop
>
<Controller
name="attributes.saml_client_signature"

View file

@ -7,6 +7,7 @@ import {
WizardFooter,
WizardContextConsumer,
Button,
WizardStepFunctionType,
} from "@patternfly/react-core";
import { useTranslation } from "react-i18next";
import { FormProvider, useForm } from "react-hook-form";
@ -51,6 +52,27 @@ export const NewClientForm = () => {
}
};
const forward = async (onNext: () => void) => {
if (await methods.trigger()) {
setClient({ ...client, ...methods.getValues() });
setShowCapabilityConfig(true);
onNext();
}
};
const back = () => {
setClient({ ...client, ...methods.getValues() });
methods.reset({ ...client, ...methods.getValues() });
};
const onGoToStep = (newStep: { id?: string | number }) => {
if (newStep.id === "generalSettings") {
back();
} else {
forward(() => {});
}
};
const Footer = () => (
<WizardFooter>
<WizardContextConsumer>
@ -60,12 +82,8 @@ export const NewClientForm = () => {
<Button
variant="primary"
type="submit"
onClick={async () => {
if (await methods.trigger()) {
setClient({ ...client, ...methods.getValues() });
setShowCapabilityConfig(true);
onNext();
}
onClick={() => {
forward(onNext);
}}
>
{activeStep.name === t("capabilityConfig")
@ -75,8 +93,7 @@ export const NewClientForm = () => {
<Button
variant="secondary"
onClick={() => {
setClient({ ...client, ...methods.getValues() });
methods.reset({ ...client, ...methods.getValues() });
back();
onBack();
}}
isDisabled={activeStep.name === t("generalSettings")}
@ -126,6 +143,7 @@ export const NewClientForm = () => {
]}
footer={<Footer />}
onSave={save}
onGoToStep={onGoToStep}
/>
</FormProvider>
</PageSection>

View file

@ -2,6 +2,8 @@
"clients-help": {
"clientType": "'OpenID connect' allows Clients to verify the identity of the End-User based on the authentication performed by an Authorization Server.'SAML' enables web-based authentication and authorization scenarios including cross-domain single sign-on (SSO) and uses security tokens containing assertions to pass information.",
"serviceAccount": "Allows you to authenticate this client to Keycloak and retrieve access token dedicated to this client. In terms of OAuth2 specification, this enables support of 'Client Credentials Grant' for this client.",
"authentication": "This defines the type of the OIDC client. When it's ON, the OIDC type is set to confidential access type. When it's OFF, it is set to public access type",
"authorization": "Enable/Disable fine-grained authorization support for a client",
"directAccess": "This enables support for Direct Access Grants, which means that client has access to username/password of user and exchange it directly with Keycloak server for access token. In terms of OAuth2 specification, this enables support of 'Resource Owner Password Credentials Grant' for this client.",
"standardFlow": "This enables standard OpenID Connect redirect based authentication with authorization code. In terms of OpenID Connect or OAuth2 specifications, this enables support of 'Authorization Code Flow' for this client.",
"implicitFlow": "This enables support for OpenID Connect redirect based authentication without authorization code. In terms of OpenID Connect or OAuth2 specifications, this enables support of 'Implicit Flow' for this client.",

View file

@ -1,7 +1,7 @@
{
"clients": {
"clientType": "Client type",
"clientAuthorization": "Client authorization",
"clientAuthorization": "Authorization",
"implicitFlow": "Implicit flow",
"createClient": "Create client",
"importClient": "Import client",