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

View file

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

View file

@ -2,6 +2,8 @@
"clients-help": { "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.", "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.", "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.", "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.", "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.", "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": { "clients": {
"clientType": "Client type", "clientType": "Client type",
"clientAuthorization": "Client authorization", "clientAuthorization": "Authorization",
"implicitFlow": "Implicit flow", "implicitFlow": "Implicit flow",
"createClient": "Create client", "createClient": "Create client",
"importClient": "Import client", "importClient": "Import client",