set alias to read only in IdPs (#1144)

This commit is contained in:
Jenny 2021-09-13 05:15:04 -04:00 committed by GitHub
parent 779056bef2
commit 7414e174b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View file

@ -77,6 +77,7 @@ export const IdentityProvidersSection = () => {
realm,
providerId: identityProvider.providerId,
alias: identityProvider.alias!,
tab: "settings",
})}
>
{identityProvider.displayName
@ -140,7 +141,7 @@ export const IdentityProvidersSection = () => {
{manageDisplayDialog && (
<ManageOderDialog
onClose={() => setManageDisplayDialog(false)}
providers={providers?.filter((p) => p.enabled)}
providers={providers.filter((p) => p.enabled)}
/>
)}
<ViewHeader

View file

@ -7,10 +7,13 @@ import { HelpItem } from "../../components/help-enabler/HelpItem";
import { RedirectUrl } from "../component/RedirectUrl";
import { TextField } from "../component/TextField";
import { DisplayOrder } from "../component/DisplayOrder";
import type { IdentityProviderTabParams } from "../routes/IdentityProviderTab";
import { useParams } from "react-router-dom";
export const OIDCGeneralSettings = ({ id }: { id: string }) => {
const { t } = useTranslation("identity-providers");
const { t: th } = useTranslation("identity-providers-help");
const { tab } = useParams<IdentityProviderTabParams>();
const { register, errors } = useFormContext();
@ -35,6 +38,7 @@ export const OIDCGeneralSettings = ({ id }: { id: string }) => {
helperTextInvalid={t("common:required")}
>
<TextInput
isReadOnly={tab === "settings"}
isRequired
type="text"
id="alias"

View file

@ -7,10 +7,13 @@ 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 { IdentityProviderTabParams } from "../routes/IdentityProviderTab";
export const SamlGeneralSettings = ({ id }: { id: string }) => {
const { t } = useTranslation("identity-providers");
const { t: th } = useTranslation("identity-providers-help");
const { tab } = useParams<IdentityProviderTabParams>();
const { register, errors } = useFormContext();
@ -40,6 +43,7 @@ export const SamlGeneralSettings = ({ id }: { id: string }) => {
id="alias"
data-testid="alias"
name="alias"
isReadOnly={tab === "settings"}
validated={
errors.alias ? ValidatedOptions.error : ValidatedOptions.default
}