From b49d07e18c3e44b0917812747127c399c5af0950 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Fri, 9 Oct 2020 20:19:14 +0200 Subject: [PATCH] fixed create client scope header (#155) --- src/client-scopes/ClientScopesSection.tsx | 6 +- src/client-scopes/add/NewClientScopeForm.tsx | 312 ++++++++++--------- src/route-config.ts | 4 +- 3 files changed, 170 insertions(+), 152 deletions(-) diff --git a/src/client-scopes/ClientScopesSection.tsx b/src/client-scopes/ClientScopesSection.tsx index 88f719edd4..a72509f1c7 100644 --- a/src/client-scopes/ClientScopesSection.tsx +++ b/src/client-scopes/ClientScopesSection.tsx @@ -56,7 +56,11 @@ export const ClientScopesSection = () => { inputGroupPlaceholder={t("searchFor")} inputGroupOnChange={filterData} toolbarItem={ - } diff --git a/src/client-scopes/add/NewClientScopeForm.tsx b/src/client-scopes/add/NewClientScopeForm.tsx index d50100771c..802cc450ea 100644 --- a/src/client-scopes/add/NewClientScopeForm.tsx +++ b/src/client-scopes/add/NewClientScopeForm.tsx @@ -1,4 +1,5 @@ import React, { useContext, useState } from "react"; +import { useHistory } from "react-router-dom"; import { ActionGroup, AlertVariant, @@ -21,13 +22,15 @@ import { HttpClientContext } from "../../context/http-service/HttpClientContext" import { RealmContext } from "../../context/realm-context/RealmContext"; import { useAlerts } from "../../components/alert/Alerts"; import { useLoginProviders } from "../../context/server-info/ServerInfoProvider"; +import { ViewHeader } from "../../components/view-header/ViewHeader"; export const NewClientScopeForm = () => { const { t } = useTranslation("client-scopes"); const helpText = useTranslation("client-scopes-help").t; - const { register, control, handleSubmit } = useForm< + const { register, control, handleSubmit, errors } = useForm< ClientScopeRepresentation >(); + const history = useHistory(); const httpClient = useContext(HttpClientContext)!; const { realm } = useContext(RealmContext); @@ -58,156 +61,167 @@ export const NewClientScopeForm = () => { }; return ( - -
- - } - fieldId="kc-name" - isRequired - > - - - - } - fieldId="kc-description" - > - - - - } - fieldId="kc-protocol" - > - ( - - )} - /> - - - } - fieldId="kc-display.on.consent.screen" - > - ( - + + + + + - )} - /> - - + - } - fieldId="kc-consent-screen-text" - > - - - + + } + fieldId="kc-description" + > + - } - fieldId="kc-gui-order" - > - - - - - - - - +
+ + } + fieldId="kc-protocol" + > + ( + + )} + /> + + + } + fieldId="kc-display.on.consent.screen" + > + ( + + )} + /> + + + } + fieldId="kc-consent-screen-text" + > + + + + } + fieldId="kc-gui-order" + > + + + + + + + +
+ ); }; diff --git a/src/route-config.ts b/src/route-config.ts index e72474179d..2744f590bc 100644 --- a/src/route-config.ts +++ b/src/route-config.ts @@ -47,10 +47,10 @@ export const routes = (t: TFunction) => [ { path: "/client-scopes", component: ClientScopesSection, - breadcrumb: t("clientScopeList"), + breadcrumb: t("client-scopes:clientScopeList"), }, { - path: "/add-client-scopes", + path: "/client-scopes/add-client-scopes", component: NewClientScopeForm, breadcrumb: t("client-scopes:createClientScope"), },