parent
a317f78e65
commit
f99c82cd43
5 changed files with 14 additions and 13 deletions
|
@ -77,7 +77,7 @@ export default function AddOpenIdConnect() {
|
|||
isHorizontal
|
||||
onSubmit={handleSubmit(onSubmit)}
|
||||
>
|
||||
<OIDCGeneralSettings id={id} />
|
||||
<OIDCGeneralSettings />
|
||||
<OpenIdConnectSettings />
|
||||
<OIDCAuthentication />
|
||||
<ActionGroup>
|
||||
|
|
|
@ -70,7 +70,7 @@ export default function AddSamlConnect() {
|
|||
isHorizontal
|
||||
onSubmit={handleSubmit(onSubmit)}
|
||||
>
|
||||
<SamlGeneralSettings id={id} />
|
||||
<SamlGeneralSettings />
|
||||
<SamlConnectSettings />
|
||||
<ActionGroup>
|
||||
<Button
|
||||
|
|
|
@ -344,8 +344,8 @@ export default function DetailSettings() {
|
|||
)}
|
||||
</>
|
||||
)}
|
||||
{isOIDC && <OIDCGeneralSettings id={alias} />}
|
||||
{isSAML && <SamlGeneralSettings id={alias} isAliasReadonly />}
|
||||
{isOIDC && <OIDCGeneralSettings />}
|
||||
{isSAML && <SamlGeneralSettings isAliasReadonly />}
|
||||
</FormAccess>
|
||||
),
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { FormGroup, ValidatedOptions } from "@patternfly/react-core";
|
||||
import { useFormContext } from "react-hook-form";
|
||||
import { useWatch, useFormContext } from "react-hook-form";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useParams } from "react-router-dom";
|
||||
|
||||
|
@ -10,18 +10,21 @@ import { RedirectUrl } from "../component/RedirectUrl";
|
|||
import { TextField } from "../component/TextField";
|
||||
import type { IdentityProviderParams } from "../routes/IdentityProvider";
|
||||
|
||||
export const OIDCGeneralSettings = ({ id }: { id: string }) => {
|
||||
export const OIDCGeneralSettings = () => {
|
||||
const { t } = useTranslation("identity-providers");
|
||||
const { tab } = useParams<IdentityProviderParams>();
|
||||
|
||||
const {
|
||||
register,
|
||||
control,
|
||||
formState: { errors },
|
||||
} = useFormContext();
|
||||
|
||||
const alias = useWatch({ control, name: "alias" });
|
||||
|
||||
return (
|
||||
<>
|
||||
<RedirectUrl id={id} />
|
||||
<RedirectUrl id={alias} />
|
||||
|
||||
<FormGroup
|
||||
label={t("alias")}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { FormGroup, ValidatedOptions } from "@patternfly/react-core";
|
||||
import { useFormContext } from "react-hook-form";
|
||||
import { useWatch, useFormContext } from "react-hook-form";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { FormattedLink } from "../../components/external-link/FormattedLink";
|
||||
|
@ -14,12 +14,10 @@ import { TextField } from "../component/TextField";
|
|||
import "./saml-general-settings.css";
|
||||
|
||||
type SamlGeneralSettingsProps = {
|
||||
id: string;
|
||||
isAliasReadonly?: boolean;
|
||||
};
|
||||
|
||||
export const SamlGeneralSettings = ({
|
||||
id,
|
||||
isAliasReadonly = false,
|
||||
}: SamlGeneralSettingsProps) => {
|
||||
const { t } = useTranslation("identity-providers");
|
||||
|
@ -27,15 +25,15 @@ export const SamlGeneralSettings = ({
|
|||
|
||||
const {
|
||||
register,
|
||||
watch,
|
||||
control,
|
||||
formState: { errors },
|
||||
} = useFormContext();
|
||||
|
||||
const alias = watch("alias");
|
||||
const alias = useWatch({ control, name: "alias" });
|
||||
|
||||
return (
|
||||
<>
|
||||
<RedirectUrl id={id} />
|
||||
<RedirectUrl id={alias} />
|
||||
|
||||
<FormGroup
|
||||
label={t("alias")}
|
||||
|
|
Loading…
Reference in a new issue