From eb94ded90a298001c0793972f00341ae58c94a84 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Tue, 13 Apr 2021 02:05:00 +0200 Subject: [PATCH] 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> --- src/clients/add/CapabilityConfig.tsx | 16 +++++++++++++ src/clients/add/NewClientForm.tsx | 34 +++++++++++++++++++++------- src/clients/help.json | 2 ++ src/clients/messages.json | 2 +- 4 files changed, 45 insertions(+), 9 deletions(-) diff --git a/src/clients/add/CapabilityConfig.tsx b/src/clients/add/CapabilityConfig.tsx index df46404bcd..7f1f5521d7 100644 --- a/src/clients/add/CapabilityConfig.tsx +++ b/src/clients/add/CapabilityConfig.tsx @@ -37,6 +37,13 @@ export const CapabilityConfig = ({ hasNoPaddingTop label={t("clientAuthentication")} fieldId="kc-authentication" + labelIcon={ + + } > + } > { } }; + 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 = () => ( @@ -60,12 +82,8 @@ export const NewClientForm = () => {