Fixed the saml tests (#3494)

This commit is contained in:
Erik Jan de Wit 2022-10-06 11:57:58 +02:00 committed by GitHub
parent de2be0f063
commit 8a6df5d743
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View file

@ -271,7 +271,7 @@ export default function DetailSettings() {
</>
)}
{isOIDC && <OIDCGeneralSettings id={alias} />}
{isSAML && <SamlGeneralSettings id={alias} />}
{isSAML && <SamlGeneralSettings id={alias} isAliasReadonly />}
</FormAccess>
),
},

View file

@ -6,8 +6,6 @@ import { HelpItem } from "../../components/help-enabler/HelpItem";
import { RedirectUrl } from "../component/RedirectUrl";
import { TextField } from "../component/TextField";
import { DisplayOrder } from "../component/DisplayOrder";
import { useParams } from "react-router";
import type { IdentityProviderParams } from "../routes/IdentityProvider";
import { FormattedLink } from "../../components/external-link/FormattedLink";
import { KeycloakTextInput } from "../../components/keycloak-text-input/KeycloakTextInput";
import { useRealm } from "../../context/realm-context/RealmContext";
@ -15,10 +13,17 @@ import environment from "../../environment";
import "./saml-general-settings.css";
export const SamlGeneralSettings = ({ id }: { id: string }) => {
type SamlGeneralSettingsProps = {
id: string;
isAliasReadonly?: boolean;
};
export const SamlGeneralSettings = ({
id,
isAliasReadonly = false,
}: SamlGeneralSettingsProps) => {
const { t } = useTranslation("identity-providers");
const { realm } = useRealm();
const { tab } = useParams<IdentityProviderParams>();
const {
register,
@ -53,7 +58,7 @@ export const SamlGeneralSettings = ({ id }: { id: string }) => {
id="alias"
data-testid="alias"
name="alias"
isReadOnly={tab === "settings"}
isReadOnly={isAliasReadonly}
validated={
errors.alias ? ValidatedOptions.error : ValidatedOptions.default
}