From 74aee6090dc4be1772a35fc0f5c2d0a668495c84 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Wed, 31 Mar 2021 15:16:58 +0200 Subject: [PATCH] genericly we want all sections to look like this (#473) * genericly we want all sections to look like this * remove the divider when there are tabs on the page * fix insert on keycloakTab component * lint --- src/authentication/AuthenticationSection.tsx | 4 +- src/client-scopes/ClientScopesSection.tsx | 2 +- src/clients/ClientDetails.tsx | 10 +- src/clients/ClientsSection.tsx | 10 +- src/components/keycloak-tabs/KeycloakTabs.tsx | 6 + src/events/EventsSection.tsx | 8 +- src/groups/GroupAttributes.tsx | 28 +- src/groups/GroupsSection.tsx | 12 +- src/realm-settings/RealmSettingsSection.tsx | 309 +++++++++--------- src/sessions/SessionsSection.tsx | 2 +- src/user/UsersSection.tsx | 6 +- 11 files changed, 206 insertions(+), 191 deletions(-) diff --git a/src/authentication/AuthenticationSection.tsx b/src/authentication/AuthenticationSection.tsx index 97e6935434..06b84cca0f 100644 --- a/src/authentication/AuthenticationSection.tsx +++ b/src/authentication/AuthenticationSection.tsx @@ -185,8 +185,8 @@ export const AuthenticationSection = () => { }} /> )} - - + + { titleKey="clientScopes" subKey="client-scopes:clientScopeExplain" /> - + { /> - + { divider={false} /> - + history.push(createUrl(path, { ...params, [paramName]: key as string })) diff --git a/src/events/EventsSection.tsx b/src/events/EventsSection.tsx index 21ef87142a..30bd8ee1a7 100644 --- a/src/events/EventsSection.tsx +++ b/src/events/EventsSection.tsx @@ -52,8 +52,12 @@ export const EventsSection = () => { return ( <> - - + + { }; return ( - - form.reset({ - attributes: convertAttributes(), - }) - } - /> + + + form.reset({ + attributes: convertAttributes(), + }) + } + /> + ); }; diff --git a/src/groups/GroupsSection.tsx b/src/groups/GroupsSection.tsx index adb80b9117..b1e897056a 100644 --- a/src/groups/GroupsSection.tsx +++ b/src/groups/GroupsSection.tsx @@ -112,7 +112,8 @@ export const GroupsSection = () => { )} { : [SearchDropdown] } /> - + {subGroups.length > 0 && ( setActiveTab(key as number)} isBox > diff --git a/src/realm-settings/RealmSettingsSection.tsx b/src/realm-settings/RealmSettingsSection.tsx index 2258332832..d0f5176515 100644 --- a/src/realm-settings/RealmSettingsSection.tsx +++ b/src/realm-settings/RealmSettingsSection.tsx @@ -20,7 +20,6 @@ import { StackItem, Switch, Tab, - Tabs, TabTitleText, TextInput, } from "@patternfly/react-core"; @@ -35,6 +34,7 @@ import { useAlerts } from "../components/alert/Alerts"; import { FormAccess } from "../components/form-access/FormAccess"; import { HelpItem } from "../components/help-enabler/HelpItem"; import { FormattedLink } from "../components/external-link/FormattedLink"; +import { KeycloakTabs } from "../components/keycloak-tabs/KeycloakTabs"; type RealmSettingsHeaderProps = { onChange: (value: boolean) => void; @@ -89,6 +89,7 @@ const RealmSettingsHeader = ({ {}}> {t("partialImport")} @@ -125,7 +126,6 @@ export const RealmSettingsSection = () => { const { addAlert } = useAlerts(); const { register, control, getValues, setValue, handleSubmit } = useForm(); const [realm, setRealm] = useState(); - const [activeTab, setActiveTab] = useState(0); const [open, setOpen] = useState(false); const baseUrl = getBaseUrl(adminClient); @@ -171,165 +171,170 @@ export const RealmSettingsSection = () => { )} /> - - setActiveTab(key as number)} - isBox - > - {t("general")}}> - - - {realmName} - - - - - + + {t("general")}} + > + + - - - + {realmName} + + + - } - > - - - + + - } - > - ( - - )} - /> - - - } - fieldId="kc-user-manged-access" - > - ( - + - )} - /> - - + - } - fieldId="kc-endpoints" - > - - - + - - - + ( + + )} + /> + + - - - + } + fieldId="kc-user-manged-access" + > + ( + + )} + /> + + + } + fieldId="kc-endpoints" + > + + + + + + + + + - - - - - + + + + + + - + ); diff --git a/src/sessions/SessionsSection.tsx b/src/sessions/SessionsSection.tsx index 879e22c2ee..b66ba25e88 100644 --- a/src/sessions/SessionsSection.tsx +++ b/src/sessions/SessionsSection.tsx @@ -47,7 +47,7 @@ export const SessionsSection = () => { return ( <> - + { <> - + {!listUsers && !initialSearch && ( {