diff --git a/src/realm-roles/AssociatedRolesTab.tsx b/src/realm-roles/AssociatedRolesTab.tsx index 944ecdf648..14dafa8c4f 100644 --- a/src/realm-roles/AssociatedRolesTab.tsx +++ b/src/realm-roles/AssociatedRolesTab.tsx @@ -21,6 +21,7 @@ import { useAdminClient } from "../context/auth/AdminClient"; import type { RoleFormType } from "./RealmRoleTabs"; import type ClientRepresentation from "keycloak-admin/lib/defs/clientRepresentation"; import _ from "lodash"; +import { filter } from "cypress/types/bluebird"; type AssociatedRolesTabProps = { additionalRoles: Role[]; @@ -126,6 +127,15 @@ export const AssociatedRolesTab = ({ )!.clientId!) ); + console.log(filterDupes + .filter((role) => role.clientRole) + .map( + (role) => + (role.clientId = clients.find( + (client) => client.id === role.containerId + )!.clientId!) + )) + return alphabetize(additionalRoles); }); }; diff --git a/src/realm-settings/GeneralTab.tsx b/src/realm-settings/GeneralTab.tsx index 784487a053..8d0b924427 100644 --- a/src/realm-settings/GeneralTab.tsx +++ b/src/realm-settings/GeneralTab.tsx @@ -43,6 +43,35 @@ export const RealmSettingsGeneralTab = ({ const requireSslTypes = ["all", "external", "none"]; +<<<<<<< HEAD +======= + useEffect(() => { + return asyncStateFetch( + () => adminClient.realms.findOne({ realm: realmName }), + (realm) => { + console.log(realm) + setRealm(realm); + setupForm(realm); + }, + handleError + ); + }, []); + + const setupForm = (realm: RealmRepresentation) => { + Object.entries(realm).map((entry) => setValue(entry[0], entry[1])); + }; + + const save = async (realm: RealmRepresentation) => { + try { + await adminClient.realms.update({ realm: realmName }, realm); + setRealm(realm); + addAlert(t("saveSuccess"), AlertVariant.success); + } catch (error) { + addAlert(t("saveError", { error }), AlertVariant.danger); + } + }; + +>>>>>>> wip keys return ( <> diff --git a/src/realm-settings/LoginTab.tsx b/src/realm-settings/LoginTab.tsx index 45b9c721f7..dbdb5fe946 100644 --- a/src/realm-settings/LoginTab.tsx +++ b/src/realm-settings/LoginTab.tsx @@ -6,10 +6,32 @@ import { HelpItem } from "../components/help-enabler/HelpItem"; import { FormPanel } from "../components/scroll-form/FormPanel"; import type RealmRepresentation from "keycloak-admin/lib/defs/realmRepresentation"; +<<<<<<< HEAD type RealmSettingsLoginTabProps = { save: (realm: RealmRepresentation) => void; realm: RealmRepresentation; }; +======= +export const RealmSettingsLoginTab = () => { + const { t } = useTranslation("realm-settings"); + const [realm, setRealm] = useState(); + const handleError = useErrorHandler(); + const adminClient = useAdminClient(); + const { realm: realmName } = useRealm(); + const { addAlert } = useAlerts(); + + useEffect(() => { + + console.log("kjsdlja") + return asyncStateFetch( + () => adminClient.realms.findOne({ realm: realmName }), + (realm) => { + setRealm(realm); + }, + handleError + ); + }, []); +>>>>>>> wip keys export const RealmSettingsLoginTab = ({ save, diff --git a/src/realm-settings/RealmSettingsSection.css b/src/realm-settings/RealmSettingsSection.css index b14a033e39..329b85ac1b 100644 --- a/src/realm-settings/RealmSettingsSection.css +++ b/src/realm-settings/RealmSettingsSection.css @@ -16,6 +16,7 @@ div.pf-c-card__body.kc-form-panel__body { padding-left: 0px; padding-bottom: var(--pf-global--spacer--2xl); } + button#kc-certificate.pf-c-button.pf-m-secondary { margin-left: var(--pf-global--spacer--md); }